Subversion Repositories Kolibri OS

Rev

Rev 2695 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2695 Rev 2875
1
//Leency - 2012
1
//Leency - 2012
2
 
2
 
3
dword onLeft(dword right,left) {EAX=Form.width-right-left;}
3
dword onLeft(dword right,left) {EAX=Form.width-right-left;}
4
dword onTop(dword down,up) {EAX=Form.height-GetSkinWidth()-down-up;}
4
dword onTop(dword down,up) {EAX=Form.height-GetSkinHeight()-down-up;}
5
 
5
 
6
 
6
 
7
void ShowMessage(dword message)
7
void ShowMessage(dword message)
8
{
8
{
9
	DrawFlatButton(Form.width/2-13,160,200,80,0,0xFFB6B5, message);
9
	DrawFlatButton(Form.width/2-13,160,200,80,0,0xFFB6B5, message);
10
	Pause(150);
10
	Pause(150);
11
	List_ReDraw();
11
	List_ReDraw();
12
}
12
}
13
 
13
 
14
 
14
 
15
dword ConvertSize(dword bytes)
15
dword ConvertSize(dword bytes)
16
{
16
{
17
	byte size_prefix[8], temp[3];
17
	byte size_prefix[8], temp[3];
18
	IF (bytes>=1073741824) copystr(" Gb",#temp);
18
	IF (bytes>=1073741824) copystr(" Gb",#temp);
19
	ELSE IF (bytes>=1048576) copystr(" Mb",#temp);
19
	ELSE IF (bytes>=1048576) copystr(" Mb",#temp);
20
	ELSE IF (bytes>=1024) copystr(" Kb",#temp);
20
	ELSE IF (bytes>=1024) copystr(" Kb",#temp);
21
	ELSE copystr(" b ",#temp);
21
	ELSE copystr(" b ",#temp);
22
	WHILE (bytes>1023) bytes/=1024;
22
	WHILE (bytes>1023) bytes/=1024;
23
	copystr(IntToStr(bytes),#size_prefix);
23
	copystr(IntToStr(bytes),#size_prefix);
24
	copystr(#temp,#size_prefix+strlen(#size_prefix));
24
	copystr(#temp,#size_prefix+strlen(#size_prefix));
25
	EAX=#size_prefix;
25
	EAX=#size_prefix;
26
}
26
}
27
 
27
 
28
inline fastcall void TVScroll() { //Ïðîêðóòêà
28
inline fastcall void TVScroll() { //Ïðîêðóòêà
29
	dword on_y;
29
	dword on_y;
30
	IF (count<=0) {DrawFlatButton(onLeft(27,0),57,16,onTop(22,58),0,0xE4DFE1,""); return;}
30
	IF (count<=0) {DrawFlatButton(onLeft(27,0),57,16,onTop(22,58),0,0xE4DFE1,""); return;}
31
	on_y = za_kadrom * onTop(22,57) / count +57;
31
	on_y = za_kadrom * onTop(22,57) / count +57;
32
	scroll_size=onTop(22,57) * but_num - but_num / count;
32
	scroll_size=onTop(22,57) * but_num - but_num / count;
33
	IF (scroll_size<20) scroll_size = 20; //óñòàíàâëèâàåì ìèíèìàëüíûé ðàçìåð ñêðîëëà
33
	IF (scroll_size<20) scroll_size = 20; //óñòàíàâëèâàåì ìèíèìàëüíûé ðàçìåð ñêðîëëà
34
	IF (scroll_size>onTop(22,57)-on_y+56) || (za_kadrom+but_num>=count) on_y=onTop(23+scroll_size,0); //äëÿ áîëüøîãî ñïèñêà 
34
	IF (scroll_size>onTop(22,57)-on_y+56) || (za_kadrom+but_num>=count) on_y=onTop(23+scroll_size,0); //äëÿ áîëüøîãî ñïèñêà 
35
	DrawFlatButton(onLeft(27,0),on_y,16,scroll_size,0,0xE4DFE1,"");//ïîëçóíîê
35
	DrawFlatButton(onLeft(27,0),on_y,16,scroll_size,0,0xE4DFE1,"");//ïîëçóíîê
36
	DrawBar(onLeft(26,0),57,15,on_y-57,0xCED0D0);//ïîëå äî ïîëçóíêà
36
	DrawBar(onLeft(26,0),57,15,on_y-57,0xCED0D0);//ïîëå äî ïîëçóíêà
37
	DrawBar(onLeft(26,0),on_y+scroll_size+1,15,onTop(22,57)-scroll_size-on_y+56,0xCED0D0); //ïîëå ïîñëå ïîëçóíêà
37
	DrawBar(onLeft(26,0),on_y+scroll_size+1,15,onTop(22,57)-scroll_size-on_y+56,0xCED0D0); //ïîëå ïîñëå ïîëçóíêà
38
}
38
}