Subversion Repositories Kolibri OS

Rev

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

Rev 7491 Rev 7634
1
dword col_work_gradient[14];
-
 
2
 
-
 
3
void Scroll() {
1
void Scroll() {
4
	dword i;
2
	dword i;
5
 
3
 
6
	word sc_x = files.x + files.w;
4
	word sc_x = files.x + files.w;
7
	word sc_y = files.y;
5
	word sc_y = files.y;
8
	word sc_h = files.h - 16;
6
	word sc_h = files.h - 16;
9
	word sc_slider_y;
7
	word sc_slider_y;
10
 
8
 
11
	if (files.count<=0)
9
	if (files.count<=0)
12
	{
10
	{
13
		sc_slider_y = sc_y;
11
		sc_slider_y = sc_y;
14
		sc_slider_h = sc_h - 1;
12
		sc_slider_h = sc_h - 1;
15
	}
13
	}
16
	else
14
	else
17
	{
15
	{
18
		sc_slider_y = files.first * sc_h / files.count + sc_y;
16
		sc_slider_y = files.first * sc_h / files.count + sc_y;
19
		sc_slider_h = sc_h * files.visible - files.visible / files.count;
17
		sc_slider_h = sc_h * files.visible - files.visible / files.count;
20
		if (sc_slider_h < 20) sc_slider_h = 20; //minimal scroll width
18
		if (sc_slider_h < 20) sc_slider_h = 20; //minimal scroll width
21
		if (sc_slider_h > sc_h-sc_slider_y+56) || (files.first+files.visible>=files.count) sc_slider_y= sc_y + sc_h - sc_slider_h - 1; //äëÿ áîëüøîãî ñïèñêà 
19
		if (sc_slider_h > sc_h-sc_slider_y+56) || (files.first+files.visible>=files.count) sc_slider_y= sc_y + sc_h - sc_slider_h - 1; //äëÿ áîëüøîãî ñïèñêà 
22
	}
20
	}
23
	//slider
21
	//slider
24
	DrawRectangle(sc_x,sc_slider_y,16,sc_slider_h,col_graph);
22
	DrawRectangle(sc_x,sc_slider_y,16,sc_slider_h,col.graph);
25
	DrawRectangle3D(sc_x+1,sc_slider_y+1,14,sc_slider_h-2, system.color.work_light , system.color.work_dark);
23
	DrawRectangle3D(sc_x+1,sc_slider_y+1,14,sc_slider_h-2, system.color.work_light , system.color.work_dark);
26
	if (!scroll_used) for (i=0; i<13; i++) DrawBar(sc_x + 2 + i, sc_slider_y+2, 1, sc_slider_h-3, col_work_gradient[13-i]);
24
	if (!scroll_used) for (i=0; i<13; i++) DrawBar(sc_x + 2 + i, sc_slider_y+2, 1, sc_slider_h-3, col.work_gradient[13-i]);
27
	if (scroll_used)  for (i=0; i<13; i++) DrawBar(sc_x + 2 + i, sc_slider_y+2, 1, sc_slider_h-3, col_work_gradient[i]);
25
	if (scroll_used)  for (i=0; i<13; i++) DrawBar(sc_x + 2 + i, sc_slider_y+2, 1, sc_slider_h-3, col.work_gradient[i]);
28
	//area before slider
26
	//area before slider
29
	if (sc_slider_y > sc_y + 1) 
27
	if (sc_slider_y > sc_y + 1) 
30
	{
28
	{
31
		DrawBar(sc_x+1, sc_y,   15, 1, 0xC7C9C9);
29
		DrawBar(sc_x+1, sc_y,   15, 1, col.slider_bg_left);
32
		DrawBar(sc_x+1, sc_y+1,  1, sc_slider_y-sc_y-1, 0xC7C9C9);
30
		DrawBar(sc_x+1, sc_y+1,  1, sc_slider_y-sc_y-1, col.slider_bg_left);
33
		DrawBar(sc_x+2, sc_y+1, 14, sc_slider_y-sc_y-1, 0xCED0D0);
31
		DrawBar(sc_x+2, sc_y+1, 14, sc_slider_y-sc_y-1, col.slider_bg_big);
34
	}
32
	}
35
	//area after slider
33
	//area after slider
36
	if (sc_h-sc_slider_h+sc_y-2>sc_slider_y)
34
	if (sc_h-sc_slider_h+sc_y-2>sc_slider_y)
37
	{
35
	{
38
		DrawBar(sc_x+1, sc_slider_y + sc_slider_h+1, 15, 1, 0xC7C9C9);
36
		DrawBar(sc_x+1, sc_slider_y + sc_slider_h+1, 15, 1, col.slider_bg_left);
39
		DrawBar(sc_x+1, sc_slider_y + sc_slider_h+2,  1, sc_h-sc_slider_h-sc_slider_y+sc_y-2, 0xC7C9C9);
37
		DrawBar(sc_x+1, sc_slider_y + sc_slider_h+2,  1, sc_h-sc_slider_h-sc_slider_y+sc_y-2, col.slider_bg_left);
40
		DrawBar(sc_x+2, sc_slider_y + sc_slider_h+2, 14, sc_h-sc_slider_h-sc_slider_y+sc_y-2, 0xCED0D0);
38
		DrawBar(sc_x+2, sc_slider_y + sc_slider_h+2, 14, sc_h-sc_slider_h-sc_slider_y+sc_y-2, col.slider_bg_big);
41
	}
39
	}
42
}
40
}
43
 
