Rev 5772 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5772 | Rev 5773 | ||
---|---|---|---|
Line 16... | Line 16... | ||
16 | dword buflen; |
16 | dword buflen; |
17 | int count, active; |
17 | int count, active; |
18 | void Hover(); |
18 | void Hover(); |
19 | void AddLink(); |
19 | void AddLink(); |
20 | void AddText(); |
20 | void AddText(); |
- | 21 | void ClickLink(); |
|
21 | dword GetURL(); |
22 | dword GetURL(); |
22 | void Clear(); |
23 | void Clear(); |
23 | void GetAbsoluteURL(); |
24 | void GetAbsoluteURL(); |
24 | int UrlAbsolute(); |
25 | int UrlAbsolute(); |
25 | } PageLinks; |
26 | } PageLinks; |
Line 66... | Line 67... | ||
66 | PathShow_data status_text = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, 0, #temp, 0}; |
67 | PathShow_data status_text = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, 0, #temp, 0}; |
Line 67... | Line 68... | ||
67 | 68 | ||
68 | void LinksArray::Hover(dword mx, my, link_col_in, link_col_a, bg_col) |
69 | void LinksArray::Hover(dword mx, my, link_col_in, link_col_a, bg_col) |
69 | { |
70 | { |
70 | int i; |
71 | int i; |
71 | signed int WBY = -WB1.list.first*WB1.list.line_h + WB1.list.line_h - WB1.DrawBuf.zoom; |
72 | signed int WBY = -WB1.list.first*WB1.list.line_h - WB1.DrawBuf.zoom; |
72 | for (i=0; i |
73 | for (i=0; i |
73 | { |
74 | { |
74 | if (mx>links[i].x) && (my>links[i].y) && (mx |
75 | if (mx>links[i].x) && (my>links[i].y) && (mx |
- | 76 | { |
|
- | 77 | if (mouse.down) DrawRectangle(links[active].x, links[active].y, links[active].w, links[active].h, 0); |
|
75 | { |
78 | if (mouse.up) ClickLink(); |
76 | if (active==i) return; |
79 | if (active==i) return; |
77 | CursorPointer.Set(); |
80 | CursorPointer.Set(); |
78 | if (links[active].underline) DrawBar(links[active].x, WBY + links[active].y,links[active].w, WB1.DrawBuf.zoom, link_col_in); |
81 | if (links[active].underline) DrawBar(links[active].x, WBY + links[active].y + links[active].h,links[active].w, WB1.DrawBuf.zoom, link_col_in); |
79 | if (links[i].underline) DrawBar(links[i].x, WBY + links[i].y,links[i].w, WB1.DrawBuf.zoom, bg_col); |
82 | if (links[i].underline) DrawBar(links[i].x, WBY + links[i].y + links[i].h,links[i].w, WB1.DrawBuf.zoom, bg_col); |
80 | active = i; |
83 | active = i; |
81 | status_text.start_x = wv_progress_bar.left + wv_progress_bar.width + 10; |
84 | status_text.start_x = wv_progress_bar.left + wv_progress_bar.width + 10; |
82 | status_text.start_y = Form.cheight - STATUSBAR_H + 3; |
85 | status_text.start_y = Form.cheight - STATUSBAR_H + 3; |
83 | status_text.area_size_x = Form.cwidth - status_text.start_x -3; |
86 | status_text.area_size_x = Form.cwidth - status_text.start_x -3; |
Line 89... | Line 92... | ||
89 | } |
92 | } |
90 | } |
93 | } |
91 | if (active!=-1) |
94 | if (active!=-1) |
92 | { |
95 | { |
93 | CursorPointer.Restore(); |
96 | CursorPointer.Restore(); |
94 | if (links[active].underline) DrawBar(links[active].x, WBY + links[active].y,links[active].w, WB1.DrawBuf.zoom, link_col_in); |
97 | if (links[active].underline) DrawBar(links[active].x, WBY + links[active].y + links[active].h,links[active].w, WB1.DrawBuf.zoom, link_col_in); |
95 | DrawBar(status_text.start_x, status_text.start_y, status_text.area_size_x, 9, col_bg); |
98 | DrawBar(status_text.start_x, status_text.start_y, status_text.area_size_x, 9, col_bg); |
96 | active = -1; |
99 | active = -1; |
97 | } |
100 | } |
98 | } |
101 | } |
Line 159... | Line 162... | ||
159 | 162 | ||
160 | strcat(#newurl, in_URL); |
163 | strcat(#newurl, in_URL); |
161 | strcpy(orig_URL, #newurl); |
164 | strcpy(orig_URL, #newurl); |
Line -... | Line 165... | ||
- | 165 | } |
|
- | 166 | ||
- | 167 | void LinksArray::ClickLink() |
|
- | 168 | { |
|
- | 169 | if (http_transfer > 0) |
|
- | 170 | { |
|
- | 171 | StopLoading(); |
|
- | 172 | BrowserHistory.current--; |
|
- | 173 | } |
|
- | 174 | ||
- | 175 | strcpy(#URL, PageLinks.GetURL(PageLinks.active)); |
|
- | 176 | //#1 |
|
- | 177 | if (URL[0] == '#') |
|
- | 178 | { |
|
- | 179 | strcpy(#anchor, #URL+strrchr(#URL, '#')); |
|
- | 180 | strcpy(#URL, BrowserHistory.CurrentUrl()); |
|
- | 181 | WB1.list.first=WB1.list.count-WB1.list.visible; |
|
- | 182 | ShowPage(); |
|
- | 183 | return; |
|
- | 184 | } |
|
- | 185 | //liner.ru#1 |
|
- | 186 | if (strrchr(#URL, '#')!=-1) |
|
- | 187 | { |
|
- | 188 | strcpy(#anchor, #URL+strrchr(#URL, '#')); |
|
- | 189 | URL[strrchr(#URL, '#')-1] = 0x00; |
|
- | 190 | } |
|
- | 191 | ||
- | 192 | PageLinks.GetAbsoluteURL(#URL); |
|
- | 193 | ||
- | 194 | if (UrlExtIs(".png")==1) || (UrlExtIs(".gif")==1) || (UrlExtIs(".jpg")==1) || (UrlExtIs(".zip")==1) || (UrlExtIs(".kex")==1) |
|
- | 195 | || (UrlExtIs(".7z")==1) || (UrlExtIs("netcfg")==1) |
|
- | 196 | { |
|
- | 197 | //notify(#URL); |
|
- | 198 | if (!strncmp(#URL,"http://", 7)) |
|
- | 199 | { |
|
- | 200 | strcpy(#DL_URL, #URL); |
|
- | 201 | CreateThread(#Downloader,#downloader_stak+4092); |
|
- | 202 | } |
|
- | 203 | else RunProgram("@open", #URL); |
|
- | 204 | strcpy(#editURL, BrowserHistory.CurrentUrl()); |
|
- | 205 | strcpy(#URL, BrowserHistory.CurrentUrl()); |
|
- | 206 | return; |
|
- | 207 | } |
|
- | 208 | if (!strncmp(#URL,"mailto:", 7)) |
|
- | 209 | { |
|
- | 210 | notify(#URL); |
|
- | 211 | strcpy(#editURL, BrowserHistory.CurrentUrl()); |
|
- | 212 | strcpy(#URL, BrowserHistory.CurrentUrl()); |
|
- | 213 | return; |
|
- | 214 | } |
|
- | 215 | OpenPage(); |