class Tinman.Engine.GUI.Components.InputField

Derived from

TextComponent abstract

Extended by

InputFieldGeneric abstract

A text input field.

The following default Layout settings are defined for InputField objects:

The value of ITextProperty.Text will not be localized, i.e. the semantic of Localized will be ignored by the InputField class.

Public / Constants


public static readonly attribute Class → (StyleClass)

The style class for InputFields.

Public / Constructors


public constructor InputField → (2)

editable opt : int32 = 1

Initial value for Editable.

textMeasureWidth opt : string = null

Initial value for TextComponent.TextMeasure.

Creates a new instance of InputField.

Public / Methods


public method ClearSelection → ()

Clears the text selection.


public method MoveCursor → (2)

index in : int32

The new text cursor position.

selecting opt : bool = false

Select the text between the current and new positions?

Moves the text cursor, optionally extending the selection.


public virtual method Selection → (2)

start opt : int32 = 0

First selection offset (inclusive).

end opt : int32 = Maths.MaxInt

Last selection offset (exclusive).

Sets the current selection.

Public / Attributes


public attribute Cursor → (get)

value : int32

The cursor position.

The current position of the text cursor.


public attribute Editable → (get,set)

value : int32

The editable state:
< 0 : not editable, not focusable
= 0 : not editable, focusable
> 0 : editable, focusable

The editable state of this input field.


public attribute HasSelection → (get)

value : bool

true if at least one character is selected,
false if not.

Is there some selected text?


public attribute SelectionRange → (get)

value : RangeI

The selection range.

Returns the current selection range.


public attribute SelectionText → (get,set)

value : string

The selected text or an empty string if none.

The selected text.


public attribute TextPrompt → (get,set)

value : string

The text prompt or null.

Optional text to display while the input field is empty.

The text prompt is not taken into account when measuring the input field text in order to compute the layout size.

Defaults to null.