25#ifndef TGUI_RADIO_BUTTON_HPP
26#define TGUI_RADIO_BUTTON_HPP
28#include <TGUI/Renderers/RadioButtonRenderer.hpp>
29#include <TGUI/Widgets/ClickableWidget.hpp>
30#include <TGUI/Text.hpp>
34TGUI_MODULE_EXPORT
namespace tgui
43 using Ptr = std::shared_ptr<RadioButton>;
44 using ConstPtr = std::shared_ptr<const RadioButton>;
46 static constexpr const char StaticWidgetType[] =
"RadioButton";
55 RadioButton(
const char* typeName = StaticWidgetType,
bool initRenderer =
true);
93 using Widget::setSize;
177 void leftMouseReleased(
Vector2f pos)
override;
227 TGUI_NODISCARD std::unique_ptr<DataIO::Node>
save(SavingRenderersMap& renderers)
const override;
232 void load(
const std::unique_ptr<DataIO::Node>& node,
const LoadingRenderersMap& renderers)
override;
252 TGUI_NODISCARD
Vector2f getInnerSize()
const;
257 TGUI_NODISCARD
const Color& getCurrentCheckColor()
const;
262 TGUI_NODISCARD
const Color& getCurrentBackgroundColor()
const;
267 TGUI_NODISCARD
const Color& getCurrentBorderColor()
const;
272 virtual void updateTextureSizes();
277 void updateTextColor();
295 bool m_checked =
false;
298 bool m_allowTextClick =
true;
305 Sprite m_spriteUncheckedHover;
306 Sprite m_spriteCheckedHover;
307 Sprite m_spriteUncheckedDisabled;
308 Sprite m_spriteCheckedDisabled;
309 Sprite m_spriteUncheckedFocused;
310 Sprite m_spriteCheckedFocused;
316 Color m_checkColorCached;
317 Color m_checkColorHoverCached;
318 Color m_checkColorDisabledCached;
319 Color m_borderColorCached;
320 Color m_borderColorHoverCached;
321 Color m_borderColorDisabledCached;
322 Color m_borderColorFocusedCached;
323 Color m_borderColorCheckedCached;
324 Color m_borderColorCheckedHoverCached;
325 Color m_borderColorCheckedDisabledCached;
326 Color m_borderColorCheckedFocusedCached;
327 Color m_backgroundColorCached;
328 Color m_backgroundColorHoverCached;
329 Color m_backgroundColorDisabledCached;
330 Color m_backgroundColorCheckedCached;
331 Color m_backgroundColorCheckedHoverCached;
332 Color m_backgroundColorCheckedDisabledCached;
333 float m_textDistanceRatioCached = 0.2f;
Base class for render targets.
Definition BackendRenderTarget.hpp:46
Wrapper for colors.
Definition Color.hpp:73
Class to store the position or size of a widget.
Definition Layout.hpp:323
Definition Outline.hpp:38
Signal to which the user can subscribe to get callbacks from.
Definition Signal.hpp:61
Wrapper class to store strings.
Definition String.hpp:96
Wrapper for text styles.
Definition TextStyle.hpp:55
Backend-independent wrapper around the backend-specific text class.
Definition Text.hpp:48
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