This page has been translated automatically.
Programming
Fundamentials
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Bounds-Related Classes
Containers
Controls-Related Classes
Core Library
Engine-Related Classes
Node-Related Classes
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
Rendering-Related Classes
Utility Classes
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

WidgetMenuBar Class

Interface for widget menubar handling. See also UnigineScript analog.

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

WidgetMenuBar Class

Members


WidgetMenuBar (const Ptr<Gui> & gui, int x = 0, int y = 0)

Constructor. Creates an empty menu bar.

Arguments

  • const Ptr<Gui> & gui - GUI, to which the menu bar will belong.
  • int x - Offset along the X axis.
  • int y - Offset along the Y axis.

Ptr<WidgetMenuBar> create (const Ptr<Widget> & widget)

WidgetMenuBar constructor.

Arguments

  • const Ptr<Widget> & widget - Widget smart pointer.

Return value

void clear ()

Removes all menus from the menu bar.

void setItemText (int item, const char * str)

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.

int getItemSpace (int item)

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.

void setSpace (int x, int y)

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.

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.

int addItem (const char * str)

Adds an empty menu with a given title.

Arguments

  • const char * str - Menu title.

Return value

Number of the added menu.

void setItemSpace (int item, int space)

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.

int getSpaceY ()

Returns the vertical space between menu items and menu borders.

Return value

Vertical space, in pixels.

void setItemData (int item, const char * str)

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.

void setItemEnabled (int item, int enabled)

Sets an enabled flag for the item.

Arguments

  • int item - Item number in range from 0 to the total number of items.
  • int enabled - Enabled flag:
    • 1 - Item is enabled.
    • 0 - Item is disabled.

int getNumItems ()

Returns the number of items in the menu bar.

Return value

Number of items.

const char * getItemData (int item)

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.

void setItemMenu (int item, const Ptr<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.
  • const Ptr<WidgetMenuBox> & menu - Menu box.

int getSpaceX ()

Returns the horizontal space between menu items and menu borders.

Return value

Horizontal space, in pixels.

int addItem (const char * str, const Ptr<WidgetMenuBox> & menu)

Adds an empty menu with a given title.

Arguments

  • const char * str - Menu title.
  • const Ptr<WidgetMenuBox> & menu - Menu box.

Return value

Number of the added menu.

int type ()

WidgetMenuBar type.

Return value

WidgetMenuBar type identifier.

const char * getItemText (int item)

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.

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

int isItemEnabled (int item)

Returns a value indicating if the given item is enabled.

Arguments

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

Return value

1 if the item is enabled; otherwise - 0.
Last update: 2017-07-03
Build: ()