Class: CharInput
An input with a scrolling cursor that allows users to select an arbitrary string. The composite value bound to the
input is derived from the in-order concatenation of the values of all child CharInputSlot
components.
Hierarchy
DisplayComponent
<CharInputProps
>↳
CharInput
Constructors
constructor
• new CharInput(props
): CharInput
Creates an instance of a DisplayComponent.
Parameters
Name | Type | Description |
---|---|---|
props | CharInputProps | The propertis of the component. |
Returns
Inherited from
DisplayComponent<CharInputProps>.constructor
Defined in
src/sdk/components/FSComponent.ts:73
Properties
context
• Optional
context: [] = undefined
The context on this component, if any.
Inherited from
DisplayComponent.context
Defined in
src/sdk/components/FSComponent.ts:64
contextType
• Optional
Readonly
contextType: readonly [] = undefined
The type of context for this component, if any.
Inherited from
DisplayComponent.contextType
Defined in
src/sdk/components/FSComponent.ts:67
props
• props: CharInputProps
& ComponentProps
The properties of the component.
Inherited from
DisplayComponent.props
Defined in
src/sdk/components/FSComponent.ts:61
Accessors
cursorPosition
• get
cursorPosition(): Subscribable
<number
>
The index of the character position currently selected by this input's cursor.
Returns
Subscribable
<number
>
Defined in
src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/CharInput/CharInput.tsx:48
isEditingActive
• get
isEditingActive(): Subscribable
<boolean
>
Whether editing is active for this input.
Returns
Subscribable
<boolean
>
Defined in
src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/CharInput/CharInput.tsx:54
isSelectionPerSlot
• get
isSelectionPerSlot(): Subscribable
<boolean
>
Whether this input's cursor selection mode is per-slot.
Returns
Subscribable
<boolean
>
Defined in
src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/CharInput/CharInput.tsx:60
Methods
activateEditing
▸ activateEditing(isSelectionPerSlot
): void
Activates editing for this input.
Parameters
Name | Type | Description |
---|---|---|
isSelectionPerSlot | boolean | Whether cursor selection should be initialized to per-slot mode. If false , cursor selection will be initialized to per-character mode instead. |
Returns
void
Throws
Error if this input is not initialized.
Defined in
src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/CharInput/CharInput.tsx:131
backspace
▸ backspace(): void
Removes the character at the cursor's current position and shifts the cursor one position to the left after the character is removed.
Returns
void
Throws
Error if this input is not initialized.
Defined in
src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/CharInput/CharInput.tsx:247
changeSlotValue
▸ changeSlotValue(direction
, eraseCharsToRightOnEdit?
): void
Increments or decrements the value of the slot currently selected by the cursor. If editing is not active, then it will be activated instead of changing any slot value. If cursor selection is in per-character mode, it will be forced to per-slot mode. If the cursor is past the last slot, then this method does nothing.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
direction | 1 | -1 | undefined | The direction in which to change the slot value (1 = increment, -1 = decrement). |
eraseCharsToRightOnEdit | boolean | false | Whether to erase (set to null ) all characters to the right of the edited character. Defaults to false . |
Returns
void
Throws
Error if this input is not initialized.
Defined in
src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/CharInput/CharInput.tsx:200
deactivateEditing
▸ deactivateEditing(): void
Deactivates editing for this input.
Returns
void
Throws
Error if this input is not initialized.
Defined in
src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/CharInput/CharInput.tsx:143
destroy
▸ destroy(): void
Returns
void
Inherit Doc
Overrides
DisplayComponent.destroy
Defined in
src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/CharInput/CharInput.tsx:312
getContext
▸ getContext(context
): never
Gets a context data subscription from the context collection.
Parameters
Name | Type | Description |
---|---|---|
context | never | The context to get the subscription for. |
Returns
never
The requested context.
Throws
An error if no data for the specified context type could be found.
Inherited from
DisplayComponent.getContext
Defined in
src/sdk/components/FSComponent.ts:106
isInitialized
▸ isInitialized(): boolean
Checks whether this input is initialized.
Returns
boolean
Whether this input is initialized.
Defined in
src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/CharInput/CharInput.tsx:103
moveCursor
▸ moveCursor(direction
, forceSelectionPerSlot
): void
Moves the cursor.
Parameters
Name | Type | Description |
---|---|---|
direction | 1 | -1 | The direction in which to move (1 = to the right, -1 = to the left). |
forceSelectionPerSlot | boolean | Whether to force cursor selection to per slot mode. |
Returns
void
Throws
Error if this input is not initialized.
Defined in
src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/CharInput/CharInput.tsx:157
onAfterRender
▸ onAfterRender(thisNode
): void
Parameters
Name | Type |
---|---|
thisNode | VNode |
Returns
void
Inherit Doc
Overrides
DisplayComponent.onAfterRender
Defined in
src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/CharInput/CharInput.tsx:69
onBeforeRender
▸ onBeforeRender(): void
A callback that is called before the component is rendered.
Returns
void
Inherited from
DisplayComponent.onBeforeRender
Defined in
src/sdk/components/FSComponent.ts:80
placeCursor
▸ placeCursor(index
, forceSelectionPerSlot
): void
Places the cursor at a specific character position.
Parameters
Name | Type | Description |
---|---|---|
index | number | The index of the character position at which to place the cursor. |
forceSelectionPerSlot | boolean | Whether to force cursor selection to per slot mode. |
Returns
void
Throws
Error if this input is not initialized.
Throws
RangeError if index
does not point to a valid character position.
Defined in
src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/CharInput/CharInput.tsx:183
populateCharsFromValue
▸ populateCharsFromValue(): void
Populates all of this input's character positions with non-empty values, if possible, using this input's value digitizer function and the current composite value as a template.
Returns
void
Defined in
src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/CharInput/CharInput.tsx:259
refresh
▸ refresh(): void
Refreshes this input, updating the size and position of the cursor.
Returns
void
Defined in
src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/CharInput/CharInput.tsx:266
render
▸ render(): VNode
Returns
VNode
Inherit Doc
Overrides
DisplayComponent.render
Defined in
src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/CharInput/CharInput.tsx:294
setSlotCharacterValue
▸ setSlotCharacterValue(value
, eraseCharsToRightOnEdit?
): void
Sets the value of the slot character currently selected by the cursor. If editing is not active, then it will be activated before setting the value. If the cursor is past the last slot, then this method does nothing.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
value | string | undefined | The value to set. |
eraseCharsToRightOnEdit | boolean | false | Whether to erase (set to null ) all characters to the right of the edited character. Defaults to false . |
Returns
void
Throws
Error if this input is not initialized.
Defined in
src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/CharInput/CharInput.tsx:224
setValue
▸ setValue(value
): string
Sets the composite value of this input. As part of the operation, all of this input's child slots will have their values set according to this input's value digitizer, and all slot characters will be set to non-null representations of their slot's value, if possible. The composite value of this input after the operation is complete may differ from the requested value depending on whether the requested value can be accurately represented by this input.
Parameters
Name | Type | Description |
---|---|---|
value | string | The new composite value. |
Returns
string
The composite value of this input after the operation is complete.
Throws
Error if this input is not initialized.
Defined in
src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/CharInput/CharInput.tsx:117