41
 
44
void DrawFlatButtonSmall(dword x,y,width,height,id,text)
42
void DrawFlatButtonSmall(dword x,y,width,height,id,text)
45
{
43
{
46
	DrawRectangle(x,y,width,height,col_graph);
44
	DrawRectangle(x,y,width,height,col.graph);
47
	DrawRectangle3D(x+1,y+1,width-2,height-2, system.color.work_light , system.color.work_dark);
45
	DrawRectangle3D(x+1,y+1,width-2,height-2, system.color.work_light, system.color.work_dark);
48
	PutPixel(x+width-1, y+1, system.color.work_dark);
46
	PutPixel(x+width-1, y+1, system.color.work_dark);
49
	DrawFilledBar(x+2, y+2, width-3, height-3);
47
	DrawFilledBar(x+2, y+2, width-3, height-3);
50
	if (id) DefineHiddenButton(x+1,y+1,width-2,height-2,id);
48
	if (id) DefineHiddenButton(x+1,y+1,width-2,height-2,id);
51
	WriteText(-strlen(text)*6+width/2+x+1,height/2+y-3,0x80,system.color.work_text,text);
49
	WriteText(-strlen(text)*6+width/2+x+1,height/2+y-3,0x80,system.color.work_text,text);
52
}
50
}
53
 
51
 
54
void DrawFilledBar(dword x, y, w, h)
52
void DrawFilledBar(dword x, y, w, h)
55
{
53
{
56
	int i, fill_h;
54
	int i, fill_h;
57
	if (h <= 14) fill_h = h; else fill_h = 14;
55
	if (h < 12) {
58
	for (i=0; i
56
		for (i=0; i
59
	DrawBar(x, y+i, w, h-fill_h, col_work_gradient[14-i]);
57
	} else {
-
 
58
		DrawBar(x, y, w, h, col.work_gradient[12]);
60
}
59
	}
-
 
60
}
61
 
61
 
62
int popin_w=260;
62
int popin_w=260;
63
void DrawEolitePopup(dword b1_text, b2_text)
63
void DrawEolitePopup(dword b1_text, b2_text)
64
{
64
{
65
	int but_x;
65
	int but_x;
66
	int popin_x = files.w - popin_w / 2 + files.x ;
66
	int popin_x = files.w - popin_w / 2 + files.x ;
67
	DrawPopup(popin_x, 160, popin_w, 95, 1, system.color.work, col_graph);
67
	DrawPopup(popin_x, 160, popin_w, 95, 1, system.color.work, col.graph);
68
	but_x = DrawStandartCaptButton(popin_x+23, 215, POPUP_BTN1, b1_text);
68
	but_x = DrawStandartCaptButton(popin_x+23, 215, POPUP_BTN1, b1_text);
69
	DrawStandartCaptButton(popin_x+23 + but_x, 215, POPUP_BTN2, b2_text);
69
	DrawStandartCaptButton(popin_x+23 + but_x, 215, POPUP_BTN2, b2_text);
70
}
70
}
71
 
71
 
72
void DrawDot(dword x,y) {
72
void DrawDot(dword x,y) {
73
	dword col_pxl = MixColors(col_graph, col_work, 60);
73
	dword col_pxl = MixColors(col.graph, col.work, 60);
74
	DrawBar(x+1,y,2,4,col_graph);
74
	DrawBar(x+1,y,2,4,col.graph);
75
	DrawBar(x,y+1,4,2,col_graph);
75
	DrawBar(x,y+1,4,2,col.graph);
76
	PutPixel(x,y,col_pxl);
76
	PutPixel(x,y,col_pxl);
77
	PutPixel(x+3,y,col_pxl);
77
	PutPixel(x+3,y,col_pxl);
78
	PutPixel(x,y+3,col_pxl);
78
	PutPixel(x,y+3,col_pxl);
79
	PutPixel(x+3,y+3,col_pxl);
79
	PutPixel(x+3,y+3,col_pxl);
80
}
80
}
81
 
81
 
82
:void DrawCaptButtonSmallText(dword x,y,w,h,id,color_b, color_t,text)
82
:void DrawCaptButtonSmallText(dword x,y,w,h,id,color_b, color_t,text)
83
{
83
{
84
	dword tx = -strlen(text)*6+w/2+x;
84
	dword tx = -strlen(text)*6+w/2+x;
85
	dword ty = h/2-3+y;
85
	dword ty = h/2-3+y;
86
	DefineButton(x,y,w,h,id,color_b);
86
	DefineButton(x,y,w,h,id,color_b);
87
	WriteText(tx,ty,0x80,color_t,text);
87
	WriteText(tx,ty,0x80,color_t,text);
88
}
88
}
89
>
89
>