|
|
Draws the XGroupBox.
Reimplemented from Ars::XLabel.
Definition at line 15 of file xgroupbox.cpp.
References Ars::XBox::DrawRaised(), Ars::HPaint::DrawRect(), Ars::XBox::DrawSunken(), Ars::HPaint::EPaintMode, Ars::Thing::GetBgColor(), Ars::Thing::GetFgColor(), Ars::HPaint::GetFontSize(), Ars::HPaint::GetMetrics(), Ars::Painter::GetStates(), Ars::Thing::GetWindowRect(), Ars::Window::GetWindowText(), Ars::XRect::Grow(), HALIGN_MASK, Ars::HPaint::PAINT_REPLACE, Ars::Thing::ResetState(), S_ALIGN_LEFT, S_ALIGN_TOP, S_RAISED, S_SUNKEN, Ars::HPaint::SetMode(), Ars::Thing::SetState(), Ars::HPaint::TextOutStr(), VALIGN_MASK, Ars::XPoint::x, and Ars::XPoint::y.
00016 {
00017 XRect w( GetWindowRect() );
00018
00019 w.y += GetFontSize() / 2;
00020
00021 if( GetStates() & S_RAISED )
00022 {
00023 DrawRaised( w , GetBgColor() );
00024 w.Grow( -2 );
00025 DrawSunken( w , GetBgColor() );
00026 w.Grow( 2 );
00027 }
00028 else if( GetStates() & S_SUNKEN )
00029 {
00030 DrawSunken( w , GetBgColor() );
00031 w.Grow( -2 );
00032 DrawRaised( w , GetBgColor() );
00033 w.Grow( 2 );
00034 }
00035
00036 const unsigned long stateBak = GetStates();
00037 ResetState( VALIGN_MASK|HALIGN_MASK );
00038 SetState( S_ALIGN_LEFT|S_ALIGN_TOP );
00039 w.y -= GetFontSize() / 2;
00040 w.x += GetFontSize() / 2;
00041 XPoint sz;
00042 GetMetrics( GetWindowText() , &sz , 0 , 0 );
00043 w.w = sz.x;
00044 w.h = sz.y;
00045
00046 EPaintMode prev = SetMode( PAINT_REPLACE );
00047
00048 DrawRect( w , true , GetBgColor() , GetBgColor() );
00049 TextOutStr( w , GetWindowText() , GetFgColor() );
00050 SetState( stateBak );
00051
00052 SetMode( prev );
00053 }
|