This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
Setting Up Properties
照明
Landscape Tool
Sandworm (Experimental)
使用编辑器工具执行特定任务
Extending Editor Functionality
嵌入式节点类型
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Objects
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
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
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine.WidgetMenuBar Class

Inherits: Widget

This class creates a horizontal menu bar.

WidgetMenuBar Class

Properties

int NumItems#

The number of items in the menu bar.

int SpaceY#

The vertical space between menu items and menu borders.

int SpaceX#

The horizontal space between menu items and menu borders.

vec4 SelectionColor#

Returns the current color used to highlight the current selection for the widget.
set
Sets the color to be used to highlight the current selection for the widget.
set value - Four-component vector specifying the color in the RGBA format.

Members


static WidgetMenuBar ( Gui gui, int x = 0, int y = 0 ) #

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

Arguments

  • 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 WidgetMenuBar ( 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, string 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.
  • string str - Item text data to be set.

string GetItemData ( int item ) #

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 ) #

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

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.

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 - Space to set, in pixels.

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

Return value

Item space, in pixels.

void SetItemText ( int item, string 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.
  • string str - Menu title.

string GetItemText ( int item ) #

Returns the title of a given item.

Arguments

  • int item - Item number.

Return value

Item title.

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.
  • int y - Vertical space, in pixels.

int AddItem ( string str ) #

Adds an empty menu with a given title.

Arguments

  • string str - Menu title.

Return value

Number of the added menu.

int AddItem ( string str, 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.
Last update: 2020-11-24
Build: ()