25#ifndef TGUI_SPIN_BUTTON_HPP
26#define TGUI_SPIN_BUTTON_HPP
28#include <TGUI/Renderers/SpinButtonRenderer.hpp>
29#include <TGUI/Widgets/ClickableWidget.hpp>
30#include <TGUI/Timer.hpp>
34TGUI_MODULE_EXPORT
namespace tgui
39 class TGUI_API SpinButton :
public ClickableWidget
43 using Ptr = std::shared_ptr<SpinButton>;
44 using ConstPtr = std::shared_ptr<const SpinButton>;
55 SpinButton(
const char* typeName =
StaticWidgetType,
bool initRenderer =
true);
209 void leftMouseReleased(Vector2f pos) override;
214 void mouseMoved(Vector2f pos) override;
248 TGUI_NODISCARD std::unique_ptr<DataIO::Node>
save(SavingRenderersMap& renderers) const override;
253 void load(const std::unique_ptr<DataIO::Node>& node, const LoadingRenderersMap& renderers) override;
258 TGUI_NODISCARD Vector2f getArrowSize() const;
271 void callMousePressPeriodically(std::chrono::time_point<std::chrono::steady_clock> clicked);
282 bool m_orientationLocked =
false;
283 std::chrono::time_point<std::chrono::steady_clock> m_PressedAt;
286 float m_maximum = 10;
291 bool m_mouseHoverOnTopArrow =
false;
292 bool m_mouseDownOnTopArrow =
false;
295 Sprite m_spriteArrowUpHover;
297 Sprite m_spriteArrowDownHover;
300 Borders m_bordersCached;
301 Color m_borderColorCached;
302 Color m_backgroundColorCached;
303 Color m_backgroundColorHoverCached;
304 Color m_arrowColorCached;
305 Color m_arrowColorHoverCached;
306 float m_borderBetweenArrowsCached = 0;
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
Signal to which the user can subscribe to get callbacks from.
Definition Signal.hpp:61
Wrapper class to store strings.
Definition String.hpp:96
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:38
Orientation
Orientation of the object.
Definition Layout.hpp:52
@ Vertical
Vertical orientation.
Definition Layout.hpp:53
SignalTyped< float > SignalFloat
Signal with one "float" as optional unbound parameter.
Definition Signal.hpp:426
States used for drawing.
Definition RenderStates.hpp:38