This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
FAQ
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
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
CIGI Client Plugin
Rendering-Related Classes
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Unigine.WidgetEditText Class

Inherits: Widget

This class creates a simple editable multi-line text area containing text strings.

Notice
Word wrapping and rich text options are not supported for this class.

See Also#

  • UnigineScript API sample <UnigineSDK>/data/samples/widgets/text_00

WidgetEditText Class

Properties

string Text#

The current contents of the text field.
set
Sets a text for the text field.
set value - Text.

int NumLines#

The number of lines in the text field.

int SelectionLine#

A number of the line where selection starts.

int SelectionPosition#

A cursor position in the line where selection starts.

int CursorLine#

A number of the current line.

int CursorPosition#

A cursor position in the current line.

int Background#

A value indicating if a background texture is rendered for the text field. the default is 1.
set
Sets a value indicating if a background texture should be rendered for the text field.
set value - Positive number to render a background texture, 0 not to render.

bool IsEditable#

A value indicating if the contents of the text field can be edited. the default is 1.
set
Sets a value indicating if the contents of the text field can be edited.
set value - Positive number to make the text field editable, 0 to make it read-only.

Members


static WidgetEditText ( Gui gui, string str = 0 ) #

Constructor. Creates a multiline text field.

Arguments

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

WidgetEditText Cast ( Widget widget ) #

Casts a WidgetEditText out of the Widget instance.

Arguments

  • Widget widget - Widget instance.

Return value

WidgetEditText instance.

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.

int type ( ) #

WidgetEditText type.

Return value

WidgetEditText type identifier.
Last update: 2019-08-16
Build: ()