Interface: BgImgTouchButtonProps
Component props for BgImgTouchButton
Hierarchy
↳
BgImgTouchButtonProps
Properties
children
• Optional
children: DisplayChildren
[]
The children of the display component.
Inherited from
Defined in
src/sdk/components/FSComponent.ts:122
class
• Optional
class: string
| SubscribableSet
<string
>
CSS class(es) to apply to the button's root element.
Inherited from
Defined in
src/garminsdk/components/touchbutton/TouchButton.tsx:168
downImgSrc
• Optional
downImgSrc: string
| Subscribable
<string
>
The src of the button's "down" state background image. If not defined, the button will not display an image.
Defined in
src/garminsdk/components/touchbutton/BgImgTouchButton.tsx:10
dragThresholdPx
• Optional
dragThresholdPx: number
The distance, in pixels, the mouse can click and drag before the pad begins to ignore mouse events. Ignored if
inhibitOnDrag
is false
. Defaults to 40 pixels.
Inherited from
TouchButtonProps.dragThresholdPx
Defined in
src/garminsdk/components/touchbutton/TouchButton.tsx:156
focusOnDrag
• Optional
focusOnDrag: boolean
Whether the button should focus all mouse events when dragging and the button is primed or held, preventing the
events from bubbling up to any ancestors in the DOM tree. Defaults to false
.
Inherited from
Defined in
src/garminsdk/components/touchbutton/TouchButton.tsx:143
inhibitOnDrag
• Optional
inhibitOnDrag: boolean
Whether the button should stop responding to mouse events and instead forward them to its parent after clicking
and dragging for a certain distance defined by dragThresholdPx
along the axis defined by inhibitOnDragAxis
.
When mouse events are inhibited, the button cannot be primed or held. Defaults to false
.
Inherited from
TouchButtonProps.inhibitOnDrag
Defined in
src/garminsdk/components/touchbutton/TouchButton.tsx:150
inhibitOnDragAxis
• Optional
inhibitOnDragAxis: "both"
| "x"
| "y"
The axis along which dragging will trigger the inhibit function. Ignored if inhibitOnDrag
is false
.
Defaults to 'both'
.
Inherited from
TouchButtonProps.inhibitOnDragAxis
Defined in
src/garminsdk/components/touchbutton/TouchButton.tsx:162
isEnabled
• Optional
isEnabled: boolean
| Subscribable
<boolean
>
Whether the button is enabled, or a subscribable which provides it. Disabled buttons cannot be touched, primed,
pressed, or held. Defaults to true
.
Inherited from
Defined in
src/garminsdk/components/touchbutton/TouchButton.tsx:79
isHighlighted
• Optional
isHighlighted: boolean
| Subscribable
<boolean
>
Whether the button is highlighted, or a subscribable which provides it. Defaults to false
.
Inherited from
TouchButtonProps.isHighlighted
Defined in
src/garminsdk/components/touchbutton/TouchButton.tsx:82
isVisible
• Optional
isVisible: boolean
| Subscribable
<boolean
>
Whether the button is visible. Defaults to true
.
Inherited from
Defined in
src/garminsdk/components/touchbutton/TouchButton.tsx:85
label
• Optional
label: string
| VNode
| Subscribable
<string
>
The label for the button. Can be defined as either a static string
, a subscribable which provides the label
string
, or a VNode. If not defined, the button will not have a label.
If the label is defined as a VNode, all first-level DisplayComponents in the VNode tree will be destroyed when the button is destroyed.
Inherited from
Defined in
src/garminsdk/components/touchbutton/TouchButton.tsx:94
onDestroy
• Optional
onDestroy: () => void
A callback function which will be called when the button is destroyed.
Type declaration
▸ (): void
A callback function which will be called when the button is destroyed.
Returns
void
Inherited from
Defined in
src/garminsdk/components/touchbutton/TouchButton.tsx:165
onHoldEnded
• Optional
onHoldEnded: <B>(button
: B
, totalHoldDuration
: number
, endReason
: TouchButtonHoldEndReason
) => void
A function which is called when the button exits the held state.
Param
The button that was held.
Param
The total amount of time, in milliseconds, that the button was held.
Param
The reason that the button exited the held state.
Type declaration
▸ <B
>(button
, totalHoldDuration
, endReason
): void
A function which is called when the button exits the held state.
Type parameters
Name | Type |
---|---|
B | extends TouchButton <TouchButtonProps > = TouchButton <TouchButtonProps > |
Parameters
Name | Type | Description |
---|---|---|
button | B | The button that was held. |
totalHoldDuration | number | The total amount of time, in milliseconds, that the button was held. |
endReason | TouchButtonHoldEndReason | The reason that the button exited the held state. |
Returns
void
Inherited from
Defined in
src/garminsdk/components/touchbutton/TouchButton.tsx:137
onHoldStarted
• Optional
onHoldStarted: <B>(button
: B
) => TouchButtonHoldAction
A function which is called when the button enters the held state. If not defined, then the button will default to taking no specific action when it enters the held state.
Param
The button that is held.
Type declaration
▸ <B
>(button
): TouchButtonHoldAction
A function which is called when the button enters the held state. If not defined, then the button will default to taking no specific action when it enters the held state.
Type parameters
Name | Type |
---|---|
B | extends TouchButton <TouchButtonProps > = TouchButton <TouchButtonProps > |
Parameters
Name | Type | Description |
---|---|---|
button | B | The button that is held. |
Returns
The action to take. Ignored if the value is equal to TouchButtonHoldAction.EndHold.
Inherited from
TouchButtonProps.onHoldStarted
Defined in
src/garminsdk/components/touchbutton/TouchButton.tsx:117
onHoldTick
• Optional
onHoldTick: <B>(button
: B
, dt
: number
, totalTime
: number
, timeSinceLastPress
: number
) => TouchButtonHoldAction
A function which is called every frame when the button is held. If not defined, then the button will default to taking no specific action with each frame tick.
Param
The button that is held.
Param
The elapsed time, in milliseconds, since the previous frame.
Param
The total amount of time, in milliseconds, that the button has been held.
Param
The amount of time, in milliseconds, that the button has been held since the last time the button was pressed as a tick action.
Type declaration
▸ <B
>(button
, dt
, totalTime
, timeSinceLastPress
): TouchButtonHoldAction
A function which is called every frame when the button is held. If not defined, then the button will default to taking no specific action with each frame tick.
Type parameters
Name | Type |
---|---|
B | extends TouchButton <TouchButtonProps > = TouchButton <TouchButtonProps > |
Parameters
Name | Type | Description |
---|---|---|
button | B | The button that is held. |
dt | number | The elapsed time, in milliseconds, since the previous frame. |
totalTime | number | The total amount of time, in milliseconds, that the button has been held. |
timeSinceLastPress | number | The amount of time, in milliseconds, that the button has been held since the last time the button was pressed as a tick action. |
Returns
The action to take.
Inherited from
Defined in
src/garminsdk/components/touchbutton/TouchButton.tsx:129
onPressed
• Optional
onPressed: <B>(button
: B
, isHeld
: boolean
) => void
A callback function which will be called every time the button is pressed.
Param
The button that was pressed.
Param
Whether the button was held when it was pressed.
Type declaration
▸ <B
>(button
, isHeld
): void
A callback function which will be called every time the button is pressed.
Type parameters
Name | Type |
---|---|
B | extends TouchButton <TouchButtonProps > = TouchButton <TouchButtonProps > |
Parameters
Name | Type | Description |
---|---|---|
button | B | The button that was pressed. |
isHeld | boolean | Whether the button was held when it was pressed. |
Returns
void
Inherited from
Defined in
src/garminsdk/components/touchbutton/TouchButton.tsx:109
onTouched
• Optional
onTouched: <B>(button
: B
) => TouchButtonOnTouchedAction
A callback function which will be called every time the button is touched (i.e. a mouse down event on the button is detected). If not defined, then the button will default to entering the primed state when touched.
Param
The button that was touched.
Type declaration
▸ <B
>(button
): TouchButtonOnTouchedAction
A callback function which will be called every time the button is touched (i.e. a mouse down event on the button is detected). If not defined, then the button will default to entering the primed state when touched.
Type parameters
Name | Type |
---|---|
B | extends TouchButton <TouchButtonProps > = TouchButton <TouchButtonProps > |
Parameters
Name | Type | Description |
---|---|---|
button | B | The button that was touched. |
Returns
The action to take as a result of the button being touched.
Inherited from
Defined in
src/garminsdk/components/touchbutton/TouchButton.tsx:102
ref
• Optional
ref: NodeReference
<any
>
A reference to the display component.
Inherited from
Defined in
src/sdk/components/FSComponent.ts:125
upImgSrc
• Optional
upImgSrc: string
| Subscribable
<string
>
The src of the button's "up" state background image. If not defined, the button will not display an image.
Defined in
src/garminsdk/components/touchbutton/BgImgTouchButton.tsx:7