Unigine::WidgetScrollBox Class
Header: | #include <UnigineWidgets.h> |
Inherits: | Widget |
This class creates a scroll box.
WidgetScrollBox Class
Members
static WidgetScrollBoxPtr create(const Ptr<Gui> & gui, int x = 0, int y = 0)
Constructor. Creates a box with scrolling based on given parameters.Arguments
- const Ptr<Gui> & gui - GUI, to which the new box will belong.
- int x - Horizontal space between the widgets in the box and between them and the box border. This is an optional parameter.
- int y - Vertical space between the widgets in the box and between them and the box border. This is an optional parameter.
Ptr<WidgetScrollBox> cast(const Ptr<Widget> & widget)
Casts a WidgetScrollBox out of the Widget instance.Arguments
- const Ptr<Widget> & widget - Pointer to Widget.
Return value
Pointer to WidgetScrollBox.void setBorder(int border)
Sets a flag indicating if a one-pixel border is rendered around the widget content (in a shape of a box). The default is 1 (use a border).Arguments
- int border - Positive number to enable a border, 0 to disable it.
int getBorder()
Returns a flag indicating if a one-pixel border is rendered around the widget content (in a shape of a box). The default is 1 (use a border).Return value
Positive number if a border is enabled; otherwise, 0.void setHScrollEnabled(int enabled)
Sets a value indicating if horizontal scrolling is enabled.Arguments
- int enabled - Positive number to enable horizontal scrolling, 0 to disable it.
int isHScrollEnabled()
Returns a value indicating if horizontal scrolling is enabled.Return value
Positive number if scrolling is enabled; otherwise, 0.int getHScrollFrameSize()
Returns the width of the currently visible area.Return value
Width of the visible area in pixels.void setHScrollHidden(int hidden)
Sets a flag indicating if a horizontal scroll bar is hidden, disabled or always rendered.Arguments
- int hidden - Hide mode:
- 0 to always render a scroll bar.
- 1 to automatically hide a scroll bar, if necessary. If the container area is big enough to show all elements, the scroll bar is not rendered. And vice versa, if not all elements can be shown at once, a scroll bar is rendered.
- 2 to always hide a scroll bar. In this mode, scroll bar bounds, though a bar itself is not rendered, are still taken into account when the widget bounds are calculated.
- 3 to always hide a scroll bar and not to add scroll bar size when calculating widget bounds.
int isHScrollHidden()
Returns a flag indicating if a horizontal scroll bar is hidden, disabled or always rendered.Return value
Hide flag:- 0 if a scroll bar is always rendered.
- 1 if a scroll bar is automatically hidden when necessary. For example, if the container area is big enough to show all elements, the scroll bar is not rendered. And vice versa, if not all elements can be shown at once, a scroll bar is rendered.
- 2 if a scroll bar is always hidden. In this mode, scroll bar bounds, though a bar itself is not rendered, are still taken into account when the widget bounds are calculated.
- 3 if a scroll bar is always hidden and its size is not added to widget bounds.
int getHScrollObjectSize()
Returns the width of the whole object that should be scrolled.Return value
Width of the object being scrolled in pixels.int getHScrollStepSize()
Returns the step of the horizontal scroller. This step is used to increment the scroll position.Return value
Step of the horizontal scroller in pixels.void setHScrollValue(int value)
Sets a position (and also the size) of the horizontal scroller. That is, it sets the width of the currently invisible area that determines the size of the slider.Arguments
- int value - Position of the scroller. The minimum value is 0, the maximum value is the difference between the object width and the frame width.
int getHScrollValue()
Returns the current position (and also automatically the size) of the horizontal scroller. That is, it returns the width of the currently invisible area that determines the size of the slider.Return value
Position of the horizontal scroller.void setPadding(int l, int r, int t, int b)
Sets widget paddings for all sides. Padding clears an area around the content of a widget (inside of it).Arguments
- int l - Left-side padding in pixels.
- int r - Right-side padding in pixels.
- int t - Top padding in pixels.
- int b - Bottom padding in pixels.
int getPaddingBottom()
Returns the current bottom padding for the widget content.Return value
Bottom padding in pixels.int getPaddingLeft()
Returns the current left-side padding for the widget content.Return value
Left-side padding in pixels.int getPaddingRight()
Returns the current right-side padding for the widget content.Return value
Right-side padding in pixels.int getPaddingTop()
Returns the current top padding for the widget content.Return value
Top padding in pixels.int getScrollScale()
Returns the divisor used to convert integer values into floating point values.Return value
Divisor used to scale integers.void setSpace(int x, int y)
Sets a space between the widgets in the box and between them and the box border.Arguments
- int x - Horizontal space. If a negative value is specified, 0 will be used instead.
- int y - Vertical space. If a negative value is specified, 0 will be used instead.
int getSpaceX()
Returns the horizontal space between the widgets in the box and between them and the box border.Return value
Horizontal space.int getSpaceY()
Returns the vertical space between the widgets in the box and between them and the box border.Return value
Vertical space.void setVScrollEnabled(int enabled)
Sets a value indicating if vertical scrolling is enabled.Arguments
- int enabled - Positive number to enable vertical scrolling, 0 to disable it.
int isVScrollEnabled()
Returns a value indicating if vertical scrolling is enabled.Return value
Positive number if scrolling is enabled; otherwise, 0.int getVScrollFrameSize()
Returns the height of the currently visible area.Return value
Height of the visible area in pixels.void setVScrollHidden(int hidden)
Sets a flag indicating if a vertical scroll bar is hidden, disabled or always rendered.Arguments
- int hidden - Hide mode:
- 0 to always render a scroll bar.
- 1 to automatically hide a scroll bar, if necessary. If the container area is big enough to show all elements, the scroll bar is not rendered. And vice versa, if not all elements can be shown at once, a scroll bar is rendered.
- 2 to always hide a scroll bar. In this mode, scroll bar bounds, though a bar itself is not rendered, are still taken into account when the widget bounds are calculated.
- 3 to always hide a scroll bar and not to add scroll bar size when calculating widget bounds.
int isVScrollHidden()
Returns a flag indicating if a vertical scroll bar is hidden, disabled or always rendered.Return value
Hide flag:- 0 if a scroll bar is always rendered.
- 1 if a scroll bar is automatically hidden when necessary. For example, if the container area is big enough to show all elements, the scroll bar is not rendered. And vice versa, if not all elements can be shown at once, a scroll bar is rendered.
- 2 if a scroll bar is always hidden. In this mode, scroll bar bounds, though a bar itself is not rendered, are still taken into account when the widget bounds are calculated.
- 3 if a scroll bar is always hidden and its size is not added to widget bounds.
int getVScrollObjectSize()
Returns the height of the whole object that should be scrolled.Return value
Height of the object being scrolled in pixels.int getVScrollStepSize()
Returns the step of the vertical scroller. This step is used to increment the scroll position.Return value
Step of the vertical scroller in pixels.void setVScrollValue(int value)
Sets the position (and also the size) of the vertical scroller. That is, it sets the height of the currently invisible area that determines the size of the slider.Arguments
- int value - Position of the scroller. The minimum value is 0, the maximum value is the difference between the object height and the frame height.
int getVScrollValue()
Returns the current position (and also the size) of the vertical scroller. That is, it returns the height of the currently invisible area that determines the size of the slider.Return value
Position of the vertical scroller.int type()
WidgetScrollBox type.Return value
WidgetScrollBox type identifier.Last update: 2017-12-21
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)