#include <wg_checkbox.h>
Inheritance diagram for wGui::CCheckBox:
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.
The checkbox state.
UNCHECKED | The checkbox is unchecked. |
CHECKED | The checkbox is checked. |
DISABLED | The checkbox is disabled. |
Definition at line 53 of file wg_checkbox.h.
Constructs a new checkbox
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().
EState wGui::CCheckBox::GetCheckBoxState | ( | void | ) | const [inline] |
Gets the current state of the checkbox
Definition at line 61 of file wg_checkbox.h.
References m_eCheckBoxState.
void wGui::CCheckBox::SetCheckBoxState | ( | EState | eState | ) |
Set the checkbox state
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
Point | The point where the mouse clicked | |
Button | A bitfield indicating which button the window was clicked with |
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
Point | The point where the mouse clicked | |
Button | A bitfield indicating which button the window was clicked with |
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
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().