25#ifndef TGUI_SCROLLBAR_HPP
26#define TGUI_SCROLLBAR_HPP
28#include <TGUI/Widget.hpp>
29#include <TGUI/Renderers/ScrollbarRenderer.hpp>
31#if !TGUI_EXPERIMENTAL_USE_STD_MODULE
37TGUI_MODULE_EXPORT
namespace tgui
46 using Ptr = std::shared_ptr<Scrollbar>;
47 using ConstPtr = std::shared_ptr<const Scrollbar>;
49 static constexpr const char StaticWidgetType[] =
"Scrollbar";
66 Scrollbar(
const char* typeName = StaticWidgetType,
bool initRenderer =
true);
106 using Widget::setSize;
205#ifndef TGUI_REMOVE_DEPRECATED_CODE
212 TGUI_DEPRECATED(
"Use setOrientation instead") void setVerticalScroll(
bool vertical);
218 TGUI_DEPRECATED("Use getOrientation instead") TGUI_NODISCARD
bool getVerticalScroll() const;
261 void leftMouseReleased(
Vector2f pos)
override;
266 void mouseMoved(
Vector2f pos)
override;
276 void leftMouseButtonNoLongerDown()
override;
315 TGUI_NODISCARD std::unique_ptr<DataIO::Node>
save(SavingRenderersMap& renderers)
const override;
320 void load(
const std::unique_ptr<DataIO::Node>& node,
const LoadingRenderersMap& renderers)
override;
325 void updateThumbPosition();
349 Part m_mouseHoverOverPart = Part::Thumb;
352 bool m_mouseDownOnThumb =
false;
353 Vector2f m_mouseDownOnThumbPos;
355 unsigned int m_maximum = 10;
356 unsigned int m_value = 0;
359 unsigned int m_viewportSize = 1;
361 Orientation m_orientation = Orientation::Vertical;
362 Orientation m_imageOrientation = Orientation::Vertical;
365 unsigned int m_scrollAmount = 1;
368 bool m_autoHide =
true;
371 bool m_mouseDownOnArrow =
false;
373 bool m_sizeSet =
false;
375 std::chrono::steady_clock::time_point m_lastSuccessfulScrollTime;
376 Vector2f m_lastSuccessfulScrollPos;
381 FloatRect m_arrowDown;
383 Sprite m_spriteTrack;
384 Sprite m_spriteTrackHover;
385 Sprite m_spriteThumb;
386 Sprite m_spriteThumbHover;
387 Sprite m_spriteArrowUp;
388 Sprite m_spriteArrowUpHover;
389 Sprite m_spriteArrowDown;
390 Sprite m_spriteArrowDownHover;
393 Color m_thumbColorCached;
394 Color m_thumbColorHoverCached;
395 Color m_trackColorCached;
396 Color m_trackColorHoverCached;
397 Color m_arrowColorCached;
398 Color m_arrowColorHoverCached;
399 Color m_arrowBackgroundColorCached;
400 Color m_arrowBackgroundColorHoverCached;
Base class for render targets.
Definition BackendRenderTarget.hpp:46
Class to store the position or size of a widget.
Definition Layout.hpp:313
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:51
States used for drawing.
Definition RenderStates.hpp:38