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

Ars::XLabel Class Reference

A static label that renders it's multiple lines to the screen. More...

#include <xlabel.h>

Inheritance diagram for Ars::XLabel:

Inheritance graph
[legend]
Collaboration diagram for Ars::XLabel:

Collaboration graph
[legend]

Public Member Functions

 XLabel (void)
 ~XLabel (void)
 Standard destructor.

virtual const bool SetupWindow (const Message &msg)
 Deregister the setup_window message.

virtual void SetWndText (const std::string &sWindowText)
virtual void AppendWindowText (const std::string &sWindowText)
virtual void Draw (void)
 Renders the Window Text, and clips to the Window Rect.

virtual void AdjustColors (void)
virtual void RestoreColors (void)
virtual const bool evMouseMove (const MouseMessage &msg)

Detailed Description

A static label that renders it's multiple lines to the screen.

Definition at line 8 of file xlabel.h.


Constructor & Destructor Documentation

Ars::XLabel::XLabel void   ) 
 

Construct a new label

Parameters:
WindowRect A CRect that defines the outer limits of the control
aStr the rest of the resource to initialize the object

Definition at line 6 of file xlabel.cpp.

00007 {
00008 }       

Ars::XLabel::~XLabel void   ) 
 

Standard destructor.

Definition at line 10 of file xlabel.cpp.

00011 {
00012 }


Member Function Documentation

void Ars::XLabel::AdjustColors void   )  [virtual]
 

Reimplemented from Ars::Window.

Definition at line 44 of file xlabel.cpp.

References Ars::Thing::GetBgColor(), Ars::Thing::GetFgColor(), Ars::Painter::GetStates(), S_DISABLED, S_HIGHLIGHT, S_INVERTONFOLLOW, S_SELECTED, Ars::Thing::SetBgColor(), and Ars::Thing::SetFgColor().

00045 {
00046         if( GetStates() & S_DISABLED )
00047                 SetFgColor( GetFgColor().FadeColor( -32 ) );
00048         else if( (GetStates() & (S_HIGHLIGHT|S_SELECTED)) != 0 )
00049                 if( GetStates() & S_INVERTONFOLLOW )
00050                 {
00051                         RGBColor        c = GetFgColor();
00052                         SetFgColor( GetBgColor() );
00053                         SetBgColor( c );
00054                 }
00055                 else
00056                         SetFgColor( GetFgColor().FadeColor( 32 ) );
00057         XBox::AdjustColors();
00058 }

void Ars::XLabel::AppendWindowText const std::string &  sWindowText  )  [virtual]
 

Add some text to the current label

Parameters:
sWindowText The text to append to the window

Definition at line 39 of file xlabel.cpp.

References Ars::Window::GetWindowText(), and SetWndText().

00040 {
00041         SetWndText( GetWindowText() + sWindowText );
00042 }

void Ars::XLabel::Draw void   )  [virtual]
 

Renders the Window Text, and clips to the Window Rect.

Reimplemented from Ars::XBox.

Reimplemented in Ars::XButtonImage, Ars::XCheckBox, Ars::XGroupBox, Ars::XProgress, and Ars::XTextBox.

Definition at line 23 of file xlabel.cpp.

References Ars::Thing::GetFgColor(), Ars::Thing::GetWindowRect(), Ars::Window::GetWindowText(), and Ars::HPaint::TextOutStr().

00024 {
00025         XBox::Draw();
00026 
00027         TextOutStr( GetWindowRect() ,  GetWindowText() , GetFgColor() );
00028 }

const bool Ars::XLabel::evMouseMove const MouseMessage msg  )  [virtual]
 

Reimplemented from Ars::MessageClient.

Reimplemented in Ars::XToolTip, Ars::XButton, and Ars::XProgress.

Definition at line 77 of file xlabel.cpp.

References Ars::Window::FindWindow(), Ars::MouseMessage::Point, Ars::Thing::ResetState(), S_HIGHLIGHT, and Ars::Thing::SetState().

00078 {
00079         bool ans = XBox::evMouseMove( msg );
00080 
00081         if( FindWindow( &msg.Point ) == this )
00082                 SetState( S_HIGHLIGHT );
00083         else
00084                 ResetState( S_HIGHLIGHT );
00085 
00086         return ans;
00087 }

void Ars::XLabel::RestoreColors void   )  [virtual]
 

Reimplemented from Ars::Window.

Definition at line 60 of file xlabel.cpp.

References Ars::Thing::GetBgColor(), Ars::Thing::GetFgColor(), Ars::Painter::GetStates(), S_DISABLED, S_HIGHLIGHT, S_INVERTONFOLLOW, S_SELECTED, Ars::Thing::SetBgColor(), and Ars::Thing::SetFgColor().

00061 {
00062         if( GetStates() & S_DISABLED )
00063                 SetFgColor( GetFgColor().FadeColor( 32 ) );
00064         else if( (GetStates() & (S_HIGHLIGHT|S_SELECTED)) != 0 )
00065                 if( GetStates() & S_INVERTONFOLLOW )
00066                 {
00067                         RGBColor        c = GetFgColor();
00068                         SetFgColor( GetBgColor() );
00069                         SetBgColor( c );
00070                 }
00071                 else
00072                         SetFgColor( GetFgColor().FadeColor( -32 ) );
00073 
00074         XBox::RestoreColors();
00075 }

const bool Ars::XLabel::SetupWindow const Message msg  )  [virtual]
 

Deregister the setup_window message.

Reimplemented from Ars::Window.

Reimplemented in Ars::XToolTip, Ars::XButton, Ars::XButtonImage, Ars::XCheckBox, Ars::XProgress, and Ars::XTextBox.

Definition at line 14 of file xlabel.cpp.

00015 {
00016         XBox::SetupWindow( msg );
00017 
00018         MessageServer::Instance().RegisterMessageClient( this , Message::MOUSE_MOVE );
00019         
00020         return true;
00021 }

void Ars::XLabel::SetWndText const std::string &  sWindowText  )  [virtual]
 

Set the WindowText of the label

Parameters:
sWindowText The text to assign to the window

Reimplemented from Ars::Window.

Reimplemented in Ars::XToolTip, and Ars::XTextBox.

Definition at line 30 of file xlabel.cpp.

References Ars::Thing::SetDirty(), and Ars::Window::UpdateWindow().

Referenced by AppendWindowText(), Ars::XScrollBar::Init(), Ars::XDropDown::Init(), and Ars::XProgress::SetProgress().

00031 {
00032         XBox::SetWndText( sWindowText );
00033 
00034         SetDirty( true );
00035 
00036         UpdateWindow();
00037 }


The documentation for this class was generated from the following files:
Generated on Fri Dec 5 04:06:59 2003 for Borqueror by doxygen 1.3.3