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::WidgetMenuBar Class

Interface for widget menubar handling. See also UnigineScript analog.

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

Unigine::WidgetMenuBar Class

Members


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

WidgetMenuBar constructor.

Arguments

  • const WidgetPtr & widget - Widget smart pointer.

static Ptr< WidgetMenuBar > create (const Ptr< Gui > & gui)

WidgetMenuBar constructor.

Arguments

  • const Ptr< Gui > & gui - Gui pointer.

virtual void clear () const =0

Removes all menus from the menu bar.

virtual int addItem (const char * str) const =0

Adds an empty menu with a given title.

Arguments

  • const char * str - Menu title.

Return value

Number of the added menu.

virtual int addItem (const char * str, const WidgetMenuBoxPtr & menu) const =0

Adds a menu with a given title.

Arguments

  • const char * str - Menu title.
  • const WidgetMenuBoxPtr & menu - Menu box.

Return value

Number of the added menu.

virtual void removeItem (int item) const =0

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.

virtual int getNumItems () const =0

Returns the number of items in the menu bar.

Return value

Number of items.

virtual void setItemText (int item, const char * str) const =0

Sets a title for a given item.

Arguments

  • int item - Item number in range from 0 to the total number of menu bar items.
  • const char * str - Menu title.

virtual const char * getItemText (int item) const =0

Returns the title of a given item.

Arguments

  • int item - Item number.

Return value

Item title.

virtual void setItemMenu (int item, const WidgetMenuBoxPtr & menu) const =0

Sets a menu for a given item.

Arguments

  • int item - Item number in range from 0 to the total number of menu bar items.
  • const WidgetMenuBoxPtr & menu - Menu box.

virtual WidgetMenuBoxPtr getItemMenu (int item) const =0

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