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

Ars::XButton Class Reference

#include <xbutton.h>

Inheritance diagram for Ars::XButton:

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

Collaboration graph
[legend]

Public Member Functions

 XButton (void)
 ~XButton (void)
 Standard destructor.

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

virtual const bool evMouseButtonDown (const MouseMessage &msg)
virtual const bool evMouseButtonUp (const MouseMessage &msg)
virtual const bool evMouseMove (const MouseMessage &msg)

Protected Attributes

unsigned int m_MouseButton
 The last mouse button to be pushed over the control, it's used internally.


Constructor & Destructor Documentation

Ars::XButton::XButton void   ) 
 

Construct a new Button

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 xbutton.cpp.

00007 : m_MouseButton( 0 )
00008 {
00009 }

Ars::XButton::~XButton void   ) 
 

Standard destructor.

Definition at line 11 of file xbutton.cpp.

00012 {
00013 }


Member Function Documentation

const bool Ars::XButton::evMouseButtonDown const MouseMessage msg  )  [virtual]
 

Reimplemented from Ars::Window.

Definition at line 35 of file xbutton.cpp.

References Ars::Window::FindWindow(), Ars::Painter::GetStates(), Ars::MouseMessage::Point, S_DISABLED, S_FOCUS, S_HIGHLIGHT, S_SELECTED, and Ars::Thing::SetState().

00036 {
00037         bool ans = XLabel::evMouseButtonDown( msg );
00038 
00039         if( (GetStates() & S_DISABLED)  == 0 )
00040                 if( (GetStates() & S_SELECTED) != S_SELECTED && FindWindow( &msg.Point ) == this )
00041                 {
00042                         ans = SetState( S_HIGHLIGHT|S_FOCUS|S_SELECTED );
00043                 }
00044 
00045         return ans;
00046 }

const bool Ars::XButton::evMouseButtonUp const MouseMessage msg  )  [virtual]
 

Reimplemented from Ars::Window.

Definition at line 48 of file xbutton.cpp.

References Ars::Painter::GetStates(), Ars::Thing::ResetState(), S_FOCUS, S_HIGHLIGHT, S_SELECTED, and Ars::Thing::SetState().

00049 {
00050         bool ans = XLabel::evMouseButtonUp( msg );
00051 
00052         if( (GetStates() & S_SELECTED) == S_SELECTED )
00053         {
00054                 SetState( S_HIGHLIGHT|S_FOCUS );
00055                 ans = ResetState( S_SELECTED ) || ans;
00056         }
00057         return ans;
00058 }

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

Reimplemented from Ars::XLabel.

Definition at line 26 of file xbutton.cpp.

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

00027 {
00028         bool ans = XLabel::evMouseMove( msg );
00029 
00030         if( FindWindow( &msg.Point ) == this )
00031                 ResetState( S_FOCUS );
00032         return ans;
00033 }

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

Deregister the setup_window message.

Reimplemented from Ars::XLabel.

Reimplemented in Ars::XButtonImage.

Definition at line 15 of file xbutton.cpp.

00016 {
00017         XLabel::SetupWindow( msg );
00018 
00019         MessageServer::Instance().RegisterMessageClient( this , Message::MOUSE_BUTTONDOWN );
00020         MessageServer::Instance().RegisterMessageClient( this , Message::MOUSE_BUTTONUP );
00021         MessageServer::Instance().RegisterMessageClient( this , Message::MOUSE_MOVE );
00022         
00023         return true;
00024 }


Field Documentation

unsigned int Ars::XButton::m_MouseButton [protected]
 

The last mouse button to be pushed over the control, it's used internally.

Reimplemented from Ars::Window.

Definition at line 9 of file xbutton.h.


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