This page has been translated automatically.
Getting Started
Migrating to UNIGINE 2.0
C++ API Migration
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::WidgetScrollBox Class

Interface for widget scrollbox handling. See also UnigineScript analog.

To use this class, include the UnigineWidgetScrollBox.h file.

Unigine::WidgetScrollBox Class

Members


static int type ()

WidgetScrollBox type.

Return value

WidgetScrollBox type identifier.

static Ptr< WidgetScrollBox > create (const WidgetPtr & widget)

WidgetScrollBox constructor.

Arguments

  • const WidgetPtr & widget - Widget smart pointer.

static Ptr< WidgetScrollBox > create (const Ptr< Gui > & gui, int x, int y)

WidgetScrollBox constructor.

Arguments

  • const Ptr< Gui > & gui - Gui pointer.
  • int x - Horizontal space between widgets in the box and between them and the box border. This is an optional parameter.
  • int y - Vertical space between widgets in the box and between them and the box border. This is an optional parameter.

virtual void setSpace (int x, int y) const =0

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.

virtual int getSpaceX () const =0

Returns the horizontal space between the widgets in the box and between them and the box border.

Return value

Horizontal space.

virtual int getSpaceY () const =0

Returns the vertical space between the widgets in the box and between them and the box border.

Return value

Vertical space.

virtual void setPadding (int l, int r, int t, int b) const =0

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.

virtual int getPaddingLeft () const =0

Returns the current left-side padding for the widget content.

Return value

Left-side padding in pixels.

virtual int getPaddingRight () const =0

Returns the current right-side padding for the widget content.

Return value

Right-side padding in pixels.

virtual int getPaddingTop () const =0

Returns the current top padding for the widget content.

Return value

Top padding in pixels.

virtual int getPaddingBottom () const =0

Returns the current bottom padding for the widget content.

Return value

Bottom padding in pixels.

virtual void setBorder (int border) const =0

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.

virtual int getBorder () const =0

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.

virtual int getScrollScale () const =0

Returns the divisor used to convert integer values into floating point values.

Return value

Divisor used to scale integers.

virtual void setVScrollEnabled (int enable) const =0

Sets a value indicating if vertical scrolling is enabled.

Arguments

  • int enable - Positive number to enable vertical scrolling, 0 to disable it.

virtual int isVScrollEnabled () const =0

Returns a value indicating if vertical scrolling is enabled.

Return value

Positive number if scrolling is enabled; otherwise, 0.

virtual void setVScrollHidden (int hide) const =0

Sets a flag indicating if a vertical scroll bar is hidden, disabled or always rendered.

Arguments

  • int hide - 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.

virtual int isVScrollHidden () const =0

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.

virtual int getVScrollObjectSize () const =0

Returns the height of the whole object that should be scrolled.

Return value

Height of the object being scrolled in pixels.

virtual int getVScrollFrameSize () const =0

Returns the height of the currently visible area.

Return value

Height of the visible area in pixels.

virtual int getVScrollStepSize () const =0

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.

virtual void setVScrollValue (int value) const =0

Sets the position (and also the size) of the vertical 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 height and the frame height.

virtual int getVScrollValue () const =0

Returns the current position (and also the size) of the vertical scroller. That is, it returns the width of the currently invisible area that determines the size of the slider.

Return value

Position of the vertical scroller.

virtual void setHScrollEnabled (int enable) const =0

Sets a value indicating if horizontal scrolling is enabled.

Arguments

  • int enable - Positive number to enable horizontal scrolling, 0 to disable it.

virtual int isHScrollEnabled () const =0

Returns a value indicating if horizontal scrolling is enabled.

Return value

Positive number if scrolling is enabled; otherwise, 0.

virtual void setHScrollHidden (int hide) const =0

Sets a flag indicating if a horizontal scroll bar is hidden, disabled or always rendered.

Arguments

  • int hide - 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.

virtual int isHScrollHidden () const =0

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.

virtual int getHScrollObjectSize () const =0

Returns the width of the whole object that should be scrolled.

Return value

Width of the object being scrolled in pixels.

virtual int getHScrollFrameSize () const =0

Returns the width of the currently visible area.

Return value

Width of the visible area in pixels.

virtual int getHScrollStepSize () const =0

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.

virtual void setHScrollValue (int value) const =0

Sets a position (and also automatically 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.

virtual int getHScrollValue () const =0

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.
Last update: 2017-07-03
Build: ()