Unigine::WidgetEditLine Class
Header: | #include <UnigineWidgets.h> |
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 ( const char * text ) #
Sets a new text for the text field.
Arguments
- const char * 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:: Enumeration with VALIDATOR_* prefixes.
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:: Enumeration with VALIDATOR_* prefixes.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 ( bool editable ) #
Sets a new value indicating if the contents of the text field can be edited.
Arguments
- bool editable - Set true to enable the text field contents can be edited; false - to disable it.
bool isEditable() const#
Returns the current value indicating if the contents of the text field can be edited.
Return value
true if the text field contents can be edited is enabled; otherwise false.void setBorderColor ( const const Math::vec4 && color ) #
Sets a new border color for the widget.
Arguments
- const const Math::vec4 && color - The four-component vector specifying the color in the RGBA format.
const Math::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 ( const const Math::vec4 && color ) #
Sets a new color used to highlight the selection for the widget.
Arguments
- const const Math::vec4 && color - The four-component vector specifying the color in the RGBA format.
const Math::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 ( const const Math::vec4 && color ) #
Sets a new background color for the widget.
Arguments
- const const Math::vec4 && color - The four-component vector specifying the color in the RGBA format.
const Math::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 ( const char * border ) #
Sets a new path to the texture to be used as a border of the widget.
Arguments
- const char * 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 ( const char * background ) #
Sets a new path to the texture to be used as a background of the widget.
Arguments
- const char * 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 ( const char * selection ) #
Sets a new path to the texture to be used as a background for the selected text.
Arguments
- const char * 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 WidgetEditLinePtr create ( const Ptr<Gui> & gui, const char * str = 0 ) #
Constructor. Creates a text field and adds it to the specified GUI.Arguments
- const Ptr<Gui> & gui - GUI, to which the text field will belong.
- const char * str - Initial value. This is an optional parameter.
static WidgetEditLinePtr create ( const char * str = 0 ) #
Constructor. Creates a text field and adds it to the Engine GUI.Arguments
- const char * str - Initial value. This is an optional parameter.
String getSelectionText ( ) const#
Returns currently selected text.Return value
Currently selected text.void clearSelectionText ( ) #
Deletes currently selected text.Last update:
2024-12-13
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)