Subversion Repositories Kolibri OS

Rev

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

Rev 5985 Rev 5987
Line 8... Line 8...
8
	dword line_length=30;
8
	dword line_length=30;
9
	dword stroka_y = 5;
9
	dword stroka_y = 5;
10
	dword stroka=0;
10
	dword stroka=0;
11
	int i, srch_pos;
11
	int i, srch_pos;
Line 12... Line 12...
12
	
12
	
13
	font.changeSIZE();
13
	label.changeSIZE();
14
	list.w = Form.cwidth-scroll.size_x-1;
14
	list.w = Form.cwidth-scroll.size_x-1;
15
	//get font chars width, need to increase performance
15
	//get font chars width, need to increase performance
16
	for (i=0; i<256; i++) char_width[i] = font.symbol_size(i);
16
	for (i=0; i<256; i++) char_width[i] = label.symbol_size(i);
17
	//get font buffer height
17
	//get font buffer height
18
	for (bufoff=io.buffer_data; ESBYTE[bufoff]; bufoff++)
18
	for (bufoff=io.buffer_data; ESBYTE[bufoff]; bufoff++)
19
	{
19
	{
20
		ch = ESBYTE[bufoff];
20
		ch = ESBYTE[bufoff];
Line 32... Line 32...
32
			stroka++;
32
			stroka++;
33
		}
33
		}
34
	}
34
	}
35
	//draw text in buffer
35
	//draw text in buffer
36
	list.count = stroka+2;
36
	list.count = stroka+2;
37
	list.SetSizes(0, TOOLBAR_H, list.w, Form.cheight-TOOLBAR_H, font.size.text+1);
37
	list.SetSizes(0, TOOLBAR_H, list.w, Form.cheight-TOOLBAR_H, label.size.pt+1);
38
	if (list.count < list.visible) list.count = list.visible;
38
	if (list.count < list.visible) list.count = list.visible;
Line 39... Line 39...
39
 
39
 
40
	font.size.height = list.count+1*list.item_h;
40
	label.size.height = list.count+1*list.item_h;
Line 41... Line 41...
41
	font.buffer_size = 0;
41
	label.raw_size = 0;
42
 
42
 
43
	line_length = 30;
43
	line_length = 30;
44
	line_start = io.buffer_data;
44
	line_start = io.buffer_data;
Line 56... Line 56...
56
				if (srch_pos == line_start) break; //no white space found in whole line
56
				if (srch_pos == line_start) break; //no white space found in whole line
57
				srch_pos--;
57
				srch_pos--;
58
			}
58
			}
59
			i = bufoff-line_start;
59
			i = bufoff-line_start;
60
			strlcpy(#line, line_start, i);
60
			strlcpy(#line, line_start, i);
61
			font.write_buf(8,stroka_y,list.w,font.size.height, #line);
61
			label.write_buf(8,stroka_y,list.w,label.size.height, 0xFFFFFF, 0, label.size.pt, #line);
62
			stroka_y += list.item_h;
62
			stroka_y += list.item_h;
63
			line_start = bufoff;
63
			line_start = bufoff;
64
			line_length = 30;
64
			line_length = 30;
65
		}
65
		}
66
	}
66
	}
67
	font.write_buf(8,stroka_y,list.w,font.size.height, line_start);
67
	label.write_buf(8,stroka_y,list.w,label.size.height, 0xFFFFFF, 0, label.size.pt, line_start);
68
	font.apply_smooth();
68
	label.apply_smooth();
69
	DrawPage();
69
	DrawPage();
70
}
70
}