Subversion Repositories Kolibri OS

Rev

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

Rev 7636 Rev 7806
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
	dword text_col = sc.work_text;
65
	if (!id) id = GetFreeButtonId();
65
	if (!id) id = GetFreeButtonId();
Line 66... Line 66...
66
	x=_x; y=_y;
66
	x=_x; y=_y;
67
 
67
 
68
	DefineButton(x-1, y-1, strlen(text)*8 + SIZE + 17, SIZE+2, id+BT_HIDE+BT_NOFRAME, 0);
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, sc.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
		text_col = MixColors(sc.work, sc.work_text, 128);
75
	}
75
	}
76
	else if (checked == false)
76
	else if (checked == false)
77
	{
77
	{
78
		DrawRectangle3D(x+1, y+1, SIZE-2, SIZE-2, 0xDDDddd, 0xffffff);
78
		DrawRectangle3D(x+1, y+1, SIZE-2, SIZE-2, 0xDDDddd, 0xffffff);
79
		DrawBar(x+2, y+2, SIZE-3, SIZE-3, 0xffffff);
79
		DrawBar(x+2, y+2, SIZE-3, SIZE-3, 0xffffff);
80
	} 
80
	} 
81
	else if (checked == true)
81
	else if (checked == true)
82
	{
82
	{
83
		_PutImage(x+1, y+1, 13, 13, #checkbox_flag);
83
		_PutImage(x+1, y+1, 13, 13, #checkbox_flag);
84
	}
84
	}
85
	if (text) WriteTextWithBg(x+SIZE+8, SIZE / 2 + y -7, 0xD0, text_col, text, system.color.work);
85
	if (text) WriteTextWithBg(x+SIZE+8, SIZE / 2 + y -7, 0xD0, text_col, text, sc.work);
Line 86... Line 86...
86
	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,sc.work_dark,sc.work_light);
87
}
87
}
88
 
88