예제 #1
0
파일: tabbar.cpp 프로젝트: snori/ntk
void
TabBar::Tab::draw(DC& dc)
{
	const RGBColor ACTIVE_COLOR = ntk::app_color();// + 30;
	Rect rect = frame();
	rect.top += 1;

	dc.push_state();

	if(is_active())
	{
		dc.set_brush(ACTIVE_COLOR);
		dc.fill_rect(rect);

		dc.set_pen(ntk::outline_color());
		dc.stroke_line(rect.left_top(), rect.left_bottom());
		dc.stroke_line(rect.left_top(), rect.right_top());
		dc.stroke_line(rect.right_top(), rect.right_bottom());

		dc.set_text_color(ntk::font_color());
	}
	else
		dc.set_text_color(ntk::font_color() - 30);

	ntk::draw_string_center(dc, rect, name());

	dc.pop_state();
}
예제 #2
0
void
stroke_edge(DC& dc, const Rect& rect, const Pen& light_pen, const Pen& dark_pen)
{
	Pen default_pen = dc.pen();

	dc.set_pen(light_pen);
	dc.move_to(rect.left, rect.bottom -1);
	dc.stroke_line(rect.left, rect.top);
	dc.stroke_line(rect.right -1, rect.top);

	dc.set_pen(dark_pen);
	dc.stroke_line(rect.right -1, rect.bottom -1);
	dc.stroke_line(rect.left, rect.bottom -1);

	dc.set_pen(default_pen);
}