Skip to main content

Class: UserSettingSelectController<T, K>

Defined in: workingtitle-instruments-g1000/html_ui/Shared/UI/UserSettings/UserSettingSelectController.ts:10

A controller which binds a user setting that can take one of several enumerated values to a SelectControl component.

Extends​

Type Parameters​

Type Parameter
T extends UserSettingRecord
K extends keyof T & string

Constructors​

Constructor​

new UserSettingSelectController<T, K>(settingManager, settingName, values, selectControlRef): UserSettingSelectController<T, K>

Defined in: workingtitle-instruments-g1000/html_ui/Shared/UI/UserSettings/UserSettingSelectController.ts:24

Constructor.

Parameters​

ParameterTypeDescription
settingManagerUserSettingManager<T>This controller's settings manager.
settingNameKThe name of the setting associated with this controller.
valuesSubscribableArray<T[K]>A subscribable array which provides the values this controller can assign to its setting.
selectControlRefNodeReference<SelectControl<T[K]>>A node reference to the SelectControl which this controller controls.

Returns​

UserSettingSelectController<T, K>

Overrides​

UserSettingController.constructor

Properties​

itemSelectedHandler()​

itemSelectedHandler: (index, item, isRefresh) => void

Defined in: workingtitle-instruments-g1000/html_ui/Shared/UI/UserSettings/UserSettingSelectController.ts:15

A function which handles item selected events from the SelectControl component which this controller controls. This handler should be passed to the SelectControl component via its onItemSelected prop.

A callback which is called when an item is selected using the SelectControl component.

Parameters​

ParameterTypeDescription
indexnumberThe index of the selected item.
itemToNonNullable<PropertyTypeOf<T, K>> | undefinedThe selected item.
isRefreshbooleanWhether the selection was made due to a refresh.

Returns​

void


setting​

readonly setting: UserSetting<ToNonNullable<PropertyTypeOf<T, K>>>

Defined in: workingtitle-instruments-g1000/html_ui/Shared/UI/UserSettings/UserSettingController.ts:8

The setting associated with this controller.

Inherited from​

UserSettingController.setting


settingManager​

readonly settingManager: UserSettingManager<T>

Defined in: workingtitle-instruments-g1000/html_ui/Shared/UI/UserSettings/UserSettingSelectController.ts:25

This controller's settings manager.

Inherited from​

UserSettingController.settingManager


settingName​

readonly settingName: K

Defined in: workingtitle-instruments-g1000/html_ui/Shared/UI/UserSettings/UserSettingSelectController.ts:26

The name of the setting associated with this controller.

Inherited from​

UserSettingController.settingName


values​

readonly values: SubscribableArray<T[K]>

Defined in: workingtitle-instruments-g1000/html_ui/Shared/UI/UserSettings/UserSettingSelectController.ts:27

A subscribable array which provides the values this controller can assign to its setting.

Methods​

init()​

init(): void

Defined in: workingtitle-instruments-g1000/html_ui/Shared/UI/UserSettings/UserSettingSelectController.ts:34

Initializes this controller. This will immediately change the state of this controller's control component to reflect the current value of this controller's setting. Furthermore, any future changes to the setting's value will be synced to the control component.

Returns​

void

Overrides​

UserSettingController.init


onSettingChanged()​

protected onSettingChanged(value): void

Defined in: workingtitle-instruments-g1000/html_ui/Shared/UI/UserSettings/UserSettingSelectController.ts:39

A callback which is called when value of this control's setting is changed.

Parameters​

ParameterTypeDescription
valueT[K]The new value of the setting.

Returns​

void

Overrides​

UserSettingController.onSettingChanged