This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Migration
Migrating to UNIGINE 2.0
C++ API Migration
Migrating from UNIGINE 2.0 to UNIGINE 2.1
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

WidgetEditLine Class

This class creates an editable single-line text field containing a text string.

WidgetEditLine Class

This class inherits from Widget

Members


WidgetEditLine (Gui gui, string text = 0)

Constructor. Creates a text field.

Arguments

  • Gui gui - GUI, to which the text field will belong.
  • string text - Initial value. This is an optional parameter.

void clearSelectionText ()

Deletes currently selected text.

int getBackground ()

Returns a value indicating if a background texture is rendered for the text field.

Return value

Positive number if a background texture is rendered; otherwise, 0.

int getCapacity ()

Returns the maximum length of a string entered into the text field.

Return value

Maximum number of characters.

int getCursor ()

Gets the current cursor position in the text field.

Return value

Cursor position.

StringStack<256> getSelectionText ()

Returns currently selected text.

Return value

Currently selected text.

int getSelection ()

Returns a position, from which the selection starts.

Return value

Position, from which the selection starts.

string getText ()

Returns the current contents of the text field.

Return value

Text string.

int getValidator ()

Returns the validator associated with the text field. The default is GUI_VALIDATOR_ANY .

Return value

One of the GUI_VALIDATOR_* pre-defined variables.

int isEditable ()

Returns a value indicating if the contents of the text field can be edited.

Return value

Positive number if the text field contents can be edited; otherwise, 0.

int isPassword ()

Returns a value indicating if the text field is a password field (all entered characters show up as dots).

Return value

Positive number if the widget is a password field; otherwise, 0.

void setBackground (int mode)

Sets a value indicating if a background texture should be rendered for the text field.

Arguments

  • int mode - Positive number to render a background texture, 0 not to render.

void setCapacity (int length)

Sets a maximum length of a string entered into the text field.

Arguments

  • int length - Maximum number of characters.

void setCursor (int position)

Sets a cursor position in the text field.

Arguments

  • int position - Cursor position. The provided value will be saturated in the range from 0 to text field capacity.

void setEditable (int mode)

Sets a value indicating if the contents of the text field can be edited.

Arguments

  • int mode - Positive number to make the text field editable, 0 to make it read-only.

void setPassword (int mode)

Turns the widget into a generic text field or into a password field.

Arguments

  • int mode - Positive number to make the widget a password field, 0 to make it a generic text field.

void setSelection (int position)

Sets a position, from which a new selection will start.

Arguments

  • int position - Position, from which the selection will start.

void setText (string text)

Sets a text for the text field.

Arguments

  • string text - Text string.

void setValidator (int validator)

Sets a validator for the text filed contents.

Arguments

Last update: 2017-07-03
Build: ()