26#ifndef TGUI_SCROLLABLE_PANEL_HPP
27#define TGUI_SCROLLABLE_PANEL_HPP
29#include <TGUI/CopiedSharedPtr.hpp>
30#include <TGUI/Widgets/Panel.hpp>
31#include <TGUI/Widgets/Scrollbar.hpp>
32#include <TGUI/Renderers/ScrollablePanelRenderer.hpp>
34#if !TGUI_EXPERIMENTAL_USE_STD_MODULE
40TGUI_MODULE_EXPORT
namespace tgui
49 using Ptr = std::shared_ptr<ScrollablePanel>;
50 using ConstPtr = std::shared_ptr<const ScrollablePanel>;
52 static constexpr const char StaticWidgetType[] =
"ScrollablePanel";
62 ScrollablePanel(
const char* typeName = StaticWidgetType,
bool initRenderer =
true);
133 using Widget::setSize;
338 bool leftMousePressed(
Vector2f pos)
override;
343 void leftMouseReleased(
Vector2f pos)
override;
348 void mouseMoved(
Vector2f pos)
override;
353 bool scrolled(
float delta,
Vector2f pos,
bool touch)
override;
358 void mouseNoLongerOnWidget()
override;
363 void leftMouseButtonNoLongerDown()
override;
399 TGUI_NODISCARD std::unique_ptr<DataIO::Node>
save(SavingRenderersMap& renderers)
const override;
405 void load(
const std::unique_ptr<DataIO::Node>& node,
const LoadingRenderersMap& renderers)
override;
420 void updateScrollbars();
426 void recalculateMostBottomRightPosition();
432 void connectPositionAndSize(
const Widget::Ptr& widget);
438 void disconnectAllChildWidgets();
452 std::chrono::steady_clock::time_point m_lastSuccessfulScrollTime;
455 unsigned int m_verticalScrollAmount = 0;
456 unsigned int m_horizontalScrollAmount = 0;
458 std::unordered_map<Widget::Ptr, unsigned int> m_connectedPositionCallbacks;
459 std::unordered_map<Widget::Ptr, unsigned int> m_connectedSizeCallbacks;
Base class for render targets.
Definition BackendRenderTarget.hpp:48
Definition CopiedSharedPtr.hpp:45
Class to store the position or size of a widget.
Definition Layout.hpp:289
Group of widgets that has a background color and optional borders.
Definition Panel.hpp:41
Wrapper class to store strings.
Definition String.hpp:101
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:39
States used for drawing.
Definition RenderStates.hpp:39