Class: SoftKeyEnumController<T>
A controller which binds a softkey to a state which can take one of several enumerated values. Once bound, the softkey will display the bound state and each press of the softkey will cycle the state through possible values.
Type parameters
Name |
---|
T |
Constructors
constructor
• new SoftKeyEnumController<T
>(softkeyMenu
, softkeyIndex
, softkeyLabel
, state
, textMap
, nextFunc
): SoftKeyEnumController
<T
>
Constructor.
Type parameters
Name |
---|
T |
Parameters
Name | Type | Description |
---|---|---|
softkeyMenu | SoftKeyMenu | The softkey menu to which this controller's softkey belongs. |
softkeyIndex | number | The index in the softkey menu at which this controller's softkey is located. |
softkeyLabel | string | The text label of this controller's softkey. |
state | MutableSubscribable <T , T > | The state bound to this controller's softkey. |
textMap | (value : T ) => string | A function which maps values to their text representations. |
nextFunc | (currentValue : T ) => T | A function which gets the next value given the current value. |
Returns
Defined in
src/garminsdk/softkey/SoftKeyControllers.ts:95
Methods
destroy
▸ destroy(): void
Destroys this controller. This will remove the softkey menu item bound to this controller's state.
Returns
void
Defined in
src/garminsdk/softkey/SoftKeyControllers.ts:131
init
▸ init(): SoftKeyMenuItem
Initializes this controller. This will create a softkey menu item and bind it to this controller's state.
Returns
The softkey menu item bound to this controller's state.
Throws
Error if this controller has been destroyed.
Defined in
src/garminsdk/softkey/SoftKeyControllers.ts:110