Subversion Repositories Kolibri OS

Rev

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

Rev 7373 Rev 7636
Line 3... Line 3...
3
	unsigned value, min, max;
3
	unsigned value, min, max;
4
	dword text;
4
	dword text;
5
	int click_delta;
5
	int click_delta;
6
	int x,y;
6
	int x,y;
7
	unsigned id_inc, id_dec;
7
	unsigned id_inc, id_dec;
-
 
8
	bool disabled;
8
	void check_values();
9
	void check_values();
9
	bool click();
10
	bool click();
10
	bool inc();
11
	bool inc();
11
	bool dec();
12
	bool dec();
12
	void draw();
13
	void draw();
Line 39... Line 40...
39
 
40
 
40
:void more_less_box::draw(dword _x,_y)
41
:void more_less_box::draw(dword _x,_y)
41
{
42
{
42
	#define VALUE_FIELD_W 34
43
	#define VALUE_FIELD_W 34
-
 
44
	#define SIZE 18
43
	#define SIZE 18
45
	dword text_col = system.color.work_text;
Line 44... Line 46...
44
	dword value_text = itoa(value);
46
	dword value_text = itoa(value);
45
 
47
 
Line 46... Line 48...
46
	check_values();
48
	check_values();
47
	x=_x; y=_y;
49
	x=_x; y=_y;
-
 
50
 
-
 
51
	DrawRectangle(x, y, VALUE_FIELD_W+1, SIZE, system.color.work_graph);
-
 
52
	DrawRectangle3D(x+1, y+1, VALUE_FIELD_W-2, SIZE-2, 0xDDDddd, 0xffffff);
-
 
53
 
-
 
54
	if (disabled)
-
 
55
	{
-
 
56
		DrawRectangle(x+1, y+1, VALUE_FIELD_W-2, SIZE-2, 0xffffff);
-
 
57
		DrawBar(x+2, y+2, VALUE_FIELD_W-3, SIZE-3, 0xCCCccc);
-
 
58
		text_col = MixColors(system.color.work, system.color.work_text, 128);
48
 
59
	}
-
 
60
	else 
-
 
61
	{
49
	DrawRectangle(x, y, VALUE_FIELD_W+1, SIZE, system.color.work_graph);
62
		DrawBar(x+2, y+2, VALUE_FIELD_W-3, SIZE-3, 0xffffff);
Line 50... Line 63...
50
	DrawRectangle3D(x+1, y+1, VALUE_FIELD_W-2, SIZE-2, 0xDDDddd, 0xffffff);
63
	}
51
	DrawBar(x+2, y+2, VALUE_FIELD_W-3, SIZE-3, 0xffffff);
64
 
52
	WriteText( -strlen(value_text)+3*8 + x+6, SIZE / 2 + y -6, 0x90, 0x333333, value_text);
65
	WriteText( -strlen(value_text)+3*8 + x+6, SIZE / 2 + y -6, 0x90, 0x333333, value_text);
53
 
66
 
54
	DrawCaptButton(VALUE_FIELD_W + x + 1,    y, SIZE, SIZE, id_inc, system.color.work_button, system.color.work_button_text, "+");
67
	DrawCaptButton(VALUE_FIELD_W + x + 1,    y, SIZE, SIZE, id_inc, system.color.work_button, system.color.work_button_text, "+");
Line 55... Line 68...
55
	DrawCaptButton(VALUE_FIELD_W + x + SIZE, y, SIZE, SIZE, id_dec, system.color.work_button, system.color.work_button_text, "-");
68
	DrawCaptButton(VALUE_FIELD_W + x + SIZE, y, SIZE, SIZE, id_dec, system.color.work_button, system.color.work_button_text, "-");
56
	WriteTextWithBg(x+VALUE_FIELD_W+SIZE+SIZE+10, SIZE / 2 + y -7, 0xD0, system.color.work_text, text, system.color.work);
69
	WriteTextWithBg(x+VALUE_FIELD_W+SIZE+SIZE+10, SIZE / 2 + y -7, 0xD0, text_col, text, system.color.work);