This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Migration
Migrating to UNIGINE 2.0
C++ API Migration
Migrating from UNIGINE 2.0 to UNIGINE 2.1
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

WidgetTabBox Class

This class creates a box with several tabs.

See Also

WidgetTabBox Class

This class inherits from Widget

Members


WidgetTabBox (Gui gui, int space_x = 0, int space_y = 0)

Constructor. Creates a tabbed box with given parameters.

Arguments

  • Gui gui - GUI, to which the new box will belong.
  • int space_x - Horizontal space between the widgets in the box and between them and the box border. This is an optional parameter.
  • int space_y - Vertical space between the widgets in the box and between them and the box border. This is an optional parameter.

int addTab (string title, int texture = -1 = -1)

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

Arguments

  • string title - Tab title.
  • int texture = -1 - Zero-based ID of the icon (icon number in the atlas column). -1 specifies that a tab has no icon.

Return value

Added tab number.

void clear ()

Removes all tabs from the box.

string getCurrentTabData ()

Returns the data of the current tab. The data can be used as a text identifier of the tab (instead of using the number of the tab).

Return value

Tab data.

string getCurrentTabText ()

Returns the title of the current tab.

Return value

Tab title.

int getCurrentTab ()

Returns the number of the current tab.

Return value

Tab number.

Image getImage ()

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

Return value

Tabs atlas.

int getNumTabs ()

Returns the number of tabs in the box.

Return value

Number of tabs.

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 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.

string getTabData (int tab)

Returns the data of the currently selected tab.

Arguments

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

Return value

Tab data.

string getTabText (int tab)

Returns the title of a given tab.

Arguments

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

Return value

Tab title.

int getTabTexture (int num)

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.

string getTabToolTip (int num)

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.

string getTexture ()

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.

int isTabHidden (int tab)

Returns a value indicating if a specified tab is invisible.

Arguments

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

Return value

1 if the tab is invisible; otherwise, 0.

void removeTab (int tab)

Removes a given tab from the box.

Arguments

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

void setCurrentTab (int tab)

Makes a given tab current.

Arguments

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

void setImage (Image image)

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

Arguments

  • Image image - Tabs atlas.

void setPadding (int left, int right, int top, int bottom)

Sets widget paddings for all sides. Padding clears an area around the content of a widget (inside of it).

Arguments

  • int left - Left-side padding in pixels.
  • int right - Right-side padding in pixels.
  • int top - Top padding in pixels.
  • int bottom - Bottom padding in pixels.

void setSpace (int space_x, int space_y)

Sets a space between the widgets in the box and between them and the box border.

Arguments

  • int space_x - Horizontal space. If a negative value is provided, 0 will be used instead.
  • int space_y - Vertical space. If a negative value is provided, 0 will be used instead.

void setTabData (int tab, string data)

Sets the data for a given tab. The data can be used as a text identifier of the tab (instead of using the number of the tab).

Arguments

  • int tab - Tab number in range from 0 to the total number of tabs.
  • string data - Data to set.

void setTabHidden (int tab, int hidden)

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

Arguments

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

void setTabText (int tab, string title)

Sets a title of the current tab.

Arguments

  • int tab - Tab number in range from 0 to the total number of tabs.
  • string title - Tab title.

void setTabTexture (int num, int texture)

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.

void setTabToolTip (int num, string str)

Sets a tooltip for the specified tab.

Arguments

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

void setTexture (string name)

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

Arguments

  • string name - Path to the atlas texture.
Last update: 03.07.2017
Build: ()