WidgetEditLine Class
Warning
The scope of applications for UnigineScript is limited to implementing materials-related logic (material expressions, scriptable materials, brush materials). Do not use UnigineScript as a language for application logic, please consider C#/C++ instead, as these APIs are the preferred ones. Availability of new Engine features in UnigineScript (beyond its scope of applications) is not guaranteed, as the current level of support assumes only fixing critical issues.
Inherits from: | Widget |
This class creates an editable single-line text field containing a text string.
The object of this class looks as follows:
See Also#
- Widgets sample in C# Component Samples suite
WidgetEditLine Class
Members
void setText ( string text ) #
Sets a new text for the text field.
Arguments
- string text - The contents of the text field.
const char * getText() const#
Returns the current text for the text field.
Return value
Current contents of the text field.void setSelection ( int selection ) #
Sets a new position from which the selection starts.
Arguments
- int selection - The position from which the selection starts.
int getSelection() const#
Returns the current position from which the selection starts.
Return value
Current position from which the selection starts.void setCursor ( int cursor ) #
Sets a new cursor position in the text field.
Arguments
- int cursor - The cursor position. The set value is saturated in the range from 0 to text field capacity.
int getCursor() const#
Returns the current cursor position in the text field.
Return value
Current cursor position. The set value is saturated in the range from 0 to text field capacity.void setCapacity ( int capacity ) #
Sets a new maximum length of a string entered into the text field.
Arguments
- int capacity - The maximum number of characters. The default is 1024.
int getCapacity() const#
Returns the current maximum length of a string entered into the text field.
Return value
Current maximum number of characters. The default is 1024.void setBackground ( int background ) #
Sets a new value indicating if a background texture is rendered for the text field.
Arguments
- int background - The positive number if a background texture is rendered; otherwise, 0. The default is 1.
int getBackground() const#
Returns the current value indicating if a background texture is rendered for the text field.
Return value
Current positive number if a background texture is rendered; otherwise, 0. The default is 1.void setValidator ( int validator ) #
Sets a new validator associated with the text field. The default is VALIDATOR_ANY.
Arguments
- int validator - The validator, one of the GUI_VALIDATOR_* pre-defined variables.
int getValidator() const#
Returns the current validator associated with the text field. The default is VALIDATOR_ANY.
Return value
Current validator, one of the GUI_VALIDATOR_* pre-defined variables.void setPassword ( ) #
Sets a new value indicating if the text field is a password field (all entered characters are displayed as dots).
Arguments
- password - The the widget is a password field
isPassword() const#
Returns the current value indicating if the text field is a password field (all entered characters are displayed as dots).
Return value
Current the widget is a password fieldvoid setEditable ( int editable ) #
Sets a new
Arguments
- int editable - The the text field contents can be edited
int isEditable() const#
Returns the current
Return value
Current the text field contents can be editedvoid setBorderColor ( vec4 color ) #
Sets a new border color for the widget.
Arguments
- vec4 color - The four-component vector specifying the color in the RGBA format.
vec4 getBorderColor() const#
Returns the current border color for the widget.
Return value
Current four-component vector specifying the color in the RGBA format.void setSelectionColor ( vec4 color ) #
Sets a new color used to highlight the selection for the widget.
Arguments
- vec4 color - The four-component vector specifying the color in the RGBA format.
vec4 getSelectionColor() const#
Returns the current color used to highlight the selection for the widget.
Return value
Current four-component vector specifying the color in the RGBA format.void setBackgroundColor ( vec4 color ) #
Sets a new background color for the widget.
Arguments
- vec4 color - The four-component vector specifying the color in the RGBA format.
vec4 getBackgroundColor() const#
Returns the current background color for the widget.
Return value
Current four-component vector specifying the color in the RGBA format.void setStyleTextureBorder ( ) #
Sets a new path to the texture to be used as a border of the widget.
Arguments
- border - The path to the texture to be used as a border of the widget.
const char * getStyleTextureBorder() const#
Returns the current path to the texture to be used as a border of the widget.
Return value
Current path to the texture to be used as a border of the widget.void setStyleTextureBackground ( ) #
Sets a new path to the texture to be used as a background of the widget.
Arguments
- background - The path to the texture to be used as a background of the widget.
const char * getStyleTextureBackground() const#
Returns the current path to the texture to be used as a background of the widget.
Return value
Current path to the texture to be used as a background of the widget.void setStyleTextureSelection ( ) #
Sets a new path to the texture to be used as a background for the selected text.
Arguments
- selection - The path to the texture to be used as a background for the selected text.
const char * getStyleTextureSelection() const#
Returns the current path to the texture to be used as a background for the selected text.
Return value
Current path to the texture to be used as a background for the selected text.static WidgetEditLine ( Gui gui, string str = 0 ) #
Constructor. Creates a text field and adds it to the specified GUI.Arguments
- Gui gui - GUI, to which the text field will belong.
- string str - Initial value. This is an optional parameter.
static WidgetEditLine ( string str = 0 ) #
Constructor. Creates a text field and adds it to the Engine GUI.Arguments
- string str - Initial value. This is an optional parameter.
String getSelectionText ( ) #
Returns currently selected text.Return value
Currently selected text.void clearSelectionText ( ) #
Deletes currently selected text.The information on this page is valid for UNIGINE 2.20 SDK.
Last update:
2025-02-19
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)