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
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Content Creation
Materials
Unigine Material Library
Tutorials
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::WidgetEditLine Class

Interface for widget editline handling. See also UnigineScript analog.

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

Unigine::WidgetEditLine Class

Members


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

WidgetEditLine constructor.

Arguments

  • const WidgetPtr & widget - Widget smart pointer.

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

WidgetEditLine 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. The default is 1.

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 setPassword (int password) const =0

Turns the widget into a generic text field or into a password field. The default is 0.

Arguments

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

virtual int isPassword () const =0

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. The default is 0.

virtual void setValidator (int validator) const =0

Sets a validator for the text filed contents.

Arguments

virtual int getValidator () const =0

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

Return value

One of the Unigine::Gui:: Enumeration with VALIDATOR_* prefixes.

virtual void setBackground (int background) const =0

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

Arguments

  • int background - 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.

Return value

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

virtual void setCapacity (int capacity) const =0

Sets a maximum length of a string entered into the text field. The default is 1024.

Arguments

  • int capacity - Maximum number of characters.

virtual int getCapacity () const =0

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

Return value

Maximum number of characters. The default is 1024.

virtual void setCursor (int position) const =0

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.

virtual int getCursor () const =0

Returns the current cursor position in the text field.

Return value

Cursor position.

virtual void setSelection (int position) const =0

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

Arguments

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

virtual int getSelection () const =0

Returns a position, from which the selection starts.

Return value

Position, from which the selection starts.

virtual String getSelectionText () const =0

Returns currently selected text.

Return value

Currently selected text.

virtual void clearSelectionText () const =0

Deletes currently selected text.

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

Sets a text for the text field.

Arguments

  • const char * str - Text string.

virtual const char * getText () const =0

Returns the current contents of the text field.

Return value

Text string.
Last update: 2017-07-03
Build: ()