This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-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版本。

Unigine::WidgetEditText Class

Interface for widget edittext handling. See also UnigineScript analog.

To use this class, include the UnigineWidgetEditText.h file.

Unigine::WidgetEditText Class

Members


static int type ()

WidgetEditText type.

Return value

WidgetEditText type identifier.

static Ptr< WidgetEditText > create (const WidgetPtr & widget)

WidgetEditText constructor.

Arguments

  • const WidgetPtr & widget - Widget smart pointer.

static Ptr< WidgetEditText > create (const Ptr< Gui > & gui, const char * str)

WidgetEditText constructor.

Arguments

  • const Ptr< Gui > & gui - Gui pointer.
  • const char * str - Default text. This is an optional argument.

virtual void setEditable (int editable) const =0

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

Arguments

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

virtual int isEditable () const =0

Returns a value indicating if the contents of the text field can be edited. The default is 1.

Return value

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

virtual void setBackground (int Positive) const =0

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

Arguments

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

virtual int getBackground () const =0

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

Return value

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

virtual void setTokenColor (const char * token, const vec4 & color) const =0

Sets a color for a given token. The token will be highlighted with the provided color.

Arguments

  • const char * token - Token (i.e. keyword, identifier, etc).
  • const vec4 & color - Color.

virtual void setTokensColor (const char * tokens, const vec4 & color) const =0

Sets a color to given tokens. Each token will be highlighted with the provided color.

Arguments

  • const char * tokens - Comma-separated list of tokens (i.e. keywords, identifiers, etc).
  • const vec4 & color - Color.

virtual vec4 getTokenColor (const char * token) const =0

Returns a color, which is used to highlight a given token.

Arguments

  • const char * token - Token (i.e. keyword, identifier, etc).

Return value

Color of the current token.

virtual void setCursor (int position, int line) const =0

Sets the cursor to a given position in a given line.

Arguments

  • int position - Position number.
  • int line - Line number.

virtual int getCursorPosition () const =0

Returns a cursor position in the current line.

Return value

Position number.

virtual int getCursorLine () const =0

Returns a number of the current line.

Return value

Line number.

virtual void setSelection (int position, int line) const =0

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

Arguments

  • int position - Position number.
  • int line - Line number.

virtual int getSelectionPosition () const =0

Returns a cursor position in the line where selection starts.

Return value

Position number.

virtual int getSelectionLine () const =0

Returns a number of the line where selection starts.

Return value

Line number.

virtual String getSelectionText () const =0

Returns the currently selected text.

Return value

Currently selected text.

virtual void clearSelectionText () const =0

Deletes the currently selected text.

virtual int addLine (const char * str) const =0

Adds a new line to the widget.

Arguments

  • const char * str - Text to add. This is an optional argument.

Return value

Number of the added line.

virtual void removeLine (int line) const =0

Deletes a given line.

Arguments

  • int line - Line number.

virtual int getNumLines () const =0

Returns the number of lines in the text field.

Return value

Number of lines.

virtual void setLineText (int line, const char * str) const =0

Sets new contents for a given line.

Arguments

  • int line - Line number.
  • const char * str - Text.

virtual String getLineText (int line) const =0

Returns the text contained in a given line.

Arguments

  • int line - Line number.

Return value

Text contained in the line.

virtual void setText (const char * str) const =0

Sets a text for the text field.

Arguments

  • const char * str - Text for the text field.

virtual const char * getText () const =0

Returns the current contents of the text field.

Return value

Text contained in the text field.
Last update: 2017-07-03
Build: ()