25#ifndef TGUI_RADIO_BUTTON_HPP
26#define TGUI_RADIO_BUTTON_HPP
28#include <TGUI/Renderers/RadioButtonRenderer.hpp>
29#include <TGUI/Text.hpp>
30#include <TGUI/Widgets/ClickableWidget.hpp>
39 class TGUI_API RadioButton :
public ClickableWidget
42 using Ptr = std::shared_ptr<RadioButton>;
43 using ConstPtr = std::shared_ptr<const RadioButton>;
54 explicit RadioButton(
const char* typeName =
StaticWidgetType,
bool initRenderer =
true);
199 void leftMouseReleased(Vector2f pos)
override;
249 [[nodiscard]] std::unique_ptr<DataIO::Node>
save(SavingRenderersMap& renderers)
const override;
254 void load(
const std::unique_ptr<DataIO::Node>& node,
const LoadingRenderersMap& renderers)
override;
274 [[nodiscard]] Vector2f getInnerSize()
const;
279 [[nodiscard]]
const Color& getCurrentCheckColor()
const;
284 [[nodiscard]]
const Color& getCurrentBackgroundColor()
const;
289 [[nodiscard]]
const Color& getCurrentBorderColor()
const;
294 virtual void updateTextureSizes();
299 void updateTextColor();
317 bool m_checked =
false;
320 bool m_allowTextClick =
true;
326 float m_maxWidth = 0;
330 Sprite m_spriteUncheckedHover;
331 Sprite m_spriteCheckedHover;
332 Sprite m_spriteUncheckedDisabled;
333 Sprite m_spriteCheckedDisabled;
334 Sprite m_spriteUncheckedFocused;
335 Sprite m_spriteCheckedFocused;
338 Borders m_bordersCached;
341 Color m_checkColorCached;
342 Color m_checkColorHoverCached;
343 Color m_checkColorDisabledCached;
344 Color m_borderColorCached;
345 Color m_borderColorHoverCached;
346 Color m_borderColorDisabledCached;
347 Color m_borderColorFocusedCached;
348 Color m_borderColorCheckedCached;
349 Color m_borderColorCheckedHoverCached;
350 Color m_borderColorCheckedDisabledCached;
351 Color m_borderColorCheckedFocusedCached;
352 Color m_backgroundColorCached;
353 Color m_backgroundColorHoverCached;
354 Color m_backgroundColorDisabledCached;
355 Color m_backgroundColorCheckedCached;
356 Color m_backgroundColorCheckedHoverCached;
357 Color m_backgroundColorCheckedDisabledCached;
358 float m_textDistanceRatioCached = 0.2f;
Base class for render targets.
Definition BackendRenderTarget.hpp:46
Wrapper for colors.
Definition Color.hpp:63
Class to store the position or size of a widget.
Definition Layout.hpp:320
Signal to which the user can subscribe to get callbacks from.
Definition Signal.hpp:59
Wrapper class to store strings.
Definition String.hpp:94
Wrapper for text styles.
Definition TextStyle.hpp:55
Backend-independent wrapper around the backend-specific text class.
Definition Text.hpp:53
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:37
SignalTyped< bool > SignalBool
Signal with one "bool" as optional unbound parameter.
Definition Signal.hpp:410
KeyPressed event parameters.
Definition Event.hpp:166
States used for drawing.
Definition RenderStates.hpp:38