Skip to main content

Class: MultipleSoftKeyEnumController<T>

Defined in: src/garminsdk/softkey/SoftKeyControllers.ts:168

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

Type Parameter
T

Constructors

Constructor

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

Defined in: src/garminsdk/softkey/SoftKeyControllers.ts:181

Constructor.

Parameters

ParameterTypeDescription
softkeyMenuSoftKeyMenuThe softkey menu to which this controller's bound softkeys belong.
stateMutableSubscribable<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>

Methods

destroy()

destroy(): void

Defined in: src/garminsdk/softkey/SoftKeyControllers.ts:218

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

Returns

void


init()

init(): readonly SoftKeyMenuItem[]

Defined in: src/garminsdk/softkey/SoftKeyControllers.ts:194

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.