Rev 6731 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6731 | Rev 6738 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | CustomCursor CursorPointer; |
1 | CustomCursor CursorPointer; |
2 | dword CursorFile = FROM "../TWB/pointer.cur"; |
2 | dword CursorFile = FROM "../TWB/pointer.cur"; |
- | 3 | #include "..\lib\collection.h" |
|
Line 3... | Line 4... | ||
3 | 4 | ||
4 | #define NOLINE 0 |
5 | #define NOLINE 0 |
Line -... | Line 6... | ||
- | 6 | #define UNDERLINE 1 |
|
- | 7 | ||
5 | #define UNDERLINE 1 |
8 | #define MAXLINKS 400 |
6 | 9 | ||
7 | struct array_link { |
10 | struct array_link { |
8 | dword link, text; |
11 | dword link, text; |
9 | int x,y,w,h; |
12 | int x,y,w,h; |
Line 10... | Line 13... | ||
10 | int underline; |
13 | int underline; |
11 | }; |
14 | }; |
12 | 15 | ||
13 | struct LinksArray { |
16 | struct LinksArray { |
14 | array_link links[400]; |
17 | array_link links[MAXLINKS]; |
15 | char page_links[64000]; |
18 | collection page_links; |
16 | dword buflen; |
19 | dword buflen; |
17 | int count, active; |
20 | int count, active; |
Line 22... | Line 25... | ||
22 | void Clear(); |
25 | void Clear(); |
23 | } PageLinks; |
26 | } PageLinks; |
Line 24... | Line 27... | ||
24 | 27 | ||
25 | void LinksArray::AddLink(dword lpath, int link_x, link_y) |
28 | void LinksArray::AddLink(dword lpath, int link_x, link_y) |
- | 29 | { |
|
26 | { |
30 | if (count>= MAXLINKS) return; |
27 | links[count].x = link_x; |
31 | links[count].x = link_x; |
Line 28... | Line -... | ||
28 | links[count].y = link_y; |
- | |
29 | 32 | links[count].y = link_y; |
|
30 | links[count].link = buflen; |
33 | |
31 | strcpy(buflen, lpath); |
34 | page_links.add(lpath); |
32 | buflen += strlen(lpath)+1; |
35 | links[count].link = page_links.get(page_links.count-1); |
Line 33... | Line 36... | ||
33 | count++; |
36 | count++; |
34 | } |
37 | } |
35 | 38 | ||
36 | void LinksArray::AddText(dword new_text, int link_w, link_h, link_underline) |
39 | void LinksArray::AddText(dword new_text, int link_w, link_h, link_underline) |
37 | { |
40 | { |
38 | if (count<1) return; |
41 | if (count>= MAXLINKS) || (!count) return; |
Line 39... | Line -... | ||
39 | links[count-1].w = link_w; |
- | |
40 | links[count-1].h = link_h; |
42 | links[count-1].w = link_w; |
41 | links[count-1].underline = link_underline; |
43 | links[count-1].h = link_h; |
42 | 44 | links[count-1].underline = link_underline; |
|
Line 43... | Line 45... | ||
43 | links[count-1].text = buflen; |
45 | |
44 | strcpy(buflen, new_text); |
46 | page_links.add(new_text); |
45 | buflen += strlen(new_text)+1; |
47 | links[count-1].text = page_links.get(page_links.count-1); |
46 | } |
48 | } |
Line 47... | Line 49... | ||
47 | 49 | ||
48 | dword LinksArray::GetURL(int id) |
50 | dword LinksArray::GetURL(int id) |
49 | { |
51 | { |
50 | return links[id].link; |
- | |
51 | } |
52 | return links[id].link; |
52 | 53 | } |
|
53 | void LinksArray::Clear() |
54 | |
54 | { |
55 | void LinksArray::Clear() |
55 | int i; |
56 | { |