25#ifndef TGUI_SCROLLABLE_PANEL_HPP
26#define TGUI_SCROLLABLE_PANEL_HPP
28#include <TGUI/Renderers/ScrollablePanelRenderer.hpp>
29#include <TGUI/Widgets/Panel.hpp>
30#include <TGUI/Widgets/Scrollbar.hpp>
44 using Ptr = std::shared_ptr<ScrollablePanel>;
45 using ConstPtr = std::shared_ptr<const ScrollablePanel>;
56 explicit ScrollablePanel(
const char* typeName =
StaticWidgetType,
bool initRenderer =
true);
71 ScrollablePanel&
operator=(
const ScrollablePanel& other);
76 ScrollablePanel&
operator=(ScrollablePanel&& other)
noexcept;
191 TGUI_DEPRECATED(
"Use getVerticalScrollbar()->getWidth() or getHorizontalScrollbar()->getWidth() instead")
198 TGUI_DEPRECATED(
"Use getVerticalScrollbar()->setPolicy(policy) instead")
205 TGUI_DEPRECATED(
"Use getVerticalScrollbar()->getPolicy() instead")
212 TGUI_DEPRECATED(
"Use getHorizontalScrollbar()->setPolicy(policy) instead")
219 TGUI_DEPRECATED(
"Use getHorizontalScrollbar()->getPolicy() instead")
227 TGUI_DEPRECATED(
"Use getVerticalScrollbar()->setScrollAmount(scrollAmount) instead")
235 TGUI_DEPRECATED(
"Use getVerticalScrollbar()->getScrollAmount() instead")
243 TGUI_DEPRECATED(
"Use getHorizontalScrollbar()->setScrollAmount(scrollAmount) instead")
251 TGUI_DEPRECATED(
"Use getHorizontalScrollbar()->getScrollAmount() instead")
266 TGUI_DEPRECATED(
"Use getVerticalScrollbar()->getValue() instead")
276 TGUI_DEPRECATED(
"Use getVerticalScrollbar()->getMaxValue() instead")
284 TGUI_DEPRECATED(
"Use getHorizontalScrollbar()->setValue(value) instead")
292 TGUI_DEPRECATED(
"Use getHorizontalScrollbar()->getValue() instead")
302 TGUI_DEPRECATED(
"Use getHorizontalScrollbar()->getMaxValue() instead")
341 void leftMouseReleased(Vector2f pos) override;
346 void rightMousePressed(Vector2f pos) override;
351 void rightMouseReleased(Vector2f pos) override;
356 void mouseMoved(Vector2f pos) override;
361 bool scrolled(
float delta, Vector2f pos,
bool touch) override;
366 void mouseNoLongerOnWidget() override;
371 void leftMouseButtonNoLongerDown() override;
379 [[nodiscard]]
Widget::
Ptr askToolTip(Vector2f mousePos) override;
402 [[nodiscard]] std::unique_ptr<DataIO::Node>
save(SavingRenderersMap& renderers) const override;
407 void load(const std::unique_ptr<DataIO::Node>& node, const LoadingRenderersMap& renderers) override;
436 void updateScrollbars();
441 void recalculateMostBottomRightPosition();
446 void connectPositionAndSize(const
Widget::
Ptr& widget);
451 void disconnectAllChildWidgets();
456 Vector2f m_contentSize;
457 Vector2f m_mostBottomRightPosition;
459 std::chrono::steady_clock::time_point m_lastSuccessfulScrollTime;
460 Vector2f m_lastSuccessfulScrollPos;
462 unsigned int m_verticalScrollAmount = 0;
463 unsigned int m_horizontalScrollAmount = 0;
465 bool m_verticalScrollbarWasVisibleOnSizeUpdate = false;
466 bool m_horizontalScrollbarWasVisibleOnSizeUpdate = false;
467 bool m_recalculatingSizeDuringUpdateScrollbars = false;
468 bool m_stuckInUpdateScrollbars = false;
470 std::unordered_map<
Widget::
Ptr,
unsigned int> m_connectedPositionCallbacks;
471 std::unordered_map<
Widget::
Ptr,
unsigned int> m_connectedSizeCallbacks;
Base class for render targets.
Definition BackendRenderTarget.hpp:46
Class to store the position or size of a widget.
Definition Layout.hpp:320
Wrapper class to store strings.
Definition String.hpp:94
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:37
Orientation
Orientation of the object.
Definition Layout.hpp:50
States used for drawing.
Definition RenderStates.hpp:38