Subversion Repositories Kolibri OS

Rev

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

Rev 7924 Rev 7941
Line 9... Line 9...
9
	void draw_line();
9
	void draw_line();
10
	void cancel();
10
	void cancel();
11
	bool swap_start_end();
11
	bool swap_start_end();
12
	void normalize();
12
	void normalize();
13
	void select_all();
13
	void select_all();
-
 
14
	void debug();
14
} selection;
15
} selection;
Line 15... Line 16...
15
 
16
 
16
bool SELECTION::is_active()
17
bool SELECTION::is_active()
17
{
18
{
Line 31... Line 32...
31
{
32
{
32
	if (is_active()) {
33
	if (is_active()) {
33
		if (start_y == i) && (end_y == i) draw_line(start_x * list.font_w+2, start_y, end_x - start_x * list.font_w);
34
		if (start_y == i) && (end_y == i) draw_line(start_x * list.font_w+2, start_y, end_x - start_x * list.font_w);
34
		else if (start_y == i) draw_line(start_x * list.font_w+2, start_y, list.w -2- calc(start_x * list.font_w));
35
		else if (start_y == i) draw_line(start_x * list.font_w+2, start_y, list.w -2- calc(start_x * list.font_w));
35
		else if (end_y == i) draw_line(0, end_y, end_x * list.font_w+2);
36
		else if (end_y == i) draw_line(0, end_y, end_x * list.font_w+2);
-
 
37
		//only for debug:
36
		//DrawBuf.DrawBar(start_x * list.font_w + 2,  start_y * list.item_h, 2, list.item_h, 0x00FF00);
38
		//DrawBuf.DrawBar(start_x * list.font_w + 2,  start_y * list.item_h, 2, list.item_h, 0x00FF00);
37
		//DrawBuf.DrawBar(end_x * list.font_w + 0,  end_y * list.item_h, 2, list.item_h, 0xFF00FF);
39
		//DrawBuf.DrawBar(end_x * list.font_w + 0,  end_y * list.item_h, 2, list.item_h, 0xFF00FF);
38
	}
40
	}
39
	//DrawCursor
41
	//DrawCursor
40
	if (list.cur_y >= list.first) && (list.cur_y <= list.first+list.visible) {
42
	if (list.cur_y >= list.first) && (list.cur_y <= list.first+list.visible) {
Line 57... Line 59...
57
	start_y = list.cur_y;
59
	start_y = list.cur_y;
58
	normalize();
60
	normalize();
59
	start_offset = lines.get(start_y) + start_x;
61
	start_offset = lines.get(start_y) + start_x;
60
}
62
}
Line -... Line 63...
-
 
63
 
-
 
64
:void SELECTION::debug()
-
 
65
{
-
 
66
	char rez[256];
-
 
67
	sprintf(#rez, "start_x: %d start_y: %d end_x: %d end_y: %d", start_x, start_y, end_x, end_y);
-
 
68
	debugln(#rez);
-
 
69
}
61
 
70
 
62
void SELECTION::set_end()
71
void SELECTION::set_end()
63
{
72
{
64
	end_x = list.cur_x;
73
	end_x = list.cur_x;
65
	end_y = list.cur_y;
74
	end_y = list.cur_y;
66
	normalize();
75
	normalize();
67
	end_offset = lines.get(end_y) + end_x;
-
 
68
	//debugval("end_x", end_x);
-
 
69
	//debugval("end_y", end_y);
76
	end_offset = lines.get(end_y) + end_x;
Line 70... Line 77...
70
}
77
}
71
 
78
 
Line 82... Line 89...
82
	start_x = 0;
89
	start_x = 0;
83
	end_y = lines.count-2;
90
	end_y = lines.count-2;
84
	end_x = lines.get(end_y+1) - lines.get(end_y);
91
	end_x = lines.get(end_y+1) - lines.get(end_y);
85
	start_offset = lines.get(start_y) + start_x;
92
	start_offset = lines.get(start_y) + start_x;
86
	end_offset = lines.get(end_y) + end_x;
93
	end_offset = lines.get(end_y) + end_x;
87
	//debugval("end_x__", end_x);
-
 
88
	//debugval("end_y__", end_y);
-
 
89
}
94
}
Line 90... Line 95...
90
 
95
 
91
bool SELECTION::swap_start_end()
96
bool SELECTION::swap_start_end()
92
{
97
{