Rev 6651 | Rev 6662 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6651 | Rev 6653 | ||
---|---|---|---|
Line 2... | Line 2... | ||
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 | dword select_list_count_offset; |
3 | dword select_list_count_offset; |
Line 4... | Line 4... | ||
4 | 4 | ||
Line 5... | Line 5... | ||
5 | ?define T_SELECT_LIST_NO_DATA "No data to show" |
5 | ?define T_SELECT_LIST_NO_DATA "No data to show" |
6 | 6 | ||
7 | void InitSelectList(dword _x, _y, _w, _h, _no_selection) |
7 | void SelectList_Init(dword _x, _y, _w, _h, _no_selection) |
8 | { |
8 | { |
9 | select_list.no_selection = _no_selection; |
9 | select_list.no_selection = _no_selection; |
10 | select_list.SetFont(8, 14, 0x90); |
10 | select_list.SetFont(8, 14, 0x90); |
Line 11... | Line 11... | ||
11 | select_list.SetSizes(_x, _y, _w, _h, 20); |
11 | select_list.SetSizes(_x, _y, _w, _h, 20); |
12 | } |
12 | } |
13 | 13 | ||
Line 14... | Line -... | ||
14 | void DrawSelectList(dword _items_count) |
- | |
15 | { |
14 | void SelectList_Draw() |
Line 16... | Line 15... | ||
16 | int i, list_last; |
15 | { |
Line 17... | Line -... | ||
17 | - | ||
18 | select_list.count = _items_count; |
- | |
19 | select_list.CheckDoesValuesOkey(); |
- | |
20 | 16 | int i, list_last; |
|
21 | if (select_list.count > select_list.visible) list_last = select_list.visible; else list_last = select_list.count; |
17 | |
22 | 18 | select_list.CheckDoesValuesOkey(); |
|
23 | for (i=0; i |
19 | |
24 | for (i=0; i |
20 | if (select_list.count > select_list.visible) list_last = select_list.visible; else list_last = select_list.count; |
25 | 21 | ||
26 | for (i=0; i |
22 | for (i=0; i |
27 | { |
23 | { |
28 | DrawBar(select_list.x,i*select_list.item_h+select_list.y,select_list.w, select_list.item_h, 0xFFFfff); |
24 | DrawBar(select_list.x,i*select_list.item_h+select_list.y,select_list.w, select_list.item_h, 0xFFFfff); |
- | 25 | SelectList_DrawLine(i); //NEED TO BE IMPLEMENTED IN APP |
|
- | 26 | } |
|
- | 27 | DrawBar(select_list.x,i*select_list.item_h+select_list.y, select_list.w, -i*select_list.item_h+ select_list.h, 0xFFFfff); |
|
- | 28 | if (!select_list.count) WriteText(-strlen(T_SELECT_LIST_NO_DATA)*select_list.font_w + select_list.w / 2 + select_list.x + 1, |
|
- | 29 | select_list.h / 2 - 8 + select_list.y, select_list.font_type, 0x999999, T_SELECT_LIST_NO_DATA); |
|
- | 30 | SelectList_DrawScroller(); |
|
- | 31 | } |
|
- | 32 | ||
- | 33 | void SelectList_ProcessMouse() |
|
- | 34 | { |
|
- | 35 | int mouse_clicked; |
|
- | 36 | mouse.get(); |
|
- | 37 | scrollbar_v_mouse (#scroll1); |
|
- | 38 | if (select_list.first != scroll1.position) |
|
- | 39 | { |
|
- | 40 | select_list.first = scroll1.position; |
|
- | 41 | SelectList_Draw(); |
|
- | 42 | } |
|
- | 43 | ||
- | 44 | if (mouse.vert) && (select_list.MouseScroll(mouse.vert)) SelectList_Draw(); |
|
- | 45 | ||
29 | DrawSelectList_Line(i); //NEED TO BE IMPLEMENTED IN APP |
46 | if (mouse.up)&&(mouse_clicked) |
Line 30... | Line 47... | ||
30 | } |
47 | { |
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); |
48 | if (mouse.lkm) && (select_list.ProcessMouse(mouse.x, mouse.y)) SelectList_LineChanged(); |
32 | if (!select_list.count) WriteText(-strlen(T_SELECT_LIST_NO_DATA)*select_list.font_w + select_list.w / 2 + select_list.x + 1, |
49 | mouse_clicked=false; |
33 | select_list.h / 2 - 8 + select_list.y, select_list.font_type, 0x999999, T_SELECT_LIST_NO_DATA); |
50 | } |
34 | DrawSelectListScroller(); |
51 | else if (mouse.down)&&(mouse.lkm) && (select_list.MouseOver(mouse.x, mouse.y)) mouse_clicked=true; |
Line 49... | Line 66... | ||
49 | scroll1.start_x = select_list.x + select_list.w; |
66 | scroll1.start_x = select_list.x + select_list.w; |
50 | scroll1.start_y = select_list.y-1; |
67 | scroll1.start_y = select_list.y-1; |
51 | scroll1.size_y = select_list.h+2; |
68 | scroll1.size_y = select_list.h+2; |
Line 52... | Line 69... | ||
52 | 69 | ||
53 | scrollbar_v_draw(#scroll1); |
- | |
54 | } |
70 | scrollbar_v_draw(#scroll1); |
- | 71 | } |