Subversion Repositories Kolibri OS

Rev

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

Rev 7462 Rev 7525
Line 1... Line 1...
1
enum {
1
enum {
2
	COUNT_BUF_HEIGHT,
2
	COUNT_BUF_HEIGHT,
3
	DRAW_BUF
3
	DRAW_BUF
4
};
4
};
Line -... Line 5...
-
 
5
 
-
 
6
#define DRAW_PADDING 12
5
 
7
 
6
void Parcer(byte mode)
8
void Parcer(byte mode)
7
{
9
{
8
dword bufoff, buflen;
10
dword bufoff, buflen;
9
byte ch;
11
byte ch;
10
char line[4096]=0;
12
char line[4096]=0;
11
int srch_pos;
13
int srch_pos;
12
dword stroka_y=5;
14
dword stroka_y=DRAW_PADDING-3;
13
dword line_length=30;
15
dword line_length=30;
Line 14... Line 16...
14
dword line_start=io.buffer_data;
16
dword line_start=io.buffer_data;
15
 
17
 
Line 32... Line 34...
32
				list.count++;
34
				list.count++;
33
			}
35
			}
34
			if (mode==DRAW_BUF) {
36
			if (mode==DRAW_BUF) {
35
				EBX = bufoff-line_start;
37
				EBX = bufoff-line_start;
36
				strlcpy(#line, line_start, EBX);
38
				strlcpy(#line, line_start, EBX);
37
				kfont.WriteIntoBuffer(8,stroka_y,list.w,kfont.size.height, bg_color, text_color, kfont.size.pt, #line);
39
				kfont.WriteIntoBuffer(DRAW_PADDING,stroka_y,list.w,kfont.size.height, bg_color, text_color, kfont.size.pt, #line);
38
				stroka_y += list.item_h;
40
				stroka_y += list.item_h;
39
				line_start = bufoff;
41
				line_start = bufoff;
40
				line_length = 30;
42
				line_length = 30;
41
			}
43
			}
42
		}
44
		}
43
	}
45
	}
44
	if (mode==COUNT_BUF_HEIGHT) list.count+=2;
46
	if (mode==COUNT_BUF_HEIGHT) list.count+=2;
45
	if (mode==DRAW_BUF) kfont.WriteIntoBuffer(8,stroka_y,list.w,kfont.size.height, bg_color, text_color, kfont.size.pt, line_start);
47
	if (mode==DRAW_BUF) kfont.WriteIntoBuffer(DRAW_PADDING,stroka_y,list.w,kfont.size.height, bg_color, text_color, kfont.size.pt, line_start);
46
}
48
}
Line 47... Line 49...
47
 
49
 
48
void PreparePage() 
50
void PreparePage() 
49
{
51
{
50
	list.w = Form.cwidth-scroll.size_x-1;
52
	list.w = Form.cwidth-scroll.size_x-1;
51
	list.count=0;
53
	list.count=0;
Line 52... Line 54...
52
	Parcer(COUNT_BUF_HEIGHT);
54
	Parcer(COUNT_BUF_HEIGHT);
53
	
55
	
54
	//draw text in buffer
56
	//draw text in buffer
55
	list.SetSizes(0, TOOLBAR_H, list.w, Form.cheight-TOOLBAR_H, kfont.size.pt+4);
57
	list.SetSizes(0, TOOLBAR_H, list.w, Form.cheight-TOOLBAR_H, kfont.size.pt+6);
56
	if (list.count < list.visible) list.count = list.visible;
58
	if (list.count < list.visible) list.count = list.visible;
57
	kfont.size.height = list.count+1*list.item_h;
59
	kfont.size.height = list.count+1*list.item_h;