Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals

xgroupbox.cpp

Go to the documentation of this file.
00001 #include "SdlArs.h"
00002 
00003 namespace Ars
00004 {
00005 
00006 XGroupBox::XGroupBox( void )
00007 {
00008 }
00009 
00010 XGroupBox::~XGroupBox( void )
00011 {
00012 }
00013 
00014 
00015 void XGroupBox::Draw( void )
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 }
00054 
00055 }

Generated on Fri Dec 5 04:06:01 2003 for Borqueror by doxygen 1.3.3