Skip to main content

Class: UiSetValueTouchButton<S>

A G3X Touch UI version of SetValueTouchButton. Supports UI focus, enables focus on drag by default and provides convenience props for handling drag behavior while in a scrollable list.

The root element of the button conditionally contains the ui-button-focused CSS class when the button has UI focus.

Type parameters

NameType
Sextends MutableSubscribable<any>

Hierarchy

Implements

Constructors

constructor

new UiSetValueTouchButton<S>(props): UiSetValueTouchButton<S>

Creates an instance of a DisplayComponent.

Type parameters

NameType
Sextends MutableSubscribable<any, any>

Parameters

NameTypeDescription
propsUiSetValueTouchButtonProps<S>The propertis of the component.

Returns

UiSetValueTouchButton<S>

Inherited from

DisplayComponent<UiSetValueTouchButtonProps<S>>.constructor

Defined in

src/sdk/components/FSComponent.ts:73

Properties

buttonRef

Protected Readonly buttonRef: NodeReference<SetValueTouchButton<S>>

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/TouchButton/UiSetValueTouchButton.tsx:153


canBeFocused

Readonly canBeFocused: Subscribable<boolean>

Whether this component can be focused.

Implementation of

UiFocusableComponent.canBeFocused

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/TouchButton/UiSetValueTouchButton.tsx:165


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


focusModule

Protected Readonly focusModule: UiTouchButtonFocusModule

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/TouchButton/UiSetValueTouchButton.tsx:155


isUiFocusableComponent

Readonly isUiFocusableComponent: true

Flags this component as a UiFocusableComponent.

Implementation of

UiFocusableComponent.isUiFocusableComponent

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/TouchButton/UiSetValueTouchButton.tsx:151


props

props: UiSetValueTouchButtonProps<S> & ComponentProps

The properties of the component.

Inherited from

DisplayComponent.props

Defined in

src/sdk/components/FSComponent.ts:61

Methods

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/TouchButton/UiSetValueTouchButton.tsx:340


focusSelf

focusSelf(): void

Attempts to set focus on this button.

Returns

void

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/TouchButton/UiSetValueTouchButton.tsx:193


getContext

getContext(context): never

Gets a context data subscription from the context collection.

Parameters

NameTypeDescription
contextneverThe 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


getRootElement

getRootElement(): HTMLElement

Gets this button's root HTML element.

Returns

HTMLElement

This button's root HTML element.

Throws

Error if this button has not yet been rendered.

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/TouchButton/UiSetValueTouchButton.tsx:177


onAfterRender

onAfterRender(): void

Returns

void

Inherit Doc

Overrides

DisplayComponent.onAfterRender

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/TouchButton/UiSetValueTouchButton.tsx:168


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


onDeregistered

onDeregistered(): void

Responds to when this component is deregistered with a controller.

Returns

void

Implementation of

UiFocusableComponent.onDeregistered

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/TouchButton/UiSetValueTouchButton.tsx:203


onFocusGained

onFocusGained(direction): void

Responds to when this component gains focus.

Parameters

NameTypeDescription
directionUiFocusDirectionThe direction from which focus was gained.

Returns

void

Implementation of

UiFocusableComponent.onFocusGained

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/TouchButton/UiSetValueTouchButton.tsx:208


onFocusLost

onFocusLost(): void

Responds to when this component loses focus.

Returns

void

Implementation of

UiFocusableComponent.onFocusLost

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/TouchButton/UiSetValueTouchButton.tsx:214


onHoldEnded

onHoldEnded(button, state, setValue, totalHoldDuration, endReason): void

Responds to when this button exits the held state.

Parameters

NameTypeDescription
buttonSetValueTouchButton<S>The button that was held.
stateSThe state that is bound to the button.
setValueSubscribableType<S>The value that the button sets.
totalHoldDurationnumberThe total amount of time, in milliseconds, that this button was held.
endReasonTouchButtonHoldEndReasonThe reason that this button exited the held state.

Returns

void

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/TouchButton/UiSetValueTouchButton.tsx:300


onHoldStarted

onHoldStarted(button, state, setValue): TouchButtonHoldAction

Responds to when this button enters the held state.

Parameters

NameTypeDescription
buttonSetValueTouchButton<S>The button that is held.
stateSThe state that is bound to the button.
setValueSubscribableType<S>The value that the button sets.

Returns

TouchButtonHoldAction

The action to take. Ignored if the value is equal to TouchButtonHoldAction.EndHold.

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/TouchButton/UiSetValueTouchButton.tsx:262


onHoldTick

onHoldTick(button, state, setValue, dt, totalTime, timeSinceLastPress): TouchButtonHoldAction

A callback which is called every frame when this button is held.

Parameters

NameTypeDescription
buttonSetValueTouchButton<S>The button that is held.
stateSThe state that is bound to the button.
setValueSubscribableType<S>The value that the button sets.
dtnumberThe elapsed time, in milliseconds, since the previous frame.
totalTimenumberThe total amount of time, in milliseconds, that this button has been held.
timeSinceLastPressnumberThe amount of time, in milliseconds, that this button has been held since the last time the button was pressed as a tick action.

Returns

TouchButtonHoldAction

The action to take.

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/TouchButton/UiSetValueTouchButton.tsx:279


onPressed

onPressed(button, state, setValue, isHeld): void

Responds to when this button is pressed.

Parameters

NameTypeDescription
buttonSetValueTouchButton<S>The button that was pressed.
stateSThe state that is bound to the button.
setValueSubscribableType<S>The value that the button sets.
isHeldbooleanWhether the button was held when it was pressed.

Returns

void

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/TouchButton/UiSetValueTouchButton.tsx:247


onRegistered

onRegistered(controller): void

Responds to when this component is registered with a controller.

Parameters

NameTypeDescription
controllerUiFocusControllerThe controller with which this component was registered.

Returns

void

Implementation of

UiFocusableComponent.onRegistered

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/TouchButton/UiSetValueTouchButton.tsx:198


onTouched

onTouched(button, state, setValue): TouchButtonOnTouchedAction

Responds to when this button is touched.

Parameters

NameTypeDescription
buttonSetValueTouchButton<S>The button that was touched.
stateSThe state that is bound to the button.
setValueSubscribableType<S>The value that the button sets.

Returns

TouchButtonOnTouchedAction

The action to take as a result of the button being touched.

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/TouchButton/UiSetValueTouchButton.tsx:231


onUiInteractionEvent

onUiInteractionEvent(event): boolean

Handles a UiInteractionEvent.

Parameters

NameTypeDescription
eventUiInteractionEventThe event to handle.

Returns

boolean

Whether the event was handled.

Implementation of

UiFocusableComponent.onUiInteractionEvent

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/TouchButton/UiSetValueTouchButton.tsx:220


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/TouchButton/UiSetValueTouchButton.tsx:311


simulatePressed

simulatePressed(ignoreDisabled?): void

Simulates this button being pressed. This will execute the onPressed() callback if one is defined.

Parameters

NameTypeDefault valueDescription
ignoreDisabledbooleanfalseWhether to simulate the button being pressed regardless of whether the button is disabled. Defaults to false.

Returns

void

Defined in

src/workingtitle-instruments-g3x-touch/html_ui/Pages/VCockpit/Instruments/NavSystems/G3XTouch/Shared/Components/TouchButton/UiSetValueTouchButton.tsx:186