25#ifndef TGUI_CHECK_BOX_HPP
26#define TGUI_CHECK_BOX_HPP
28#include <TGUI/Renderers/CheckBoxRenderer.hpp>
29#include <TGUI/Widgets/RadioButton.hpp>
33TGUI_MODULE_EXPORT
namespace tgui
42 using Ptr = std::shared_ptr<CheckBox>;
43 using ConstPtr = std::shared_ptr<const CheckBox>;
45 static constexpr const char StaticWidgetType[] =
"CheckBox";
54 CheckBox(
const char* typeName = StaticWidgetType,
bool initRenderer =
true);
119 void leftMouseReleased(
Vector2f pos)
override;
158 void updateTextureSizes()
override;
168 Texture m_textureUncheckedCached;
169 Texture m_textureCheckedCached;
Base class for render targets.
Definition BackendRenderTarget.hpp:46
CheckBox widget.
Definition CheckBox.hpp:39
TGUI_NODISCARD Vector2f getFullSize() const override
Returns the full size of the radio button.
std::shared_ptr< const CheckBox > ConstPtr
Shared constant widget pointer.
Definition CheckBox.hpp:43
void setChecked(bool checked) override
Checks or unchecks the check box.
TGUI_NODISCARD CheckBoxRenderer * getRenderer() override
Returns the renderer, which gives access to functions that determine how the widget is displayed.
void rendererChanged(const String &property) override
Function called when one of the properties of the renderer is changed.
void draw(BackendRenderTarget &target, RenderStates states) const override
Draw the widget to a render target.
TGUI_NODISCARD Widget::Ptr clone() const override
Makes a copy of the widget if you don't know its exact type.
bool canHandleKeyPress(const Event::KeyEvent &event) override
Called by the parent of the widget to check if keyPressed would process the event.
static TGUI_NODISCARD CheckBox::Ptr create(const String &text="")
Creates a new check box widget.
static TGUI_NODISCARD CheckBox::Ptr copy(const CheckBox::ConstPtr &checkbox)
Makes a copy of another checkbox.
TGUI_NODISCARD CheckBoxRenderer * getSharedRenderer() override
Returns the renderer, which gives access to functions that determine how the widget is displayed.
TGUI_NODISCARD Vector2f getWidgetOffset() const override
Returns the distance between the position where the widget is drawn and where the widget is placed.
std::shared_ptr< CheckBox > Ptr
Shared widget pointer.
Definition CheckBox.hpp:42
Definition CheckBoxRenderer.hpp:35
Wrapper class to store strings.
Definition String.hpp:96
Texture wrapper that internally reuses resources when multiple Texture objects are loaded from the sa...
Definition Texture.hpp:57
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:38
KeyPressed event parameters.
Definition Event.hpp:168
States used for drawing.
Definition RenderStates.hpp:38