26#ifndef TGUI_CHECK_BOX_HPP
27#define TGUI_CHECK_BOX_HPP
30#include <TGUI/Renderers/CheckBoxRenderer.hpp>
31#include <TGUI/Widgets/RadioButton.hpp>
35TGUI_MODULE_EXPORT
namespace tgui
44 using Ptr = std::shared_ptr<CheckBox>;
45 using ConstPtr = std::shared_ptr<const CheckBox>;
47 static constexpr const char StaticWidgetType[] =
"CheckBox";
57 CheckBox(
const char* typeName = StaticWidgetType,
bool initRenderer =
true);
133 void leftMouseReleased(
Vector2f pos)
override;
177 void updateTextureSizes()
override;
189 Texture m_textureUncheckedCached;
190 Texture m_textureCheckedCached;
Base class for render targets.
Definition BackendRenderTarget.hpp:48
Definition CheckBoxRenderer.hpp:37
CheckBox widget.
Definition CheckBox.hpp:41
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:45
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:44
Wrapper class to store strings.
Definition String.hpp:101
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:39
KeyPressed event parameters.
Definition Event.hpp:169
States used for drawing.
Definition RenderStates.hpp:39