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

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 int type ()

WidgetMenuBar type.

Return value

WidgetMenuBar type identifier.

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 setSpace (int x, int y) const =0

Sets a space between menu items and between them and menu borders.

Arguments

  • int x - Horizontal space, in pixels. If a negative value is provided, 0 will be used instead.
  • int y - Vertical space, in pixels. If a negative value is provided, 0 will be used instead.

virtual int getSpaceX () const =0

Returns the horizontal space between menu items and menu borders.

Return value

Horizontal space, in pixels.

virtual int getSpaceY () const =0

Returns the vertical space between menu items and menu borders.

Return value

Vertical space, in pixels.

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 in range from 0 to the total number of menu bar items.

Return value

Item title.

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

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

Arguments

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

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

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

Arguments

  • int item - Item number.

Return value

Item data.

virtual void setItemSpace (int item, int space) const =0

Sets a space between the given menu item and the next item located to the right.

Arguments

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

virtual int getItemSpace (int item) const =0

Returns the space between the given menu item and the next item located to the right.

Arguments

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

Return value

Item space, in pixels.

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