Subversion Repositories Kolibri OS

Rev

Rev 8779 | Rev 9461 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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