This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
Plugins Library
High-Level Systems
Samples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Content Creation
Materials
Unigine Material Library
Tutorials
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

UserInterface Class

The class is used to work with widgets that are created by loading a UI file.

UserInterface Class

Members


UserInterface (Gui gui, string name, string prefix)

Constructor. Creates a new user interface.

Arguments

  • Gui gui - GUI, to which the new user interface will belong.
  • string name - Name of the user interface.
  • string prefix - Name prefix. This is an optional argument.

int findWidget (string name)

Searches a widget by its name.

Arguments

  • string name - Widget name.

Return value

Returns the number of the widget if exists; otherwise, -1.

string getCallbackName (int num, int callback)

Returns the name of a given callback function.

Arguments

  • int num - Widget number.
  • int callback - Callback number.

Return value

Callback function name.

string getCallbackStringData (int num, int callback)

Returns the callback string data.

Arguments

  • int num - Widget number.
  • int callback - Callback number.

Return value

Callback string data (i.e. string data specified in the string parameter of the callback).

string getCallbackVariableData (int num, int callback)

Returns the callback variable data.

Arguments

  • int num - Widget number.
  • int callback - Callback number.

Return value

Callback variable data (i.e. string data specified in the variable parameter of the callback).

Widget getCallbackWidgetData (int num, int callback)

Returns the callback widget data.

Arguments

  • int num - Widget number.
  • int callback - Callback number.

Return value

Widget data (i.e. reference to a widget specified in the widget parameter of the callback).

int getCallback (int num, int callback)

Returns the number of a given callback function.

Arguments

  • int num - Widget number.
  • int callback - Callback number.

Return value

Callback number.

int getNumCallbacks (int num)

Returns the total number of callbacks for a given widget.

Arguments

  • int num - Widget number.

Return value

Number of callbacks.

int getNumWidgets ()

Returns number of associated widgets.

Return value

Number of associated widgets.

int getWidgetExport (int num)

Returns a value indicatig if a given widget is exported into a script (has export="1" flag in UI file).

Arguments

  • int num - Widget ID.

Return value

1 if the widget is exported; otherwise, 0.

string getWidgetName (int name)

Returns widget name by ID.

Arguments

  • int name - Widget ID.

Return value

Widget name.

string getWidgetNext (int num)

Returns the name of the widget, which will be focused next.

Arguments

  • int num - Widget number.

Return value

Widget name.

Widget getWidget (int widget)

Returns reference to widget with the given ID.

Arguments

  • int widget - Widget ID.

Return value

Reference to widget with the given ID.

void updateWidgets ()

Updates all widgets belonging to the user interface. This function should be called, for example, after change of the interface language.
Last update: 03.07.2017
Build: ()