Class: UiTouchButtonFocusModule
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Components/TouchButton/UiTouchButtonFocusModule.ts:41
A module which handles UI focus for a touchscreen button.
The module syncs whether it can be focused with whether its parent button is enabled. When registered with a focus
controller, the module will attempt to set focus on itself. Finally, the module handles adding the
ui-button-focused CSS class to the button's class list when focused.
Implements
Constructors
Constructor
new UiTouchButtonFocusModule(
button,isButtonVisible,isButtonEnabled,buttonCanBeFocused,cssClass?,options?):UiTouchButtonFocusModule
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Components/TouchButton/UiTouchButtonFocusModule.ts:72
Creates a new instance of UiTouchButtonFocusModule.
Parameters
| Parameter | Type | Description |
|---|---|---|
button | FocusableTouchButton | This module's parent button. |
isButtonVisible | undefined | boolean | Subscribable<boolean> | Whether this module's parent button is visible. |
isButtonEnabled | undefined | boolean | Subscribable<boolean> | Whether this module's parent button is enabled. |
buttonCanBeFocused | undefined | boolean | Subscribable<boolean> | Whethe this module's parent button can be focused. |
cssClass? | string | ToggleableClassNameRecord | SubscribableSet<string> | CSS class(es) to apply to this module's parent button. |
options? | Readonly<UiTouchButtonFocusModuleOptions> | Options with which to configure this module. |
Returns
UiTouchButtonFocusModule
Properties
canBeFocused
readonlycanBeFocused:Subscribable<boolean>
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Components/TouchButton/UiTouchButtonFocusModule.ts:49
Whether this component can be focused.
Implementation of
UiFocusableComponent.canBeFocused
cssClass
readonlycssClass:SubscribableSet<string>
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Components/TouchButton/UiTouchButtonFocusModule.ts:59
The set of CSS classes to apply to this module's parent button, including any that are applied by this module.
isEnabled
readonlyisEnabled:Subscribable<boolean>
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Components/TouchButton/UiTouchButtonFocusModule.ts:52
Whether this module's parent button is enabled.
isUiFocusableComponent
readonlyisUiFocusableComponent:true=true
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Components/TouchButton/UiTouchButtonFocusModule.ts:43
Flags this component as a UiFocusableComponent.
Implementation of
UiFocusableComponent.isUiFocusableComponent
isVisible
readonlyisVisible:Subscribable<boolean>
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Components/TouchButton/UiTouchButtonFocusModule.ts:55
Whether this module's parent button is visible.
Methods
destroy()
destroy():
void
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Components/TouchButton/UiTouchButtonFocusModule.ts:167
Destroys this module.
Returns
void
focusButton()
focusButton():
void
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Components/TouchButton/UiTouchButtonFocusModule.ts:110
Attempts to set focus on this module's parent button.
Returns
void
onButtonTouched()
onButtonTouched():
void
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Components/TouchButton/UiTouchButtonFocusModule.ts:119
Responds to when this module's parent button is touched.
Returns
void
onDeregistered()
onDeregistered():
void
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Components/TouchButton/UiTouchButtonFocusModule.ts:129
Responds to when this component is deregistered with a controller.
Returns
void
Implementation of
UiFocusableComponent.onDeregistered
onFocusGained()
onFocusGained():
void
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Components/TouchButton/UiTouchButtonFocusModule.ts:134
Responds to when this component gains focus.
Returns
void
Implementation of
UiFocusableComponent.onFocusGained
onFocusLost()
onFocusLost():
void
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Components/TouchButton/UiTouchButtonFocusModule.ts:139
Responds to when this component loses focus.
Returns
void
Implementation of
UiFocusableComponent.onFocusLost
onRegistered()
onRegistered(
controller):void
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Components/TouchButton/UiTouchButtonFocusModule.ts:124
Responds to when this component is registered with a controller.
Parameters
| Parameter | Type | Description |
|---|---|---|
controller | UiFocusController | The controller with which this component was registered. |
Returns
void
Implementation of
UiFocusableComponent.onRegistered
onUiInteractionEvent()
onUiInteractionEvent(
event):boolean
Defined in: src/workingtitle-instruments-g3x-touch/html_ui/Shared/Components/TouchButton/UiTouchButtonFocusModule.ts:144
Handles a UiInteractionEvent.
Parameters
| Parameter | Type | Description |
|---|---|---|
event | UiInteractionEvent | The event to handle. |
Returns
boolean
Whether the event was handled.