#include <wg_radiobutton.h>
Inheritance diagram for wGui::CRadioButton:
Radiobuttons should share a common parent (preferably a CGroupBox :-)) so they work as expected (only one can be checked at a time) The radiobutton 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 radiobutton is toggled (todo adopt for radiobutton) Radiobuttons do not display their own labels
Definition at line 42 of file wg_radiobutton.h.
The radiobutton state(s).
UNCHECKED | The radiobutton is unchecked. |
CHECKED | The radiobutton is checked. |
DISABLED | The radiobutton is disabled. |
Definition at line 54 of file wg_radiobutton.h.
WindowRect | A CRect that defines the outer limits of the control | |
pParent | A pointer to the parent window |
Definition at line 35 of file wg_radiobutton.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::CRadioButton::GetState | ( | void | ) | const [inline] |
Gets the current state of the radiobutton
Definition at line 62 of file wg_radiobutton.h.
References m_eRadioButtonState.
void wGui::CRadioButton::SetState | ( | EState | eState | ) |
Set the radiobutton state
eState | The radiobutton state |
Definition at line 47 of file wg_radiobutton.cpp.
References Draw(), and m_eRadioButtonState.
Referenced by HandleMessage().
bool wGui::CRadioButton::OnMouseButtonDown | ( | CPoint | Point, | |
unsigned int | Button | |||
) | [virtual] |
This is called whenever the radiobutton 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 81 of file wg_radiobutton.cpp.
References DISABLED, wGui::CRect::HitTest(), wGui::CWindow::m_bVisible, wGui::CWindow::m_ClientRect, m_eRadioButtonState, m_MouseButton, wGui::CWindow::OnMouseButtonDown(), wGui::CRect::RELPOS_INSIDE, and wGui::CWindow::ViewToWindow().
bool wGui::CRadioButton::OnMouseButtonUp | ( | CPoint | Point, | |
unsigned int | Button | |||
) | [virtual] |
This is called whenever the a mouse button is released in the radiobutton 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 95 of file wg_radiobutton.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_eRadioButtonState, 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::CRadioButton::HandleMessage | ( | CMessage * | pMessage | ) | [virtual] |
CRadioButtons 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 121 of file wg_radiobutton.cpp.
References CHECKED, wGui::CMessage::CTRL_SINGLELCLICK, wGui::CMessage::CTRL_VALUECHANGE, wGui::CMessage::Destination(), wGui::CWindow::GetChildWindows(), wGui::CWindow::HandleMessage(), wGui::CRect::HitTest(), wGui::CMessageServer::Instance(), wGui::CWindow::m_ClientRect, m_eRadioButtonState, m_MouseButton, wGui::CWindow::m_pParentWindow, wGui::CMessage::MessageType(), wGui::CMessage::MOUSE_BUTTONUP, wGui::CMessageServer::QueueMessage(), wGui::CRect::RELPOS_INSIDE, SetState(), UNCHECKED, and wGui::CWindow::ViewToWindow().