9,9 → 9,10 |
collection url; |
void clear(); |
void add(); |
dword get_active_url(); |
void draw_underline(); |
int hover(); |
int active; |
void draw_underline(); |
} link; |
|
void _link::clear() |
33,25 → 34,30 |
count++; |
} |
|
dword _link::get_active_url() |
{ |
return url.get(active); |
} |
|
void _link::draw_underline(dword i, color) |
{ |
DrawBar(x[i]+list.x, -list.first*list.item_h+y[i]+list.y+h[i]-1, w[i], 1, color); |
DrawBar(x[i]+list.x, -list.first*list.item_h+y[i]+list.y+h[i]-2, w[i], 1, color); |
} |
|
int _link::hover() |
int _link::hover(dword mouse_x, mouse_y) |
{ |
int i; |
int new_active = -1; |
int link_start_y = list.first*list.item_h; |
mouse.x = mouse.x - list.x; |
mouse.y = mouse.y - list.y; |
mouse_x -= list.x; |
mouse_y -= list.y; |
for (i=0; i<count; i++) { |
if(y[i] > link_start_y) && (y[i] < link_start_y+list.h) { |
// debugln( sprintf(#param, "mx:%i my:%i x[i]:%i y[i]:%i", mx, my, x[i], y[i]) ); |
if (mouse.x > x[i]) |
&& (mouse.x < x[i]+w[i]) |
&& (mouse.y > y[i]-link_start_y) |
&& (mouse.y < h[i]-link_start_y+link.y[i]) { |
if (mouse_x > x[i]) |
&& (mouse_x < x[i]+w[i]) |
&& (mouse_y > y[i]-link_start_y) |
&& (mouse_y < h[i]-link_start_y+link.y[i]) { |
new_active = i; |
break; |
} |