Subversion Repositories Kolibri OS

Rev

Rev 8913 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
7921 leency 1
 
2
{
3
	Parse();
4
	DrawPage();
8584 leency 5
}
7921 leency 6
7
 
8
{
9
dword ptr;
8584 leency 10
int line_end;
7921 leency 11
12
 
8584 leency 13
	selection.cancel();
14
	if (list.w != canvas.bufw) canvas.Init(list.x, list.y, list.w, screen.h);
9597 leency 15
8584 leency 16
 
7921 leency 17
	lines.add(textbuf.p);
8584 leency 18
7921 leency 19
 
8584 leency 20
	{
7921 leency 21
		if (ptr - lines.get_last() * list.font_w + 16 >= list.w)
8913 leency 22
		{
7921 leency 23
			//searching a 'white' for a normal word-break
24
			for(line_end = ptr; line_end != lines.get_last(); line_end--) 			{
8913 leency 25
				if (__isWhite(ESBYTE[line_end])) {
26
					ptr = line_end + 1;
27
					break;
28
				}
29
			}
7921 leency 30
			list.count++;
31
			lines.add(ptr);
8584 leency 32
		} else if (ESBYTE[ptr] == '\x0D') {
8913 leency 33
			if (ESBYTE[ptr+1] == '\x0A') ptr++;
34
			list.count++;
35
			lines.add(ptr+1);
36
		} else if (ESBYTE[ptr] == '\x0A') {
37
			list.count++;
38
			lines.add(ptr+1);
39
		}
7921 leency 40
	}
41
	lines.add(ptr);
8584 leency 42
	list.count++;
7921 leency 43
}
44
45
 
8584 leency 46
{
47
	char t[64];
48
	scroll.max_area = list.count;
49
	scroll.cur_area = list.visible;
50
	scroll.position = list.first;
51
	scroll.all_redraw = 0;
52
	scroll.start_x = list.x + list.w;
53
	scroll.start_y = list.y;
54
	scroll.size_y = list.h;
55
56
 
57
		DrawBar(scroll.start_x, scroll.start_y, scroll.size_x,
58
		scroll.size_y, theme.bg);
59
	} else {
60
		scrollbar_v_draw(#scroll);
61
	}
62
	DrawRectangle(scroll.start_x, scroll.start_y, scroll.size_x,
63
		scroll.size_y-1, scroll.bckg_col);
64
65
 
66
67
 
68
	if (selection.is_active()) DrawStatusBar(#t); else DrawStatusBar(" ");
69
}
70
71
 
7921 leency 72
{
73
	int i, ff;
7960 leency 74
	signed s1, s2;
75
	dword ydraw, absolute_y;
7924 leency 76
	dword line_bg;
7921 leency 77
	bool swapped_selection = false;
7924 leency 78
7921 leency 79
 
7935 leency 80
	list.CheckDoesValuesOkey();
7921 leency 81
	if (selection.end_offset < selection.start_offset) {
82
		swapped_selection = selection.swap_start_end();
7924 leency 83
	}
7921 leency 84
85
 
7924 leency 86
	{
7921 leency 87
		ydraw = i * list.item_h;
7924 leency 88
		absolute_y = i + list.first;
89
		line_bg = theme.bg;
7921 leency 90
91
 
7924 leency 92
		canvas.DrawBar(0, ydraw, list.w, list.item_h, line_bg);
8439 leency 93
7921 leency 94
 
7924 leency 95
7921 leency 96
 
7975 leency 97
			s1 = search.found.get(ff) - lines.get(absolute_y);
7960 leency 98
			s2 = search.found.get(ff) - lines.get(absolute_y+1);
99
100
 
101
102
 
103
				canvas.DrawBar(search.found.get(ff) - lines.get(absolute_y) * list.font_w + 3,
8439 leency 104
					ydraw, strlen(#found_text) * list.font_w, list.item_h, theme.found);
7960 leency 105
				search_next = false;
7975 leency 106
			}
7960 leency 107
		}
108
109
 
8584 leency 110
			lines.get(absolute_y), lines.len(absolute_y));
7935 leency 111
	}
7921 leency 112
113
 
8439 leency 114
7921 leency 115
 
7924 leency 116
}
7921 leency 117