wGui::CCheckBox Class Reference

A checkbox control. More...

#include <wg_checkbox.h>

Inheritance diagram for wGui::CCheckBox:

wGui::CWindow wGui::CMessageClient

Public Types

Public Member Functions

Protected Attributes


Detailed Description

A checkbox control.

The checkbox will generate CTRL_xCLICK messages when clicked with the mouse (where x is the button L,M,R) It will also generate a CTRL_VALUECHANGE message whenever the checkbox is toggled Checkboxes do not display their own labels

Definition at line 41 of file wg_checkbox.h.


Member Enumeration Documentation

enum wGui::CCheckBox::EState

The checkbox state.

Enumerator:
UNCHECKED  The checkbox is unchecked.
CHECKED  The checkbox is checked.
DISABLED  The checkbox is disabled.

Definition at line 53 of file wg_checkbox.h.


Constructor & Destructor Documentation

wGui::CCheckBox::CCheckBox ( const CRect WindowRect,
CWindow pParent 
)

Constructs a new checkbox

Parameters:
WindowRect A CRect that defines the outer limits of the control
pParent A pointer to the parent window

Definition at line 33 of file wg_checkbox.cpp.

References wGui::COLOR_WHITE, wGui::CMessage::CTRL_SINGLELCLICK, Draw(), wGui::CMessageServer::Instance(), wGui::CWindow::m_BackgroundColor, wGui::CMessage::MOUSE_BUTTONUP, and wGui::CMessageServer::RegisterMessageClient().


Member Function Documentation

EState wGui::CCheckBox::GetCheckBoxState ( void   )  const [inline]

Gets the current state of the checkbox

Returns:
The current checkbox state

Definition at line 61 of file wg_checkbox.h.

References m_eCheckBoxState.

void wGui::CCheckBox::SetCheckBoxState ( EState  eState  ) 

Set the checkbox state

Parameters:
eState The checkbox state

Definition at line 51 of file wg_checkbox.cpp.

References Draw(), and m_eCheckBoxState.

Referenced by HandleMessage().

bool wGui::CCheckBox::OnMouseButtonDown ( CPoint  Point,
unsigned int  Button 
) [virtual]

This is called whenever the checkbox is clicked on by the mouse Only the topmost window that bounds the point will be called by the system

Parameters:
Point The point where the mouse clicked
Button A bitfield indicating which button the window was clicked with
Returns:
True if it's in the bounds of the checkbox

Reimplemented from wGui::CWindow.

Definition at line 87 of file wg_checkbox.cpp.

References DISABLED, wGui::CRect::HitTest(), wGui::CWindow::m_bVisible, wGui::CWindow::m_ClientRect, m_eCheckBoxState, m_MouseButton, wGui::CWindow::OnMouseButtonDown(), wGui::CRect::RELPOS_INSIDE, and wGui::CWindow::ViewToWindow().

bool wGui::CCheckBox::OnMouseButtonUp ( CPoint  Point,
unsigned int  Button 
) [virtual]

This is called whenever the a mouse button is released in the checkbox Only the topmost window that bounds the point will be called by the system

Parameters:
Point The point where the mouse clicked
Button A bitfield indicating which button the window was clicked with
Returns:
True if it's in the bounds of the checkbox

Reimplemented from wGui::CWindow.

Definition at line 102 of file wg_checkbox.cpp.

References wGui::CMessage::CTRL_SINGLELCLICK, wGui::CMessage::CTRL_SINGLEMCLICK, wGui::CMessage::CTRL_SINGLERCLICK, DISABLED, wGui::CRect::HitTest(), wGui::CMessageServer::Instance(), wGui::CMouseMessage::LEFT, wGui::CWindow::m_bVisible, wGui::CWindow::m_ClientRect, m_eCheckBoxState, m_MouseButton, wGui::CMouseMessage::MIDDLE, wGui::CWindow::OnMouseButtonUp(), wGui::CMessageServer::QueueMessage(), wGui::CRect::RELPOS_INSIDE, wGui::CMouseMessage::RIGHT, wGui::CMessage::UNKNOWN, and wGui::CWindow::ViewToWindow().

bool wGui::CCheckBox::HandleMessage ( CMessage pMessage  )  [virtual]

CCheckBoxes handle MOUSE_BUTTONDOWN, MOUSE_BUTTONUP, and it's own CTRL_SINGLELCLICK messages

Parameters:
pMessage A pointer to the message

Reimplemented from wGui::CWindow.

Definition at line 130 of file wg_checkbox.cpp.

References CHECKED, wGui::CMessage::CTRL_SINGLELCLICK, wGui::CMessage::CTRL_VALUECHANGE, wGui::CMessage::Destination(), wGui::CWindow::HandleMessage(), wGui::CRect::HitTest(), wGui::CMessageServer::Instance(), wGui::CWindow::m_ClientRect, m_eCheckBoxState, m_MouseButton, wGui::CWindow::m_pParentWindow, wGui::CMessage::MessageType(), wGui::CMessage::MOUSE_BUTTONUP, wGui::CMessageServer::QueueMessage(), wGui::CRect::RELPOS_INSIDE, SetCheckBoxState(), UNCHECKED, and wGui::CWindow::ViewToWindow().


The documentation for this class was generated from the following files:
Generated on Wed May 16 23:11:27 2007 for wGui by  doxygen 1.5.1