Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
6053 leency 1
char char_width[255];
2
 
3
void get_label_symbols_size()
4
{
5
	int i;
6
	label.changeSIZE();
7
	for (i=0; i<256; i++) char_width[i] = label.symbol_size(i);
8
}
9
 
10
int get_label_len(dword _text)
11
{
12
	int len=0;
13
	byte ch;
14
	loop () {
15
		ch = ESBYTE[_text];
16
		if (!ch) return len;
17
		len += char_width[ch];
18
		_text++;
19
	}
20
}
21
 
22
void WriteTextIntoBuf(int _x, _y; dword _text_col, _text_off)
23
{
24
	char error_message[128];
25
	if (_x > list.w) {
26
		sprintf(#error_message, "\nWriteTextIntoBuf _x overflow: H %d X %d \n", label.size.height, _x);
27
		notify(#error_message);
28
	}
29
	if (_y+label.size.pt > label.size.height) {
30
		sprintf(#error_message, "\nWriteTextIntoBuf _y overflow: H %d Y %d \n", label.size.height, _y);
31
		notify(#error_message);
32
		return;
33
	}
34
	label.write_buf(_x, _y, list.w, label.size.height, 0xFFFFFF, _text_col, label.size.pt, _text_off);
35
	if (_y/list.item_h-list.first==list.visible) DrawPage();
36
}
37
 
38
 
39
void label_draw_bar(dword _x, _y, _w, _color)
40
{
41
	int i;
42
	for (i = _y*list.w+_x*3+label.raw ; i<_y*list.w+_x+_w*3+label.raw ; i+=3)   ESDWORD[i] = _color;
43
}