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

Inherits: Widget

This class creates a list box, which is multiple line text box where more than one item can be picked.

WidgetListBox Class

Properties

int NumSelectedItems#

The number of selected items in the box.

int CurrentItem#

The number of the item, which is currently in focus.
set
Places focus on a given item.
set value - Item number.

int NumItems#

The total number of items in the list box.

string Texture#

The path to the texture with mini-icons, which are used with the list items.
set
Sets a texture with mini-icons to be used with list items. The texture is a vertical strip of square icons.
set value - Path to a texture file.

bool MultiSelection#

A value indicating if multiple selection of items is enabled. the default is 0.
set
Enables or disables multiple selection of items. The default is 0.
set value - 1 to enable multiple selection, 0 to disable it.

vec4 SelectionColor#

Color to be 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 WidgetListBox ( Gui gui ) #

Constructor. Creates an empty list box and adds it to the specified GUI.

Arguments

  • Gui gui - GUI, to which the new list box will belong.

static WidgetListBox ( ) #

Constructor. Creates an empty list box and adds it to the Engine GUI.

string GetCurrentItemData ( ) #

Returns the text data of item, which is currently in focus. The data can be used as a text identifier of the item (instead of using the item number).

Return value

Item text data.

string GetCurrentItemText ( ) #

Returns the text of item, which is currently in focus.

Return value

Item text.

void SetImage ( Image image ) #

Sets an image with mini-icons to be used with list items. The image is a vertical strip of square icons.

Arguments

  • Image image - Image to set.

Image GetImage ( ) #

Gets the image with mini-icons, which are used with the list items.

Return value

Image with mini-icons (the vertical strip of square icons).

void SetItemColor ( int item, vec4 color ) #

Sets a custom color for a given item.

Arguments

  • int item - Item number.
  • vec4 color - Color to set.

vec4 GetItemColor ( int item ) #

Returns a color set to a given item.

Arguments

  • int item - Item number.

Return value

Item color.

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 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 if the item is in range from 0 to the total number of items; otherwise, NULL.

void SetItemSelectable ( int item, int selectable ) #

Sets a value indicating if a given item can be selected.

Arguments

  • int item - Item number in range from 0 to the total number of items.
  • int selectable - 1 to set the item as selectable; otherwise, 0.

int IsItemSelectable ( int item ) #

Returns a value indicating if a given item can be selected.

Arguments

  • int item - Item number.

Return value

Returns 1 if the item is selectable; otherwise, 0.

void SetItemSelected ( int item, int selected ) #

Sets a value indicating if a given item is selected.

Arguments

  • int item - Item number in range from 0 to the total number of items.
  • int selected - 1 to select the item, 0 to deselect it.

int IsItemSelected ( int item ) #

Returns a value indicating if a given item is selected.

Arguments

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

Return value

Returns 1 if the item is selected; otherwise, 0.

void SetItemText ( int item, string str ) #

Sets a text for a given item.

Arguments

  • int item - Item number.
  • string str - Item text.

string GetItemText ( int item ) #

Returns the text of a given item.

Arguments

  • int item - Item number.

Return value

Item text.

void SetItemTexture ( int item, int texture ) #

Sets an icon for a given item.

Arguments

  • int item - Item number.
  • int texture - Zero-based ID of the icon (i.e. number of the icon in the icon texture).

int GetItemTexture ( int item ) #

Returns the icon of a given item.

Arguments

  • int item - Item number.

Return value

Zero-based ID of the icon (i.e. number of the icon in the icon texture).

int GetSelectedItem ( int num ) #

Returns ID of the selected item (multi-selection mode).

Arguments

  • int num - Number in the list of the selected items in range from 0 to the total number of the selected items.

Return value

ID of a selected item.

int AddItem ( string str, int texture = -1 ) #

Adds a new item with a given text and an icon. By default, a new item is not selected.

Arguments

  • string str - Item text.
  • int texture - Zero-based ID of the icon (i.e. number of the icon in the icon texture).

Return value

Number of the added item.

void Clear ( ) #

Removes all items from the list box.

void ClearSelection ( ) #

Clears list of selected items.

void RemoveItem ( int item ) #

Removes a given item from the list box.

Arguments

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

void ShowItem ( int item ) #

Scrolls a list box so that a given item is visible.

Arguments

  • int item - Item number.
Last update: 2021-02-17
Build: ()