Subversion Repositories Kolibri OS

Rev

Rev 6806 | Go to most recent revision | Details | Compare with Previous | 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;
6806 leency 6
	kfont.changeSIZE();
7
	for (i=0; i<256; i++) char_width[i] = kfont.symbol_size(i);
6053 leency 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) {
6806 leency 26
		sprintf(#error_message, "'WriteTextIntoBuf _x overflow: H %d X %d' -A", kfont.size.height, _x);
6053 leency 27
		notify(#error_message);
28
	}
6806 leency 29
	if (_y+kfont.size.pt > kfont.size.height) {
30
		sprintf(#error_message, "'WriteTextIntoBuf _y overflow: H %d Y %d' -A", kfont.size.height, _y);
6053 leency 31
		notify(#error_message);
32
		return;
33
	}
6806 leency 34
	kfont.WriteIntoBuffer(_x, _y, list.w, kfont.size.height, 0xFFFFFF, _text_col, kfont.size.pt, _text_off);
6053 leency 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;
6808 leency 42
	for (i = _y*list.w+_x*KFONT_BPP+kfont.raw ; i<_y*list.w+_x+_w*KFONT_BPP+kfont.raw ; i+=KFONT_BPP)
43
	{
44
		ESDWORD[i] = _color;
45
	}
6053 leency 46
}