11 #ifndef __YUNI_UI_CONTROL_CHECKBOX_H__ 12 # define __YUNI_UI_CONTROL_CHECKBOX_H__ 14 # include "../../yuni.h" 52 const String& text()
const {
return pText; }
58 if (pChecked == newValue)
75 if (Input::IMouse::ButtonLeft == btn)
82 if (Input::IMouse::ButtonLeft == btn && pBeingClicked)
88 pBeingClicked =
false;
111 #endif // __YUNI_UI_CONTROL_CHECKBOX_H__ Ancestor::SmartPtrType< CheckBox >::Ptr Ptr
Smart pointer.
Definition: checkbox.h:31
float x() const
Get X position.
Definition: control.h:117
void checked(bool newValue)
Modify whether the checkbox is checked.
Definition: checkbox.h:56
A UI control is a part of 2D overlay that reacts to certain events.
Definition: control.h:41
Definition: program.cpp:19
float width() const
Get width.
Definition: control.h:142
A check box is a clickable control that has a boolean state: either checked or unchecked.
Definition: checkbox.h:27
float y() const
Get Y position.
Definition: control.h:119
float height() const
Get height.
Definition: control.h:144
SmartPtrType< IntrusiveSmartPtrType >::Ptr Ptr
Most convenient smartptr for this class.
Definition: intrusive.h:73
const Point2D< float > & size() const
Get size.
Definition: control.h:146
IControl()
Empty constructor.
Definition: control.h:81
Yuni::Bind< void(IControl *sender, bool newValue)> onCheckChanged
Checkbox checked callback.
Definition: checkbox.h:34
const Point2D< float > position() const
Get position.
Definition: control.h:121
Character stringThe class manipulates and stores sequences of characters.
Definition: fwd.h:32
virtual ~CheckBox()
Virtual destructor.
Definition: checkbox.h:50
void invalidate()
Invalidate the control (force redraw)
Definition: control.h:216
bool checked() const
Get whether the checkbox is checked.
Definition: checkbox.h:66
virtual void draw(DrawingSurface::Ptr &surface, float xOffset, float yOffset) const override
Draw the checkbox on the surface.
Definition: checkbox.cpp:22