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

Unigine::WidgetTabBox Class

Interface for widget tabbox handling. See also UnigineScript analog.

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

Unigine::WidgetTabBox Class

Members


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

WidgetTabBox constructor.

Arguments

  • const WidgetPtr & widget - Widget smart pointer.

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

WidgetTabBox 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 provided, 0 will be used instead.
  • int y - Vertical space. If a negative value is provided, 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 setImage (const ImagePtr & image) const =0

Sets a tab icons atlas image. This atlas is a vertical strip of square icons.

Arguments

  • const ImagePtr & image - Tabs atlas.

virtual void getImage (const ImagePtr & image) const =0

Gets the tab icons atlas image. This atlas is a vertical strip of square icons.

Arguments

  • const ImagePtr & image - Tabs atlas.

virtual void setTexture (const char * name) const =0

Sets a texture to be used as tab icons atlas. This atlas is a vertical strip of square icons.

Arguments

  • const char * name - Path to the atlas texture.

virtual const char * getTexture () const =0

Returns the path to the tab icons atlas texture. This atlas is a vertical strip of square icons.

Return value

Path to the atlas texture.

virtual void clear () const =0

Removes all tabs from the box.

virtual int addTab (const char * str, int texture) const =0

Adds a new tab with a given title and icon to the box.

Arguments

  • const char * str - Tab title.
  • int texture - Zero-based ID of the icon (icon number in the atlas column). -1 means that a tab has no icon.

Return value

Number of the added tab.

virtual void removeTab (int num) const =0

Removes a given tab from the box.

Arguments

  • int num - Tab number in range from 0 to the total number of tabs.

virtual int getNumTabs () const =0

Returns the total number of tabs in the box.

Return value

Number of tabs.

virtual void setTabHidden (int num, int hidden) const =0

Sets a value indicating that a specified tab should not be rendered visible. By default all widget tabs are visible.

Arguments

  • int num - Tab number in range from 0 to the total number of tabs.
  • int hidden - 1 for the tab to be invisible; otherwise, 0.

virtual int isTabHidden (int num) const =0

Returns a value indicating if a specified tab is invisible.

Arguments

  • int num - Tab number in range from 0 to the total number of tabs.

Return value

Returns 1 if the tab is invisible; otherwise, 0.

virtual void setTabText (int num, const char * str) const =0

Sets a title for the current tab.

Arguments

  • int num - Tab number in range from 0 to the total number of tabs.
  • const char * str - Tab title.

virtual const char * getTabText (int num) const =0

Returns the title of a given tab.

Arguments

  • int num - Tab number in range from 0 to the total number of tabs.

Return value

Tab title.

virtual void setTabTexture (int num, int texture) const =0

Sets an icon for the specified tab.

Arguments

  • int num - Tab number in range from 0 to the total number of tabs.
  • int texture - Zero-based ID of the icon (icon number in the atlas column). -1 specifies that a tab has no icon.

virtual int getTabTexture (int num) const =0

Returns the icon of the specified tab.

Arguments

  • int num - Tab number in range from 0 to the total number of tabs.

Return value

Zero-based ID of the icon (icon number in the atlas column). -1 specifies that a tab has no icon.

virtual void setTabToolTip (int num, const char * str) const =0

Sets a tooltip for the specified tab.

Arguments

  • int num - Tab number in range from 0 to the total number of tabs.
  • const char * str - Tooltip to display.

virtual const char * getTabToolTip (int num) const =0

Returns the tooltip of the given tab.

Arguments

  • int num - Tab number in range from 0 to the total number of tabs.

Return value

Displayed tooltip.

virtual void setCurrentTab (int num) const =0

Makes a given tab current.

Arguments

  • int num - Tab number in range from 0 to the total number of tabs.

virtual int getCurrentTab () const =0

Returns the number of the current tab.

Return value

Tab number.

virtual const char * getCurrentTabText () const =0

Returns the title of the current tab.

Return value

Tab title.
Last update: 2017-07-03
Build: ()