Subversion Repositories Kolibri OS

Rev

Rev 9584 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9584 Rev 9602
1
llist select_list;
1
llist select_list;
2
scroll_bar scroll1 = { 18,200,398, 44,18,0,115,15,0,0xeeeeee,0xD2CED0,0x555555,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1};
2
scroll_bar scroll1 = { 18,200,398, 44,18,0,115,15,0,0xeeeeee,0xD2CED0,0x555555,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1};
3
 
3
 
4
?define T_SELECT_LIST_NO_DATA "No data to show"
4
?define T_SELECT_LIST_NO_DATA "No data to show"
5
?define SELECT_LIST_ITEMH 20
5
?define SELECT_LIST_ITEMH 20
6
 
6
 
7
void SelectList_Init(dword _x, _y, _w, _h)
7
void SelectList_Init(dword _x, _y, _w, _h)
8
{
8
{
9
	select_list.SetFont(8, 14, 0x90);
9
	select_list.SetFont(8, 14, 0x90);
10
	select_list.SetSizes(_x, _y, _w, _h, SELECT_LIST_ITEMH);
10
	select_list.SetSizes(_x, _y, _w, _h, SELECT_LIST_ITEMH);
11
}
11
}
12
 
12
 
13
void SelectList_Draw()
13
void SelectList_Draw()
14
{
14
{
15
	int i, list_last;
15
	int i, list_last;
16
 
16
 
17
	select_list.CheckDoesValuesOkey();
17
	select_list.CheckDoesValuesOkey();
18
 
18
 
19
	if (select_list.count > select_list.visible) list_last = select_list.visible; else list_last = select_list.count;
19
	if (select_list.count > select_list.visible) list_last = select_list.visible; else list_last = select_list.count;
20
 
20
 
21
	for (i=0; i
21
	for (i=0; i
22
	{
22
	{
23
		SelectList_DrawLine(i); //NEED TO BE IMPLEMENTED IN APP
23
		SelectList_DrawLine(i); //NEED TO BE IMPLEMENTED IN APP
24
	}
24
	}
25
	DrawBar(select_list.x,i*select_list.item_h+select_list.y, select_list.w, -i*select_list.item_h+ select_list.h, 0xFFFfff);
25
	DrawBar(select_list.x,i*select_list.item_h+select_list.y, select_list.w, -i*select_list.item_h+ select_list.h, 0xFFFfff);
26
	if (!select_list.count) WriteText(-15*8 + select_list.w / 2 + select_list.x + 1, 
26
	if (!select_list.count) WriteText(-15*8 + select_list.w / 2 + select_list.x + 1, 
27
		select_list.h / 2 - 8 + select_list.y, 0x90, 0x999999, T_SELECT_LIST_NO_DATA);
27
		select_list.h / 2 - 8 + select_list.y, 0x90, 0x999999, T_SELECT_LIST_NO_DATA);
28
	SelectList_DrawScroller();
28
	SelectList_DrawScroller();
29
}
29
}
30
 
30
 
31
signed SelectList_ProcessMouse()
31
signed SelectList_ProcessMouse()
32
{
32
{
33
	mouse.get();
33
	mouse.get();
34
	scrollbar_v_mouse (#scroll1);
34
	scrollbar_v_mouse (#scroll1);
35
	if (select_list.first != scroll1.position)
35
	if (select_list.first != scroll1.position)
36
	{
36
	{
37
		select_list.first = scroll1.position;
37
		select_list.first = scroll1.position;
38
		SelectList_Draw();
38
		SelectList_Draw();
39
		return true;
39
		return true;
40
	}
40
	}
41
	
41
	
42
	if (mouse.vert) && (select_list.MouseScroll(mouse.vert)) {
42
	if (mouse.vert) && (select_list.MouseScroll(mouse.vert)) {
43
		SelectList_Draw();
43
		SelectList_Draw();
44
		return true;
44
		return true;
45
	}
45
	}
46
 
46
 
47
	if (mouse.up) && (mouse.click) 
47
	if (mouse.up) && (mouse.click) 
48
		if (select_list.ProcessMouse(mouse.x, mouse.y)) {
48
		if (select_list.ProcessMouse(mouse.x, mouse.y)) {
49
			SelectList_LineChanged();
49
			SelectList_LineChanged();
50
			return true;
50
			return true;
51
		}
51
		}
52
	return false;
52
	return false;
53
}
53
}
54
 
54
 
55
void SelectList_DrawBorder() {
55
void SelectList_DrawBorder() {
56
	DrawRectangle3D(select_list.x-2, select_list.y-2,
56
	DrawRectangle3D(select_list.x-2, select_list.y-2,
57
		select_list.w+3+scroll1.size_x, select_list.h+3, 
57
		select_list.w+3+scroll1.size_x, select_list.h+3, 
58
		sc.work_dark, sc.work_light);
58
		sc.dark, sc.light);
59
	DrawRectangle(select_list.x-1, select_list.y-1, select_list.w+1+scroll1.size_x, select_list.h+1, sc.work_graph);
59
	DrawRectangle(select_list.x-1, select_list.y-1, select_list.w+1+scroll1.size_x, select_list.h+1, sc.line);
60
}
60
}
61
 
61
 
62
void SelectList_DrawScroller()
62
void SelectList_DrawScroller()
63
{
63
{
64
	scroll1.bckg_col = MixColors(sc.work, 0xBBBbbb, 80);
64
	scroll1.bckg_col = MixColors(sc.work, 0xBBBbbb, 80);
65
	scroll1.frnt_col = MixColors(sc.work,0xFFFfff,120);
65
	scroll1.frnt_col = MixColors(sc.work,0xFFFfff,120);
66
	scroll1.line_col = sc.work_graph;
66
	scroll1.line_col = sc.line;
67
 
67
 
68
	scroll1.max_area = select_list.count;
68
	scroll1.max_area = select_list.count;
69
	scroll1.cur_area = select_list.visible;
69
	scroll1.cur_area = select_list.visible;
70
	scroll1.position = select_list.first;
70
	scroll1.position = select_list.first;
71
 
71
 
72
	scroll1.all_redraw=1;
72
	scroll1.all_redraw=1;
73
	scroll1.start_x = select_list.x + select_list.w;
73
	scroll1.start_x = select_list.x + select_list.w;
74
	scroll1.start_y = select_list.y-1;
74
	scroll1.start_y = select_list.y-1;
75
	scroll1.size_y = select_list.h+2;
75
	scroll1.size_y = select_list.h+2;
76
 
76
 
77
	scrollbar_v_draw(#scroll1);
77
	scrollbar_v_draw(#scroll1);
78
}
78
}