Class returned by widgets that have a scrollbar to let the user access scrollbar properties.
More...
#include <TGUI/Widgets/Scrollbar.hpp>
|
| ScrollbarAccessor (ScrollbarChildWidget &scrollbar, std::function< void()> valueChangedCallback, std::function< void()> policyChangedCallback, std::function< void()> scrollAmountChangedCallback) |
| Constructor.
|
|
void | setValue (unsigned int value) |
| Changes the current value of the scrollbar.
|
|
TGUI_NODISCARD unsigned int | getValue () const |
| Returns the current value of the scrollbar.
|
|
void | setScrollAmount (unsigned int scrollAmount) |
| Changes how much the value changes when scrolling or pressing one of the arrows of the scrollbar.
|
|
TGUI_NODISCARD unsigned int | getScrollAmount () const |
| Returns how much the value changes when scrolling or pressing one of the arrows of the scrollbar.
|
|
void | setPolicy (Scrollbar::Policy policy) |
| Changes when the scrollbar should be displayed.
|
|
TGUI_NODISCARD Scrollbar::Policy | getPolicy () const |
| Returns when the scrollbar should be displayed.
|
|
TGUI_NODISCARD unsigned int | getMaximum () const |
| Returns the current maximum of the scrollbar.
|
|
TGUI_NODISCARD unsigned int | getViewportSize () const |
| Returns the current viewport size of the scrollbar.
|
|
TGUI_NODISCARD unsigned int | getMaxValue () const |
| Returns the current maximum value of the scrollbar.
|
|
TGUI_NODISCARD bool | isShown () const |
| Returns whether the scrollbar is currently visible.
|
|
TGUI_NODISCARD float | getWidth () const |
| Returns the width of the scrollbar.
|
|
Class returned by widgets that have a scrollbar to let the user access scrollbar properties.
- Since
- TGUI 1.5
◆ ScrollbarAccessor()
tgui::ScrollbarAccessor::ScrollbarAccessor |
( |
ScrollbarChildWidget & | scrollbar, |
|
|
std::function< void()> | valueChangedCallback, |
|
|
std::function< void()> | policyChangedCallback, |
|
|
std::function< void()> | scrollAmountChangedCallback ) |
Constructor.
- Parameters
-
scrollbar | The scrollbar to which this class provides access |
valueChangedCallback | Function to be called when setValue is called on this class |
policyChangedCallback | Function to be called when setPolicy is called on this class |
scrollAmountChangedCallback | Function to be called when setScrollAmount is called on this class |
◆ getMaximum()
TGUI_NODISCARD unsigned int tgui::ScrollbarAccessor::getMaximum |
( |
| ) |
const |
◆ getMaxValue()
TGUI_NODISCARD unsigned int tgui::ScrollbarAccessor::getMaxValue |
( |
| ) |
const |
Returns the current maximum value of the scrollbar.
- Returns
- The current maximum value
- See also
- Scrollbar::getMaxValue
◆ getPolicy()
Returns when the scrollbar should be displayed.
- Returns
- The policy for displaying the scrollbar
◆ getScrollAmount()
TGUI_NODISCARD unsigned int tgui::ScrollbarAccessor::getScrollAmount |
( |
| ) |
const |
Returns how much the value changes when scrolling or pressing one of the arrows of the scrollbar.
- Returns
- How far should the scrollbar scroll when an arrow is clicked?
◆ getValue()
TGUI_NODISCARD unsigned int tgui::ScrollbarAccessor::getValue |
( |
| ) |
const |
Returns the current value of the scrollbar.
- Returns
- The current value
- See also
- Scrollbar::getValue
◆ getViewportSize()
TGUI_NODISCARD unsigned int tgui::ScrollbarAccessor::getViewportSize |
( |
| ) |
const |
◆ getWidth()
TGUI_NODISCARD float tgui::ScrollbarAccessor::getWidth |
( |
| ) |
const |
Returns the width of the scrollbar.
- Returns
- Scrollbar width. This is size.x for a vertical scrollbar, but size.y for a horizontal scrollbar.
The width of the scrollbar can be changed via the renderer of the widget that contains the scrollbar:
widget->getRenderer()->setScrollbarWidth(width);
◆ isShown()
TGUI_NODISCARD bool tgui::ScrollbarAccessor::isShown |
( |
| ) |
const |
Returns whether the scrollbar is currently visible.
- Returns
- Is the scrollbar visible?
- See also
- Scrollbar::isShown
◆ setPolicy()
Changes when the scrollbar should be displayed.
- Parameters
-
policy | The policy for displaying the scrollbar |
◆ setScrollAmount()
void tgui::ScrollbarAccessor::setScrollAmount |
( |
unsigned int | scrollAmount | ) |
|
Changes how much the value changes when scrolling or pressing one of the arrows of the scrollbar.
- Parameters
-
scrollAmount | How far should the scrollbar scroll when an arrow is clicked? |
- Warning
- Widgets may overwrite this value when e.g. the text size changes
◆ setValue()
void tgui::ScrollbarAccessor::setValue |
( |
unsigned int | value | ) |
|
The documentation for this class was generated from the following file: