Subversion Repositories Kolibri OS

Rev

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

Rev 4497 Rev 4550
Line 1... Line 1...
1
CustomCursor CursorPointer;
1
CustomCursor CursorPointer;
2
dword CursorFile = FROM "../TWB/pointer.cur";
2
dword CursorFile = FROM "../TWB/pointer.cur";
Line -... Line 3...
-
 
3
 
-
 
4
#define NOLINE    0
-
 
5
#define UNDERLINE 1
-
 
6
 
3
 
7
 
4
struct array_link {
8
struct array_link {
5
	dword link, text;
9
	dword link, text;
-
 
10
	int x,y,w,h;
6
	int x,y,w,h;
11
	int underline;
Line 7... Line 12...
7
};
12
};
8
 
13
 
9
struct LinksArray
14
struct LinksArray
Line 29... Line 34...
29
	strcpy(buflen, new_link);
34
	strcpy(buflen, new_link);
30
	buflen += strlen(new_link)+1;
35
	buflen += strlen(new_link)+1;
31
	count++;
36
	count++;
32
}
37
}
Line 33... Line 38...
33
 
38
 
34
void LinksArray::AddText(dword new_text, int link_w, link_h)
39
void LinksArray::AddText(dword new_text, int link_w, link_h, link_underline)
35
{
40
{
36
	if (count<1) return;
41
	if (count<1) return;
37
	links[count-1].w = link_w;
42
	links[count-1].w = link_w;
-
 
43
	links[count-1].h = link_h;
Line 38... Line 44...
38
	links[count-1].h = link_h;
44
	links[count-1].underline = link_underline;
39
 
45
 
40
	links[count-1].text = buflen;
46
	links[count-1].text = buflen;
41
	strcpy(buflen, new_text);
47
	strcpy(buflen, new_text);
Line 65... Line 71...
65
	{
71
	{
66
		if (mx>links[i].x) && (my>links[i].y) && (mx
72
		if (mx>links[i].x) && (my>links[i].y) && (mx
67
		{
73
		{
68
			if (active==i) return;
74
			if (active==i) return;
69
			CursorPointer.Set();
75
			CursorPointer.Set();
70
			DrawBar(links[active].x,links[active].y+8,links[active].w,1, link_col_in);
76
			if (links[active].underline) DrawBar(links[active].x,links[active].y+8,links[active].w,1, link_col_in);
71
			DrawBar(links[i].x,links[i].y+8,links[i].w,1, bg_col);
77
			if (links[i].underline) DrawBar(links[i].x,links[i].y+8,links[i].w,1, bg_col);
72
			active = i;
78
			active = i;
73
			return;
79
			return;
74
		}
80
		}
75
	}
81
	}
76
	if (active!=-1)
82
	if (active!=-1)
77
	{
83
	{
78
		CursorPointer.Restore();
84
		CursorPointer.Restore();
79
		DrawBar(links[active].x,links[active].y+8,links[active].w,1, link_col_in);
85
		if (links[active].underline) DrawBar(links[active].x,links[active].y+8,links[active].w,1, link_col_in);
80
		active = -1;
86
		active = -1;
81
	}
87
	}
82
}
88
}