Пример #1
0
	void Label::paintEvent( PaintEvent& , GFX& g )
	{
		int w, h;
		g.color() = _color;
		size( w, h );
		g.drawText( 0, 0, w, h, _aligment, _label.c_str() );
	}
Пример #2
0
	void Moveable::paintEvent( PaintEvent& , GFX& gfx )
	{
		int w, h;

		size( w, h );
		gfx.color().set( 0.2f, 0.2f, 0.2f, 0.8f );
		gfx.fillRoundRect( 0, 0, w, h, 10.0f );


		gfx.color().set( 0.6f, 0.6f, 0.6f, 1.0f );
		Recti rtitle( 10, 2, w - 20, 18 );
		gfx.drawText( rtitle, ALIGN_LEFT | ALIGN_VCENTER, _title.c_str() );


		Recti r = rect();
		paintChildren( gfx, r );

		if( !_togglebutton.state() ) {
			gfx.color().set( 0.6f, 0.6f, 0.6f, 1.0f );
			gfx.drawIcon( w - 18, h - 18, GFX::ICON_CORNER );
		}
	}