This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-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版本。

WidgetMenuBar Class

This class creates a horizontal menu bar.

WidgetMenuBar Class

This class inherits from Widget

Members


WidgetMenuBar (Gui gui)

Constructor. Creates an empty menu bar.

Arguments

  • Gui gui - GUI, to which the menu bar will belong.

int addItem (string title, WidgetMenuBox menu)

Adds a menu with a given title.

Arguments

  • string title - Menu title.
  • WidgetMenuBox menu - Menu.

Return value

Number of the added menu.

void clear ()

Removes all menus from the menu bar.

WidgetMenuBox getItemMenu (int item)

Returns the menu of a given item.

Arguments

  • int item - Item number in range from 0 to the total number of menu bar items.

Return value

Menu.

string getItemText (int item)

Returns the title of a given item.

Arguments

  • int item - Item number.

Return value

Item title.

int getNumItems ()

Returns the number of items in the menu bar.

Return value

Number of items.

void removeItem (int item)

Removes a given item from the menu bar.

Arguments

  • int item - Item number in range from 0 to the total number of menu bar items.

void setItemMenu (int item, WidgetMenuBox menu)

Sets a menu for a given item.

Arguments

  • int item - Item number in range from 0 to the total number of menu bar items.
  • WidgetMenuBox menu - Menu.

void setItemText (int item, string title)

Sets a title for a given item.

Arguments

  • int item - Item number in range from 0 to the total number of menu bar items.
  • string title - Menu title.
Last update: 2017-07-03
Build: ()