Subversion Repositories Kolibri OS

Rev

Rev 6053 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6053 Rev 7285
1
void DrawToolbarButton(char image_id, int x)
1
void DrawToolbarButton(char image_id, int x)
2
{
2
{
3
	DefineButton(x+1, 7, TOOLBAR_ICON_WIDTH-2, TOOLBAR_ICON_HEIGHT-2, 10+image_id + BT_HIDE, 0);
3
	DefineButton(x+1, 7, TOOLBAR_ICON_WIDTH-2, TOOLBAR_ICON_HEIGHT-2, 10+image_id + BT_HIDE, 0);
4
	img_draw stdcall(skin.image, x, 6, TOOLBAR_ICON_WIDTH, TOOLBAR_ICON_HEIGHT, 0, image_id*TOOLBAR_ICON_HEIGHT);
4
	img_draw stdcall(skin.image, x, 6, TOOLBAR_ICON_WIDTH, TOOLBAR_ICON_HEIGHT, 0, image_id*TOOLBAR_ICON_HEIGHT);
5
}
5
}
6
 
6
 
7
 
7
 
8
void DrawScroller()
8
void DrawScroller()
9
{
9
{
10
	scroll.max_area = list.count;
10
	scroll.max_area = list.count;
11
	scroll.cur_area = list.visible;
11
	scroll.cur_area = list.visible;
12
	scroll.position = list.first;
12
	scroll.position = list.first;
13
	scroll.all_redraw = 0;
13
	scroll.all_redraw = 0;
14
	scroll.start_x = list.x + list.w;
14
	scroll.start_x = list.x + list.w;
15
	scroll.start_y = list.y;
15
	scroll.start_y = list.y;
16
	scroll.size_y = list.h;
16
	scroll.size_y = list.h;
17
	scroll.start_x = list.x + list.w;
17
	scroll.start_x = list.x + list.w;
18
	scrollbar_v_draw(#scroll);
18
	scrollbar_v_draw(#scroll);
19
}
19
}
20
 
20
 
21
 
21
 
22
dword MakePageWithHistory()
22
dword MakePageWithHistory()
23
{
23
{
24
	int i;
24
	int i;
25
	static dword history_page;
25
	static dword history_page;
26
 
26
 
27
	if (history_page) free(history_page);
27
	if (history_page) free(history_page);
28
	history_page = malloc(history.items.data_size+256);
28
	history_page = malloc(history.items.data_size+256);
29
	strcat(history_page, "History\n

History

\n");
29
	strcat(history_page, "History\n

History

\n");
30
	strcat(history_page, "

Visited pages


\n");
30
	strcat(history_page, "

Visited pages


\n");
31
	for (i=0; i
31
	for (i=0; i
32
	{
32
	{
33
		strcat(history_page, "
34
		strcat(history_page, history.items.get(i));
34
		strcat(history_page, history.items.get(i));
35
		strcat(history_page, "'>");
35
		strcat(history_page, "'>");
36
		strcat(history_page, history.items.get(i));
36
		strcat(history_page, history.items.get(i));
37
		strcat(history_page, "
\n");
37
		strcat(history_page, "
\n");
38
	}
38
	}
39
	return history_page;
39
	return history_page;
40
}
40
}
-
 
41
 
-
 
42
char char_width[255];
-
 
43
 
-
 
44
void get_label_symbols_size()
-
 
45
{
-
 
46
	int i;
-
 
47
	kfont.changeSIZE();
-
 
48
	for (i=0; i<256; i++) char_width[i] = kfont.symbol_size(i);
-
 
49
}
-
 
50
 
-
 
51
int get_label_len(dword _text) 
-
 
52
{
-
 
53
	int len=0;
-
 
54
	byte ch;
-
 
55
	loop () {
-
 
56
		ch = ESBYTE[_text];
-
 
57
		if (!ch) return len;
-
 
58
		len += char_width[ch];
-
 
59
		_text++;
-
 
60
	}
41
 
61
}
42
 
62
 
43
enum {
63
enum {
44
	STEP_1_DOWNLOAD_PAGE         =   0,
64
	STEP_1_DOWNLOAD_PAGE         =   0,
45
	STEP_2_COUNT_PAGE_HEIGHT     =  35,
65
	STEP_2_COUNT_PAGE_HEIGHT     =  35,
46
	STEP_3_DRAW_PAGE_INTO_BUFFER =  60,
66
	STEP_3_DRAW_PAGE_INTO_BUFFER =  60,
47
	STEP_4_SMOOTH_FONT           =  88,
67
	STEP_4_SMOOTH_FONT           =  88,
48
	STEP_5_STOP                  = 100,
68
	STEP_5_STOP                  = 100,
49
};
69
};
50
 
70
 
51
void DrawProgress(int percent)
71
void DrawProgress(int percent)
52
{
72
{
53
	int progress_width;
73
	int progress_width;
54
	if (percent<100) {
74
	if (percent<100) {
55
		progress_width = address_box.width+5*percent/100;
75
		progress_width = address_box.width+5*percent/100;
56
		DrawBar(address_box.left-3, address_box.top+16, progress_width, 2, 0x72B7EA);
76
		DrawBar(address_box.left-3, address_box.top+16, progress_width, 2, 0x72B7EA);
57
	}
77
	}
58
	else {
78
	else {
59
		progress_width = address_box.width+5;
79
		progress_width = address_box.width+5;
60
		DrawBar(address_box.left-3, address_box.top+16, progress_width, 2, 0xFFFfff);
80
		DrawBar(address_box.left-3, address_box.top+16, progress_width, 2, 0xFFFfff);
61
	}
81
	}
62
}

82
}