abstract class Tinman.Engine.GUI.Components.InputFieldGeneric<T>

Derived from


Extended by

InputFieldLatLon sealed
InputFieldRangeGeneric abstract

A text-based generic value input field.

Public / Methods


public method Commit → ()

returns → bool

true if the changes have been committed,
false if there are no changes or if the input state is invalid (see InputState).

Tries to commit the current changes.

Public / Attributes


public attribute InputState → (get)

value : InputFieldState

The input field state.

Returns the current input field state.

Protected / Constructors


protected constructor InputFieldGeneric → (3)

editable opt : int32 = 1

Initial value for InputField.Editable.

textMeasureWidth opt : string = null

Initial value for TextComponent.TextMeasure.

unit opt : string = null

Initial value for IInputField.Unit.

Creates a new instance of InputFieldGeneric.

Protected / Methods


protected abstract method TextToValue → (2)

text in : string

The input text.

state out : InputFieldState

The resulting input field state.

returns → T

The generic input value.

Converts the given input text to a generic input value, if possible.

The input field will be put in the state indicated by state out.


protected abstract method ValueEqual → (2)

in : T

First input value.

in : T

Second input value.

returns → bool

true if in and in are equal, false if they are note.

Checks if the given input values are equal.


protected virtual method ValueToRange → (1)

value in : T

The input value.

returns → T

The output value, after applying the valid range, if any.

Applies the valid range for values.

The default implementation returns value in.


protected abstract method ValueToText → (1)

value in : T

The generic input value.

returns → string

The input text (can be empty).

Converts the given generic input value to input text.