26#ifndef TGUI_CHECK_BOX_HPP
27#define TGUI_CHECK_BOX_HPP
30#include <TGUI/Renderers/CheckBoxRenderer.hpp>
31#include <TGUI/Widgets/RadioButton.hpp>
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;
166 void updateTextureSizes()
override;
178 Texture m_textureUncheckedCached;
179 Texture m_textureCheckedCached;
Base class for render targets.
Definition: BackendRenderTarget.hpp:48
Definition: CheckBoxRenderer.hpp:37
CheckBox widget.
Definition: CheckBox.hpp:41
static CheckBox::Ptr copy(const CheckBox::ConstPtr &checkbox)
Makes a copy of another checkbox.
std::shared_ptr< const CheckBox > ConstPtr
Shared constant widget pointer.
Definition: CheckBox.hpp:45
Vector2f getWidgetOffset() const override
Returns the distance between the position where the widget is drawn and where the widget is placed.
void setChecked(bool checked) override
Checks or unchecks the check box.
void rendererChanged(const String &property) override
Function called when one of the properties of the renderer is changed.
CheckBoxRenderer * getRenderer()
Returns the renderer, which gives access to functions that determine how the widget is displayed.
void draw(BackendRenderTarget &target, RenderStates states) const override
Draw the widget to a render target.
Vector2f getFullSize() const override
Returns the full size of the radio button.
CheckBoxRenderer * getSharedRenderer()
Returns the renderer, which gives access to functions that determine how the widget is displayed.
Widget::Ptr clone() const override
Makes a copy of the widget if you don't know its exact type.
std::shared_ptr< CheckBox > Ptr
Shared widget pointer.
Definition: CheckBox.hpp:44
static CheckBox::Ptr create(const String &text="")
Creates a new check box widget.
Wrapper class to store strings.
Definition: String.hpp:79
Definition: Texture.hpp:52
Namespace that contains all TGUI functions and classes.
Definition: AbsoluteOrRelativeValue.hpp:36
KeyPressed event parameters.
Definition: Event.hpp:167
States used for drawing.
Definition: RenderStates.hpp:39