25#ifndef TGUI_SCROLLABLE_PANEL_HPP
26#define TGUI_SCROLLABLE_PANEL_HPP
28#include <TGUI/CopiedSharedPtr.hpp>
29#include <TGUI/Widgets/Panel.hpp>
30#include <TGUI/Widgets/Scrollbar.hpp>
31#include <TGUI/Renderers/ScrollablePanelRenderer.hpp>
33#if !TGUI_EXPERIMENTAL_USE_STD_MODULE
39TGUI_MODULE_EXPORT
namespace tgui
48 using Ptr = std::shared_ptr<ScrollablePanel>;
49 using ConstPtr = std::shared_ptr<const ScrollablePanel>;
51 static constexpr const char StaticWidgetType[] =
"ScrollablePanel";
60 ScrollablePanel(
const char* typeName = StaticWidgetType,
bool initRenderer =
true);
123 using Widget::setSize;
331 void leftMouseReleased(
Vector2f pos)
override;
336 void mouseMoved(
Vector2f pos)
override;
346 void mouseNoLongerOnWidget()
override;
351 void leftMouseButtonNoLongerDown()
override;
382 TGUI_NODISCARD std::unique_ptr<DataIO::Node>
save(SavingRenderersMap& renderers)
const override;
387 void load(
const std::unique_ptr<DataIO::Node>& node,
const LoadingRenderersMap& renderers)
override;
400 void updateScrollbars();
405 void recalculateMostBottomRightPosition();
410 void connectPositionAndSize(
const Widget::Ptr& widget);
415 void disconnectAllChildWidgets();
428 std::chrono::steady_clock::time_point m_lastSuccessfulScrollTime;
431 unsigned int m_verticalScrollAmount = 0;
432 unsigned int m_horizontalScrollAmount = 0;
434 bool m_verticalScrollbarWasVisibleOnSizeUpdate =
false;
435 bool m_horizontalScrollbarWasVisibleOnSizeUpdate =
false;
437 std::unordered_map<Widget::Ptr, unsigned int> m_connectedPositionCallbacks;
438 std::unordered_map<Widget::Ptr, unsigned int> m_connectedSizeCallbacks;
Base class for render targets.
Definition BackendRenderTarget.hpp:46
Definition CopiedSharedPtr.hpp:42
Class to store the position or size of a widget.
Definition Layout.hpp:313
Group of widgets that has a background color and optional borders.
Definition Panel.hpp:39
Wrapper class to store strings.
Definition String.hpp:96
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:38
States used for drawing.
Definition RenderStates.hpp:38