Subversion Repositories Kolibri OS

Rev

Rev 6653 | Go to most recent revision | Details | 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
dword select_list_count_offset;
4
 
5
?define T_SELECT_LIST_NO_DATA "No data to show"
6
 
7
void InitSelectList(dword _x, _y, _w, _h, _no_selection)
8
{
9
	select_list.no_selection = _no_selection;
10
	select_list.SetFont(8, 14, 0x90);
11
	select_list.SetSizes(_x, _y, _w, _h, 20);
12
}
13
 
14
void DrawSelectList(dword _items_count)
15
{
16
	int i, list_last;
17
 
18
	select_list.count = _items_count;
19
	select_list.CheckDoesValuesOkey();
20
 
21
	if (select_list.count > select_list.visible) list_last = select_list.visible; else list_last = select_list.count;
22
 
23
	for (i=0; i
24
	for (i=0; i
25
 
26
	for (i=0; i
27
	{
28
		DrawBar(select_list.x,i*select_list.item_h+select_list.y,select_list.w, select_list.item_h, 0xFFFfff);
29
		DrawSelectList_Line(i); //NEED TO BE IMPLEMENTED IN APP
30
	}
31
	DrawBar(select_list.x,i*select_list.item_h+select_list.y, select_list.w, -i*select_list.item_h+ select_list.h, 0xFFFfff);
32
	if (!select_list.count) WriteText(-strlen(T_SELECT_LIST_NO_DATA)*select_list.font_w + select_list.w / 2 + select_list.x + 1,
33
		select_list.h / 2 - 8 + select_list.y, select_list.font_type, 0x999999, T_SELECT_LIST_NO_DATA);
34
	DrawSelectListScroller();
35
}
36
 
37
 
38
void DrawSelectListScroller()
39
{
40
	scroll1.bckg_col = MixColors(system.color.work, 0xBBBbbb, 80);
41
	scroll1.frnt_col = MixColors(system.color.work,0xFFFfff,120);
42
	scroll1.line_col = system.color.work_graph;
43
 
44
	scroll1.max_area = select_list.count;
45
	scroll1.cur_area = select_list.visible;
46
	scroll1.position = select_list.first;
47
 
48
	scroll1.all_redraw=1;
49
	scroll1.start_x = select_list.x + select_list.w;
50
	scroll1.start_y = select_list.y-1;
51
	scroll1.size_y = select_list.h+2;
52
 
53
	scrollbar_v_draw(#scroll1);
54
}