Subversion Repositories Kolibri OS

Rev

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

Rev 4488 Rev 4491
Line -... Line 1...
-
 
1
struct array_link {
-
 
2
	dword link, text;
-
 
3
	int x,y,w,h;
-
 
4
};
Line 1... Line 5...
1
struct LinksArray
5
 
2
{
6
struct LinksArray
-
 
7
{
3
	char page_links[12000];
8
	array_link links[100];
-
 
9
	char page_links[12000];
-
 
10
	dword buflen;
-
 
11
	int count, active;
-
 
12
 
-
 
13
	void Hover();
4
	void Add();
14
	void AddLink();
5
	dword GetURL();
15
	void AddText();
6
	void Clear();
16
	dword GetURL();
-
 
17
	void Clear();
-
 
18
};
-
 
19
 
-
 
20
void LinksArray::AddLink(dword new_link, int link_x, link_y)
-
 
21
{
-
 
22
	links[count].x = link_x;
-
 
23
	links[count].y = link_y;
-
 
24
 
-
 
25
	links[count].link = buflen;
-
 
26
	strcpy(buflen, new_link);
7
} PageLinks;
27
	buflen += strlen(new_link)+1;
-
 
28
	count++;
Line 8... Line 29...
8
 
29
}
9
void LinksArray::Add(dword new_link)
30
 
-
 
31
void LinksArray::AddText(dword new_text, int link_w, link_h)
-
 
32
{
-
 
33
	if (count<1) return;
-
 
34
	links[count-1].w = link_w;
-
 
35
	links[count-1].h = link_h;
10
{
36
 
11
	strcat(#page_links, new_link);
37
	links[count-1].text = buflen;
12
	strcat(#page_links, "|");
38
	strcpy(buflen, new_text);
Line 13... Line 39...
13
}
39
	buflen += strlen(new_text)+1;
14
 
40
}
15
dword LinksArray::GetURL(int id)
41
 
-
 
42
dword LinksArray::GetURL(int id)
-
 
43
{
16
{
44
	return links[id].link;
17
	int i, j = 0;
45
}
-
 
46
 
-
 
47
void LinksArray::Clear()
-
 
48
{
-
 
49
	buflen = #page_links;
-
 
50
	count = 0;
-
 
51
	active = -1;
-
 
52
}
18
	for (i = 0; i <= id - 401; i++)
53
 
-
 
54
void LinksArray::Hover(dword mx, my, link_col_in, link_col_a)
19
	{
55
{
-
 
56
	int i;
-
 
57
	if (active>=0)
20
		do
58
	{
21
		{
-
 
22
			j++;
59
		WriteText(links[active].x,links[active].y, 0x80, link_col_in, links[active].text);
23
			if (j>=strlen(#page_links)) return;
60
		DrawBar(links[active].x,links[active].y+8,links[active].w,1, link_col_in);
-
 
61
		active = -1;
-
 
62
	}
-
 
63
	for (i=0; i
-
 
64
	{
-
 
65
		if (mx>links[i].x) && (my>links[i].y) && (mx
-
 
66
		{
-
 
67
			WriteText(links[i].x,links[i].y, 0x80, link_col_a, links[i].text);
24
		}
68
			DrawBar(links[i].x,links[i].y+8,links[i].w,1, link_col_a);
25
		while (page_links[j] <>'|');
-
 
26
	}
-
 
27
	page_links[j] = 0x00;
-
 
28
	strcpy(#URL, #page_links+strrchr(#page_links, '|'));
69
			active = i;
29
	return #URL;
-
 
30
}
-
 
31
 
-
 
32
void LinksArray::Clear()
-
 
33
{
70
			return;
34
	strcpy(#page_links,"|");
71
		}
-
 
72
	}
-
 
73
}
-
 
74
 
35
}
75