Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 7290 → Rev 7291

/programs/cmm/aelia/aelia.c
56,12 → 56,8
};
 
char address[UML]="http://";
int mouse_address_box;
edit_box address_box = {250,56,34,0xffffff,0x94AECE,0xffffff,0xffffff,0,UML,#address,#mouse_address_box,2,19,19};
edit_box address_box = {250,56,34,0xffffff,0x94AECE,0xffffff,0xffffff,0,UML,#address,NULL,2,19,19};
 
CustomCursor CursorPointer;
dword CursorFile = FROM "pointer.cur";
 
#include "favicon.h"
#include "ini.h"
#include "gui.h"
222,7 → 218,15
edit_box_mouse stdcall (#address_box);
mouse.get();
list.wheel_size = 7;
link.hover();
if (link.hover()) {
if (link.active == -1) {
debugln("unhovered");
}
else {
debugln(link.text.get(link.active));
debugln(link.url.get(link.active));
}
}
if (list.MouseScroll(mouse.vert)) {
DrawPage();
return;
/programs/cmm/aelia/link.h
1,5 → 1,8
dword CursorFile = FROM "pointer.cur";
 
struct _link
{
CustomCursor CursorPointer;
int count;
int x[4096], y[4096], w[4096], h[4096];
collection text;
8,6 → 11,7
void add();
int hover();
int active;
void draw_underline();
} link;
 
void _link::clear()
29,33 → 33,46
count++;
}
 
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);
}
 
int _link::hover()
{
//char tempp[4096];
dword color;
int i;
active = -1;
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;
for (i=0; i<link.count; i++) {
if(link.y[i]>list.first*list.item_h) && (link.y[i]<list.first*list.item_h+list.h) {
// sprintf(#tempp, "mx:%i my:%i x[i]:%i y[i]:%i", mx, my, x[i], y[i]);
// sprintf(#tempp);
if (mouse.x>link.x[i])
&& (-list.first*list.item_h+link.y[i]<mouse.y)
&& (mouse.x<link.x[i]+link.w[i])
&& (-list.first*list.item_h+link.y[i]+link.h[i]>mouse.y) {
color = 0xFFFfff;
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]) {
new_active = i;
break;
}
}
}
 
if (new_active != active)
{
if (-1 == new_active) {
draw_underline(active, 0x0000FF);
CursorPointer.Restore();
}
else {
draw_underline(active, 0x0000FF);
draw_underline(new_active, 0xFFFfff);
CursorPointer.Load(#CursorFile);
CursorPointer.Set();
active = i;
}
else {
color = 0x0000FF;
active = new_active;
return true;
}
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);
}
}
if (active==-1) CursorPointer.Restore();
 
return false;
}
/programs/cmm/aelia/prepare_page.h
283,7 → 283,8
kfont.bold = style.bold;
canvas.write_text(draw.x, draw.y, style.color, text.start);
if (style.a) {
canvas.draw_hor_line(draw.x+1, draw.y + list.item_h-2, kfont.get_label_width(text.start), style.color);
canvas.draw_hor_line(draw.x, draw.y + list.item_h-1, kfont.get_label_width(text.start), style.color);
link.add(draw.x, draw.y, kfont.get_label_width(text.start), list.item_h, text.start, "http://kolibrios.org");
}
}
}