Rev 7755 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7755 | Rev 7757 | ||
---|---|---|---|
Line 7... | Line 7... | ||
7 | 7 | ||
Line 8... | Line 8... | ||
8 | #define MAXLINKS 2000 |
8 | #define MAXLINKS 2000 |
9 | 9 | ||
10 | struct array_link { |
10 | struct array_link { |
- | 11 | dword link; |
|
11 | dword link; |
12 | unsigned int x,y,w,h; |
12 | int x,y,w,h; |
13 | unsigned int unic_id; |
Line 13... | Line 14... | ||
13 | int underline, underline_h; |
14 | int underline, underline_h; |
14 | }; |
15 | }; |
15 | 16 | ||
16 | struct LinksArray { |
17 | struct LinksArray { |
- | 18 | array_link links[MAXLINKS]; |
|
17 | array_link links[MAXLINKS]; |
19 | collection page_links; |
18 | collection page_links; |
20 | unsigned int count; |
19 | int count; |
21 | unsigned int unic_count; |
20 | int active; |
22 | unsigned int active; |
21 | bool HoverAndProceed(); |
23 | bool HoverAndProceed(); |
22 | void AddLink(); |
24 | void AddLink(); |
- | 25 | void AddText(); |
|
23 | void AddText(); |
26 | dword GetURL(); |
Line 24... | Line 27... | ||
24 | dword GetURL(); |
27 | void Clear(); |
25 | void Clear(); |
28 | void DrawUnderline(); |
26 | } PageLinks; |
29 | } PageLinks; |
27 | 30 | ||
- | 31 | void LinksArray::AddLink(dword lpath) |
|
28 | void LinksArray::AddLink(dword lpath) |
32 | { |
Line 29... | Line 33... | ||
29 | { |
33 | if (count>= MAXLINKS) return; |
30 | if (count>= MAXLINKS) return; |
34 | page_links.add(lpath); |
31 | page_links.add(lpath); |
35 | unic_count++; |
Line 39... | Line 43... | ||
39 | links[count].w = _w; |
43 | links[count].w = _w; |
40 | links[count].h = _h; |
44 | links[count].h = _h; |
41 | links[count].underline = _link_underline; |
45 | links[count].underline = _link_underline; |
42 | links[count].underline_h = _underline_h; |
46 | links[count].underline_h = _underline_h; |
43 | links[count].link = page_links.get(page_links.count-1); |
47 | links[count].link = page_links.get(page_links.count-1); |
- | 48 | links[count].unic_id = unic_count; |
|
44 | count++; |
49 | count++; |
45 | } |
50 | } |
Line 46... | Line 51... | ||
46 | 51 | ||
47 | dword LinksArray::GetURL(int id) |
52 | dword LinksArray::GetURL(int id) |
Line 53... | Line 58... | ||
53 | { |
58 | { |
54 | page_links.drop(); |
59 | page_links.drop(); |
55 | page_links.realloc_size = 4096 * 32; |
60 | page_links.realloc_size = 4096 * 32; |
56 | count = 0; |
61 | count = 0; |
57 | active = -1; |
62 | active = -1; |
- | 63 | unic_count = 0; |
|
58 | CursorPointer.Restore(); |
64 | CursorPointer.Restore(); |
59 | } |
65 | } |
Line -... | Line 66... | ||
- | 66 | ||
- | 67 | void LinksArray::DrawUnderline(dword und_id, list_first, list_y, color) |
|
- | 68 | { |
|
- | 69 | int i; |
|
- | 70 | for (i=0; i |
|
- | 71 | { |
|
- | 72 | if (links[i].unic_id==links[und_id].unic_id) && (links[i].y + links[i].h - list_first > list_y) { |
|
- | 73 | DrawBar(links[i].x, links[i].y + links[i].h - list_first, links[i].w, links[i].underline_h, color); |
|
- | 74 | } |
|
- | 75 | } |
|
- | 76 | } |
|
60 | 77 | ||
Line 61... | Line 78... | ||
61 | PathShow_data status_text = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, 0, NULL, 0}; |
78 | PathShow_data status_text = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, 0, NULL, 0}; |
62 | 79 | ||
63 | bool LinksArray::HoverAndProceed(dword mx, my) |
80 | bool LinksArray::HoverAndProceed(dword mx, my, list_y, list_first) |
64 | { |
81 | { |
65 | int i; |
82 | int i; |
66 | if (!count) return true; |
83 | if (!count) return true; |
67 | for (i=0; i |
84 | for (i=0; i |
68 | { |
85 | { |
69 | if (mx>links[i].x) && (my>links[i].y) |
86 | if (mx>links[i].x) && (my>links[i].y) |
70 | && (mx |
87 | && (mx |
71 | && (my>WB1.list.y+WB1.list.first) |
88 | && (my>list_y+list_first) |
72 | { |
89 | { |
73 | if (mouse.lkm) && (mouse.down) { |
90 | if (mouse.lkm) && (mouse.down) { |
74 | DrawRectangle(links[active].x, -WB1.list.first + links[active].y, |
91 | DrawRectangle(links[active].x, -list_first + links[active].y, |
75 | links[active].w, links[active].h, 0); |
92 | links[active].w, links[active].h, 0); |
76 | return false; |
93 | return false; |
77 | } |
94 | } |
Line 89... | Line 106... | ||
89 | return false; |
106 | return false; |
90 | } |
107 | } |
91 | if (active==i) return false; |
108 | if (active==i) return false; |
92 | CursorPointer.Load(#CursorFile); |
109 | CursorPointer.Load(#CursorFile); |
93 | CursorPointer.Set(); |
110 | CursorPointer.Set(); |
- | 111 | ||
94 | if (links[active].underline) DrawUnderline(links[active].x, -WB1.list.first + links[active].y |
112 | if (links[active].underline) { |
95 | + links[active].h, links[active].w, links[active].underline_h, link_color_inactive); |
113 | DrawUnderline(active, list_first, list_y, link_color_inactive); |
- | 114 | } |
|
- | 115 | ||
96 | if (links[i].underline) DrawUnderline(links[i].x, -WB1.list.first + links[i].y |
116 | if (links[i].underline) { |
97 | + links[i].h, links[i].w, links[i].underline_h, page_bg); |
117 | DrawUnderline(i, list_first, list_y, page_bg); |
- | 118 | } |
|
- | 119 | ||
98 | active = i; |
120 | active = i; |
99 | DrawStatusBar(links[active].link); |
121 | DrawStatusBar(links[active].link); |
100 | return true; |
122 | return true; |
101 | } |
123 | } |
102 | } |
124 | } |
103 | if (active!=-1) |
125 | if (active!=-1) |
104 | { |
126 | { |
105 | CursorPointer.Restore(); |
127 | CursorPointer.Restore(); |
106 | if (links[active].underline) { |
128 | if (links[active].underline) { |
107 | DrawUnderline(links[active].x, -WB1.list.first + links[active].y + links[active].h,links[active].w, |
- | |
108 | links[active].underline_h, link_color_inactive); |
129 | DrawUnderline(active, list_first, list_y, link_color_inactive); |
109 | } |
130 | } |
110 | DrawBar(status_text.start_x, status_text.start_y, status_text.area_size_x, 9, col_bg); |
131 | DrawStatusBar(NULL); |
111 | active = -1; |
132 | active = -1; |
112 | } |
133 | } |
113 | } |
134 | } |
Line 114... | Line -... | ||
114 | - | ||
115 | void DrawUnderline(dword x,y,w,h,color) |
- | |
116 | { |
- | |
117 | if (y>WB1.list.y) DrawBar(x,y,w,h,color); |
- |