Table Spinner
Spinner: a component that show arrows to select value in a pre-defined list.
Summary
Field | Type | Summary |
---|---|---|
IsIgnoreCtrlShift | boolean | Ignore Ctrl and Shift strokes that navigate faster? |
IsSearchable | boolean | Does the spinner accept alpha-numeric strokes to search a value? |
Value | string | Value of the spinner |
ValueAsCaption | boolean | Display value (Map key, table index...) instead of label? |
Return type | Function and summary |
---|---|
NextValue(Dialog dlg, Spinner spinner) Select the next value. | |
OnChange(Dialog dlg, Spinner spinner, string oldValue, string newValue) Function fired when value is modified. | |
PreviousValue(Dialog dlg, Spinner spinner) Select the previous value. | |
boolean | Search(Dialog dlg, Spinner spinner, string startsWith) Search and select next value which label starts with startsWith If the end of the list is reached, the search restarts to the top of the list. |
SetValuesList(Dialog dlg, Spinner spinner, table valuesList, string defaultValue, boolean changeFocusableState, string newValue) Change the list of values in the Spinner. |
Fields
string Spinner.Value
Value of the spinner
boolean Spinner.ValueAsCaption
Display value (Map key, table index...) instead of label?
For accessibility, label is pronounced.
boolean Spinner.IsIgnoreCtrlShift
Ignore Ctrl and Shift strokes that navigate faster?
false
by default. Set it to true
if you assign shortcut with Ctrl and Shift to the Spinner or its two buttons, or if it's not relevant, not enough entries.
boolean Spinner.IsSearchable
Does the spinner accept alpha-numeric strokes to search a value?
By default enabled, when Spinner is focused or under mouse pointer, keystrokes are processed to search an entry in the spinner. This is a fast way to navigate typing the first letters of an entry. Disable it to let keystroke active shortcuts in the dialog, or if search is no relevant.
Functions
Spinner.SetValuesList(Dialog dlg, Spinner spinner, table valuesList, string defaultValue, boolean changeFocusableState, string newValue)
Change the list of values in the Spinner.
After creation, you can change the list of values.
Parameter | Type | Default | Description |
---|---|---|---|
dlg | Dialog | dlg | |
spinner | Spinner | spinner | |
valuesList | table |
| |
defaultValue | string | nil | Default value from the list. If nil first value from the list is selected. |
changeFocusableState | boolean | true | Set it to false if you don't want to modify .IsFocusable value, even if the list has more than 1 item. |
newValue | string | newValue |
Spinner.OnChange(Dialog dlg, Spinner spinner, string oldValue, string newValue)
Function fired when value is modified.
Spinner.PreviousValue(Dialog dlg, Spinner spinner)
Select the previous value.
This will be really visible on next OnIdle event.
Spinner.NextValue(Dialog dlg, Spinner spinner)
Select the next value.
This will be really visible on next OnIdle event.
Spinner.Search(Dialog dlg, Spinner spinner, string startsWith)
Search and select next value which label starts with startsWith If the end of the list is reached, the search restarts to the top of the list.
This will be really visible on next OnIdle event.
Parameter | Type | Default | Description |
---|---|---|---|
dlg | Dialog | The MyrScript Dialog object | |
spinner | Spinner | spinner | |
startsWith | string | startsWith |
- Return
- boolean:
true
if the search gave different result,false
if the only one is already selected, that means no change.