This page has been translated automatically.
Видеоуроки
Интерфейс
Основы
Продвинутый уровень
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Профессиональный уровень (SIM)
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Режимы вывода изображения
Физика
Браузер SDK 2
Лицензирование и типы лицензий
Дополнения (Add-Ons)
Демонстрационные проекты
API Samples
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Контроль версий
Настройки и предпочтения
Работа с проектами
Настройка параметров ноды
Setting Up Materials
Настройка свойств
Освещение
Sandworm
Использование инструментов редактора для конкретных задач
Расширение функционала редактора
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World-ноды
Звуковые объекты
Объекты поиска пути
Player-ноды
Программирование
Основы
Настройка среды разработки
Примеры использования
C++
C#
UnigineScript
Унифицированный язык шейдеров UUSL (Unified UNIGINE Shader Language)
Плагины
Форматы файлов
Материалы и шейдеры
Rebuilding the Engine Tools
Интерфейс пользователя (GUI)
Двойная точность координат
API
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
Работа с контентом
Оптимизация контента
Материалы
Визуальный редактор материалов
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Учебные материалы

Unigine::WidgetMenuBar Class

Header: #include <UnigineWidgets.h>
Inherits from: Widget

This class creates a horizontal menu bar.

See Also#

WidgetMenuBar Class

Members


static WidgetMenuBarPtr create ( const Ptr<Gui> & gui, int x = 0, int y = 0 ) #

Constructor. Creates an empty menu bar and adds it to the specified GUI.

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.

static WidgetMenuBarPtr create ( int x = 0, int y = 0 ) #

Constructor. Creates an empty menu bar and adds it to the Engine GUI.

Arguments

  • int x - Offset along the X axis.
  • int y - Offset along the Y axis.

void setItemData ( int item, const char * str ) #

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

Arguments

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

const char * getItemData ( int item ) const#

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

Arguments

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

Return value

Item text data.

void setItemEnabled ( int item, bool enabled ) #

Sets an enabled flag for the item.

Arguments

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

bool isItemEnabled ( int item ) const#

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.

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.

Ptr<WidgetMenuBox> getItemMenu ( int item ) const#

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.

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 getItemSpace ( int item ) const#

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

const char * getItemText ( int item ) const#

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.

int getNumItems ( ) const#

Returns the number of items in the menu bar.

Return value

Number of items.

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.

int getSpaceX ( ) const#

Returns the horizontal space between menu items and menu borders.

Return value

Horizontal space, in pixels.

int getSpaceY ( ) const#

Returns the vertical space between menu items and menu borders.

Return value

Vertical space, in pixels.

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.

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

Adds an empty menu with a given title.

Arguments

Return value

Number of the added menu.

void clear ( ) #

Removes all menus from the menu bar.

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 setSelectionColor ( const Math::vec4 & color ) #

Sets the color to be used to highlight the current selection for the widget.

Arguments

  • const Math::vec4 & color - The four-component vector specifying the color in the RGBA format.

Math::vec4 getSelectionColor ( ) const#

Returns the current color used to highlight the current selection for the widget.

Return value

The four-component vector specifying the color in the RGBA format.
Last update: 16.08.2024
Build: ()