Subversion Repositories Kolibri OS

Rev

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

Rev 7458 Rev 7636
Line 59... Line 59...
59
}
59
}
Line 60... Line 60...
60
 
60
 
61
:void checkbox::draw(dword _x,_y)
61
:void checkbox::draw(dword _x,_y)
62
{
62
{
-
 
63
	#define SIZE 14
63
	#define SIZE 14
64
	dword text_col = system.color.work_text;
64
	if (!id) id = GetFreeButtonId();
65
	if (!id) id = GetFreeButtonId();
Line 65... Line 66...
65
	x=_x; y=_y;
66
	x=_x; y=_y;
66
 
-
 
67
	DefineButton(x-1, y-1, strlen(text)*8 + SIZE + 17, SIZE+2, id+BT_HIDE+BT_NOFRAME, 0);
67
 
68
	WriteTextWithBg(x+SIZE+8, SIZE / 2 + y -7, 0xD0, system.color.work_text, text, system.color.work);
68
	DefineButton(x-1, y-1, strlen(text)*8 + SIZE + 17, SIZE+2, id+BT_HIDE+BT_NOFRAME, 0);
69
	DrawRectangle(x, y, SIZE, SIZE, system.color.work_graph);
69
	DrawRectangle(x, y, SIZE, SIZE, system.color.work_graph);
70
	if (disabled)
70
	if (disabled)
71
	{
71
	{
-
 
72
		DrawRectangle(x+1, y+1, SIZE-2, SIZE-2, 0xffffff);
72
		DrawRectangle(x+1, y+1, SIZE-2, SIZE-2, 0xffffff);
73
		DrawBar(x+2, y+2, SIZE-3, SIZE-3, 0xCCCccc);
73
		DrawBar(x+2, y+2, SIZE-3, SIZE-3, 0xCCCccc);
74
		text_col = MixColors(system.color.work, system.color.work_text, 128);
74
	}
75
	}
75
	else if (checked == 0)
76
	else if (checked == false)
76
	{
77
	{
77
		DrawRectangle3D(x+1, y+1, SIZE-2, SIZE-2, 0xDDDddd, 0xffffff);
78
		DrawRectangle3D(x+1, y+1, SIZE-2, SIZE-2, 0xDDDddd, 0xffffff);
78
		DrawBar(x+2, y+2, SIZE-3, SIZE-3, 0xffffff);
79
		DrawBar(x+2, y+2, SIZE-3, SIZE-3, 0xffffff);
79
	} 
80
	} 
80
	else if (checked == 1)
81
	else if (checked == true)
81
	{
82
	{
-
 
83
		_PutImage(x+1, y+1, 13, 13, #checkbox_flag);
82
		_PutImage(x+1, y+1, 13, 13, #checkbox_flag);
84
	}
83
	}
85
	if (text) WriteTextWithBg(x+SIZE+8, SIZE / 2 + y -7, 0xD0, text_col, text, system.color.work);
Line 84... Line 86...
84
	DrawRectangle3D(x-1,y-1,SIZE+2,SIZE+2,system.color.work_dark,system.color.work_light);
86
	DrawRectangle3D(x-1,y-1,SIZE+2,SIZE+2,system.color.work_dark,system.color.work_light);
85
}
87
}