Rev 6058 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6058 | Rev 6059 | ||
---|---|---|---|
1 | struct _link |
1 | struct _link |
2 | { |
2 | { |
3 | int count; |
3 | int count; |
4 | int x[4096], y[4096], w[4096], h[4096]; |
4 | int x[4096], y[4096], w[4096], h[4096]; |
5 | collection text; |
5 | collection text; |
6 | collection url; |
6 | collection url; |
7 | void clear(); |
7 | void clear(); |
8 | void add(); |
8 | void add(); |
9 | int hover(); |
9 | int hover(); |
10 | int active; |
10 | int active; |
11 | } link; |
11 | } link; |
12 | 12 | ||
13 | void _link::clear() |
13 | void _link::clear() |
14 | { |
14 | { |
15 | text.drop(); |
15 | text.drop(); |
16 | url.drop(); |
16 | url.drop(); |
17 | count = 0; |
17 | count = 0; |
18 | } |
18 | } |
19 | 19 | ||
20 | void _link::add(int _xx, _yy, _ww, _hh, dword _textt, _urll ) |
20 | void _link::add(int _xx, _yy, _ww, _hh, dword _textt, _urll ) |
21 | { |
21 | { |
22 | if (count==4095) return; |
22 | if (count==4095) return; |
23 | x[count] = _xx; |
23 | x[count] = _xx; |
24 | y[count] = _yy; |
24 | y[count] = _yy; |
25 | w[count] = _ww; |
25 | w[count] = _ww; |
26 | h[count] = _hh; |
26 | h[count] = _hh; |
27 | text.add(_textt); |
27 | text.add(_textt); |
28 | url.add(_urll); |
28 | url.add(_urll); |
29 | count++; |
29 | count++; |
30 | } |
30 | } |
31 | 31 | ||
32 | int _link::hover() |
32 | int _link::hover() |
33 | { |
33 | { |
34 | //char tempp[4096]; |
34 | //char tempp[4096]; |
35 | dword color; |
35 | dword color; |
36 | int i; |
36 | int i; |
37 | active = 0; |
37 | active = -1; |
38 | mouse.x = mouse.x - list.x; |
38 | mouse.x = mouse.x - list.x; |
39 | mouse.y = mouse.y - list.y; |
39 | mouse.y = mouse.y - list.y; |
40 | for (i=0; i |
40 | for (i=0; i |
41 | if(link.y[i]>list.first*list.item_h) && (link.y[i] |
41 | if(link.y[i]>list.first*list.item_h) && (link.y[i] |
42 | // sprintf(#tempp, "mx:%i my:%i x[i]:%i y[i]:%i", mx, my, x[i], y[i]); |
42 | // sprintf(#tempp, "mx:%i my:%i x[i]:%i y[i]:%i", mx, my, x[i], y[i]); |
43 | // sprintf(#tempp); |
43 | // sprintf(#tempp); |
44 | if (mouse.x>link.x[i]) |
44 | if (mouse.x>link.x[i]) |
45 | && (-list.first*list.item_h+link.y[i] |
45 | && (-list.first*list.item_h+link.y[i] |
46 | && (mouse.x |
46 | && (mouse.x |
47 | && (-list.first*list.item_h+link.y[i]+link.h[i]>mouse.y) |
47 | && (-list.first*list.item_h+link.y[i]+link.h[i]>mouse.y) { |
48 | color = 0xFF0000; |
48 | color = 0xFFFfff; |
- | 49 | CursorPointer.Set(); |
|
- | 50 | active = i; |
|
- | 51 | } |
|
49 | else |
52 | else { |
50 | color = 0xCCCccc; |
53 | color = 0x0000FF; |
- | 54 | } |
|
51 | DrawRectangle(link.x[i]+list.x+1, -list.first*list.item_h+link.y[i]+list.y, link.w[i], link.h[i], color); |
55 | DrawBar(link.x[i]+list.x, -list.first*list.item_h+link.y[i]+list.y+link.h[i]-1, link.w[i], 1, color); |
52 | } |
56 | } |
53 | } |
57 | } |
- | 58 | if (active==-1) CursorPointer.Restore(); |
|
54 | return false; |
59 | return false; |
55 | } |
60 | } |
56 | > |
61 | > |