25#ifndef TGUI_SCROLLABLE_PANEL_HPP
26#define TGUI_SCROLLABLE_PANEL_HPP
28#include <TGUI/Widgets/Panel.hpp>
29#include <TGUI/Widgets/Scrollbar.hpp>
30#include <TGUI/Renderers/ScrollablePanelRenderer.hpp>
45 using Ptr = std::shared_ptr<ScrollablePanel>;
46 using ConstPtr = std::shared_ptr<const ScrollablePanel>;
57 ScrollablePanel(
const char* typeName =
StaticWidgetType,
bool initRenderer =
true);
72 ScrollablePanel& operator= (
const ScrollablePanel& other);
77 ScrollablePanel& operator= (ScrollablePanel&& other)
noexcept;
192 TGUI_DEPRECATED(
"Use getVerticalScrollbar()->getWidth() or getHorizontalScrollbar()->getWidth() instead") TGUI_NODISCARD
float getScrollbarWidth() const;
223 TGUI_DEPRECATED(
"Use getVerticalScrollbar()->setScrollAmount(scrollAmount) instead")
void setVerticalScrollAmount(
unsigned int scrollAmount);
230 TGUI_DEPRECATED(
"Use getVerticalScrollbar()->getScrollAmount() instead") TGUI_NODISCARD
unsigned int getVerticalScrollAmount() const;
237 TGUI_DEPRECATED(
"Use getHorizontalScrollbar()->setScrollAmount(scrollAmount) instead")
void setHorizontalScrollAmount(
unsigned int scrollAmount);
244 TGUI_DEPRECATED(
"Use getHorizontalScrollbar()->getScrollAmount() instead") TGUI_NODISCARD
unsigned int getHorizontalScrollAmount() const;
328 void leftMouseReleased(Vector2f pos) override;
333 void rightMousePressed(Vector2f pos) override;
338 void rightMouseReleased(Vector2f pos) override;
343 void mouseMoved(Vector2f pos) override;
348 bool scrolled(
float delta, Vector2f pos,
bool touch) override;
353 void mouseNoLongerOnWidget() override;
358 void leftMouseButtonNoLongerDown() override;
366 TGUI_NODISCARD
Widget::
Ptr askToolTip(Vector2f mousePos) override;
389 TGUI_NODISCARD std::unique_ptr<DataIO::Node>
save(SavingRenderersMap& renderers) const override;
394 void load(const std::unique_ptr<DataIO::Node>& node, const LoadingRenderersMap& renderers) override;
423 void updateScrollbars();
428 void recalculateMostBottomRightPosition();
433 void connectPositionAndSize(const
Widget::
Ptr& widget);
438 void disconnectAllChildWidgets();
443 Vector2f m_contentSize;
444 Vector2f m_mostBottomRightPosition;
446 std::chrono::steady_clock::time_point m_lastSuccessfulScrollTime;
447 Vector2f m_lastSuccessfulScrollPos;
449 unsigned int m_verticalScrollAmount = 0;
450 unsigned int m_horizontalScrollAmount = 0;
452 bool m_verticalScrollbarWasVisibleOnSizeUpdate = false;
453 bool m_horizontalScrollbarWasVisibleOnSizeUpdate = false;
454 bool m_recalculatingSizeDuringUpdateScrollbars = false;
455 bool m_stuckInUpdateScrollbars = false;
457 std::unordered_map<
Widget::
Ptr,
unsigned int> m_connectedPositionCallbacks;
458 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:321
Wrapper class to store strings.
Definition String.hpp:94
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:36
Orientation
Orientation of the object.
Definition Layout.hpp:50
States used for drawing.
Definition RenderStates.hpp:38