Subversion Repositories Kolibri OS

Rev

Rev 6738 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6738 Rev 6794
Line 8... Line 8...
8
#define MAXLINKS 400
8
#define MAXLINKS 400
Line 9... Line 9...
9
 
9
 
10
struct array_link {
10
struct array_link {
11
	dword link, text;
11
	dword link, text;
12
	int x,y,w,h;
12
	int x,y,w,h;
13
	int underline;
13
	int underline, underline_h;
Line 14... Line 14...
14
};
14
};
15
 
15
 
16
struct LinksArray {
16
struct LinksArray {
Line 34... Line 34...
34
	page_links.add(lpath);
34
	page_links.add(lpath);
35
	links[count].link = page_links.get(page_links.count-1);
35
	links[count].link = page_links.get(page_links.count-1);
36
	count++;
36
	count++;
37
}
37
}
Line 38... Line 38...
38
 
38
 
39
void LinksArray::AddText(dword new_text, int link_w, link_h, link_underline)
39
void LinksArray::AddText(dword link_w, link_h, link_underline, _underline_h, new_text)
40
{
40
{
41
	if (count>= MAXLINKS) || (!count) return;
41
	if (count>= MAXLINKS) || (!count) return;
42
	links[count-1].w = link_w;
42
	links[count-1].w = link_w;
43
	links[count-1].h = link_h;
43
	links[count-1].h = link_h;
-
 
44
	links[count-1].underline = link_underline;
Line 44... Line 45...
44
	links[count-1].underline = link_underline;
45
	links[count-1].underline_h = _underline_h;
45
 
46
 
46
	page_links.add(new_text);
47
	page_links.add(new_text);
Line 65... Line 66...
65
PathShow_data status_text = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, 0, #temp, 0};
66
PathShow_data status_text = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, 0, #temp, 0};
Line 66... Line 67...
66
 
67
 
67
void LinksArray::Hover(dword mx, my, link_col_in, link_col_a, bg_col)
68
void LinksArray::Hover(dword mx, my, link_col_in, link_col_a, bg_col)
68
{
69
{
69
	int i;
-
 
70
	signed int WBY =  -WB1.list.first*WB1.list.item_h - WB1.DrawBuf.zoom;
70
	int i;
71
	for (i=0; i
71
	for (i=0; i
72
	{
72
	{
73
		if (mx>links[i].x) && (my>links[i].y) && (mx
73
		if (mx>links[i].x) && (my>links[i].y) && (mx
74
		{
74
		{
-
 
75
			if (mouse.down) DrawRectangle(links[active].x, -WB1.list.first + links[active].y, 
75
			if (mouse.down) DrawRectangle(links[active].x, -WB1.list.first*WB1.list.item_h + links[active].y, links[active].w, links[active].h, 0);
76
				links[active].w, links[active].h, 0);
76
			if (mouse.up) ClickLink();
77
			if (mouse.up) ClickLink();
77
			if (active==i) return;
78
			if (active==i) return;
78
			CursorPointer.Set();
79
			CursorPointer.Set();
-
 
80
			if (links[active].underline) DrawBar(links[active].x, -WB1.list.first + links[active].y
79
			if (links[active].underline) DrawBar(links[active].x, WBY + links[active].y + links[active].h,links[active].w, WB1.DrawBuf.zoom, link_col_in);
81
				+ links[active].h, links[active].w, links[i].underline_h, link_col_in);
-
 
82
			if (links[i].underline) DrawBar(links[i].x, -WB1.list.first + links[i].y
80
			if (links[i].underline) DrawBar(links[i].x, WBY + links[i].y + links[i].h,links[i].w, WB1.DrawBuf.zoom, bg_col);
83
				+ links[i].h, links[i].w, links[i].underline_h, bg_col);
81
			active = i;
84
			active = i;
82
			status_text.start_x = wv_progress_bar.left + wv_progress_bar.width + 10;
85
			status_text.start_x = wv_progress_bar.left + wv_progress_bar.width + 10;
83
			status_text.start_y = Form.cheight - STATUSBAR_H + 3;
86
			status_text.start_y = Form.cheight - STATUSBAR_H + 3;
84
			status_text.area_size_x = Form.cwidth - status_text.start_x -3;
87
			status_text.area_size_x = Form.cwidth - status_text.start_x -3;
Line 90... Line 93...
90
		}
93
		}
91
	}
94
	}
92
	if (active!=-1)
95
	if (active!=-1)
93
	{
96
	{
94
		CursorPointer.Restore();
97
		CursorPointer.Restore();
95
		if (links[active].underline) DrawBar(links[active].x, WBY + links[active].y  + links[active].h,links[active].w, WB1.DrawBuf.zoom, link_col_in);
98
		if (links[active].underline) DrawBar(links[active].x, -WB1.list.first + links[active].y  + links[active].h,links[active].w, WB1.DrawBuf.zoom, link_col_in);
96
		DrawBar(status_text.start_x, status_text.start_y, status_text.area_size_x, 9, col_bg);
99
		DrawBar(status_text.start_x, status_text.start_y, status_text.area_size_x, 9, col_bg);
97
		active = -1;
100
		active = -1;
98
	}
101
	}
99
}
102
}