Cafu Engine
ComponentTextEditT Class Reference

With this component, the user can edit the text in a sibling text component. More...

Inheritance diagram for ComponentTextEditT:

Public Member Functions

 SetText (string text)
 Sets the given text in the related Text sibling component and moves the cursor position to its end. More...
 
- Public Member Functions inherited from ComponentBaseT
any get (string var_name)
 Returns the value of an attribute (a member variable) of this class. More...
 
 set (string var_name, any new_value)
 Sets an attribute (a member variable) of this class to a new value. More...
 
string GetExtraMessage (string var_name)
 Returns the result of VarBaseT::GetExtraMessage() for the given member variable. More...
 
 interpolate (string var_name, number start_value, number end_value, number time)
 Schedules a value for interpolation between a start and end value over a given period of time. More...
 

Public Attributes

number CursorPos
 The character position of the text cursor in the text. More...
 
number CursorType
 The type of the text cursor. More...
 
number CursorRate
 The rate in seconds at which the text cursor completes one blink cycle (on/off). More...
 
tuple CursorColor
 The color of the text cursor. More...
 
number CursorAlpha
 The alpha component of the color. More...
 

Detailed Description

With this component, the user can edit the text in a sibling text component.

The component requires that the window also has a text component, whose value it updates according to user edits.

Note that the variables of this class (also referred to as "Public Attributes" or "Member Data") must be used with the get() and set() methods at this time – see get() and set() for details.

If you would like to create a new component of this type explicitly (those defined in the CaWE GUI Editor are instantiated automatically), use GuiT::new():

local comp = gui:new("ComponentTextEditT")
Implementing C++ Class:
cf::GuiSys::ComponentTextEditT

Member Function Documentation

SetText ( string  text)

Sets the given text in the related Text sibling component and moves the cursor position to its end.

Member Data Documentation

number CursorAlpha

The alpha component of the color.

Related C++ type:
float
tuple CursorColor

The color of the text cursor.

Related C++ type:
Vector3fT
number CursorPos

The character position of the text cursor in the text.

Valid values are 0 to Text.length().

Related C++ type:
unsigned int
number CursorRate

The rate in seconds at which the text cursor completes one blink cycle (on/off).

Related C++ type:
float
number CursorType

The type of the text cursor.

0 is a vertical bar cursor '|', 1 is an underline cursor '_'. Any other values default to the '|' cursor type.

Typical values:
ValueDescription
0|
1_
Related C++ type:
int