Skip to main content

Class: MultipleSoftKeyEnumController<T>

A controller which binds one or more softkeys to a state which can take one or more enumerated values. Each softkey is bound to a specific value. Once bound, each softkey will display whether the state is equal to its bound value, and each press of the softkey will set the state to its bound value.

Type parameters

Name
T

Constructors

constructor

new MultipleSoftKeyEnumController<T>(softkeyMenu, state, softkeyDefs): MultipleSoftKeyEnumController<T>

Constructor.

Type parameters

Name
T

Parameters

NameTypeDescription
softkeyMenuSoftKeyMenuThe softkey menu to which this controller's bound softkeys belong.
stateMutableSubscribable<T, T>The state bound to this controller's softkeys.
softkeyDefsMultipleSoftkeyEnumDef<T>[]The definitions for the softkeys bound to this controller's setting.

Returns

MultipleSoftKeyEnumController<T>

Defined in

src/garminsdk/softkey/SoftKeyControllers.ts:181

Methods

destroy

destroy(): void

Destroys this controller. This will remove the softkey menu items bound to this controller's state.

Returns

void

Defined in

src/garminsdk/softkey/SoftKeyControllers.ts:218


init

init(): readonly SoftKeyMenuItem[]

Initializes this controller. This will create softkey menu items and bind them to this controller's state.

Returns

readonly SoftKeyMenuItem[]

The softkey menu items bound to this controller's state. The order of the items is the same as the order of the softkey definitions passed to this controller's constructor.

Throws

Error if this controller has been destroyed.

Defined in

src/garminsdk/softkey/SoftKeyControllers.ts:194