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