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