Unigine.WidgetEditText Class
Inherits from: | Widget |
WidgetEditText Class
Properties
string Text#
The contents of the text field.
int NumLines#
The number of lines in the text field.
int SelectionLine#
The number of the line where selection starts.
int SelectionPosition#
The cursor position in the line where selection starts.
int CursorLine#
The number of the current line.
int CursorPosition#
The cursor position in the current line.
vec4 NumberColor#
The color which is used for numbers.
vec4 SelectionColor#
The color used to highlight the current selection for the widget.
vec4 BackgroundColor#
The background color for the widget.
int Background#
The value indicating if a background texture is rendered for the text field. The default is 1.
bool Editable#
The value indicating if the contents of the text field can be edited. The default is 1.
Members
WidgetEditText ( Gui gui, string str = 0 ) #
Constructor. Creates a multiline 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.
WidgetEditText ( string str = 0 ) #
Constructor. Creates a multiline text field and adds it to the Engine GUI.Arguments
- string str - Initial value. This is an optional parameter.
void SetCursor ( int position, int line ) #
Sets the cursor to a given position in a given line.Arguments
- int position - Position number.
- int line - Line number.
void SetLineText ( int line, string str ) #
Sets new contents for a given line.Arguments
- int line - Line number.
- string str - Text.
string GetLineText ( int line ) #
Returns the text contained in a given line.Arguments
- int line - Line number.
Return value
Text contained in the line.void SetSelection ( int position, int line ) #
Sets a line and a position, from which a new selection will start.Arguments
- int position - Position number.
- int line - Line number.
string GetSelectionText ( ) #
Returns the currently selected text.Return value
Currently selected text.void SetTokenColor ( string token, vec4 color ) #
Sets a color for a given token. The token will be highlighted with the provided color.Arguments
- string token - Token (i.e. keyword, identifier, etc).
- vec4 color - Color.
vec4 GetTokenColor ( string token ) #
Returns a color, which is used to highlight a given token.Arguments
- string token - Token.
Return value
Color of the current token.void SetTokensColor ( string tokens, vec4 color ) #
Sets a color to given tokens. Each token will be highlighted with the provided color.Arguments
- string tokens - Comma-separated list of tokens (i.e. keywords, identifiers, etc).
- vec4 color - Color.
int AddLine ( string str = 0 ) #
Adds a new line to the widget.Arguments
- string str - Text to add. This is an optional argument.
Return value
Number of the added line.void ClearSelectionText ( ) #
Deletes the currently selected text.void RemoveLine ( int line ) #
Deletes a given line.Arguments
- int line - Line number.
Last update:
2022-12-14
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)