Rev 4077 | Rev 4409 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4077 | Rev 4078 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | //list_box |
1 | //list_box |
Line 2... | Line 2... | ||
2 | 2 | ||
3 | struct llist |
3 | struct llist |
4 | { |
4 | { |
5 | int x, y, w, h, min_h, line_h; |
5 | int x, y, w, h, min_h, line_h, text_y; |
6 | int count, visible, first, current; |
- | |
7 | int current_temp; |
6 | int count, visible, first, current; |
8 | void ClearList(); |
7 | void ClearList(); |
9 | int ProcessKey(dword key); |
8 | int ProcessKey(dword key); |
10 | int MouseOver(int xx, yy); |
9 | int MouseOver(int xx, yy); |
11 | int ProcessMouse(int xx, yy); |
10 | int ProcessMouse(int xx, yy); |
Line 30... | Line 29... | ||
30 | y = yy; |
29 | y = yy; |
31 | w = ww; |
30 | w = ww; |
32 | h = hh; |
31 | h = hh; |
33 | min_h = min_hh; |
32 | min_h = min_hh; |
34 | line_h = line_hh; |
33 | line_h = line_hh; |
- | 34 | text_y = line_hh / 2 - 4; |
|
35 | visible = h / line_h; |
35 | visible = h / line_h; |
- | 36 | if (visible > count) visible=count; |
|
36 | } |
37 | } |
Line 37... | Line 38... | ||
37 | 38 | ||
38 | 39 | ||
Line 58... | Line 59... | ||
58 | return 0; |
59 | return 0; |
59 | } |
60 | } |
Line 60... | Line 61... | ||
60 | 61 | ||
61 | int llist::ProcessMouse(int xx, yy) |
62 | int llist::ProcessMouse(int xx, yy) |
- | 63 | { |
|
62 | { |
64 | int current_temp; |
63 | if (MouseOver(xx, yy)) |
65 | if (MouseOver(xx, yy)) |
64 | { |
66 | { |
65 | current_temp = yy - y / line_h + first; |
67 | current_temp = yy - y / line_h + first; |
66 | if (current_temp != current) |
68 | if (current_temp != current) && (current_temp |
67 | { |
69 | { |
68 | current = current_temp; |
70 | current = current_temp; |
69 | return 1; |
71 | return 1; |
70 | } |
72 | } |