InputField

Description

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

Class


public static readonly attribute Class → (StyleClass)

The style class for InputFields.

Public / Constructors

Input​Field


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

Clear​Selection


public method ClearSelection → ()

Clears the text selection.

Move​Cursor


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.

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

Cursor


public attribute Cursor → (get)

value : int32

[0..ITextProperty.Text.Length]
The cursor position.

The current position of the text cursor.

Editable


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.

Has​Selection


public attribute HasSelection → (get)

value : bool

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

Is there some selected text?

Selection​Range


public attribute SelectionRange → (get)

value : RangeI

The selection range.

Returns the current selection range.

Selection​Text


public attribute SelectionText → (get,set)

value : string

The selected text or an empty string if none.

The selected text.

Text​Prompt


[Localized]
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.