Table NumberEdit
NumberEdit: a Component to enter a number within bounds, that accept keyboard and mouse wheel inputs.
Summary
| Field | Type | Summary |
|---|---|---|
| CtrlFactor | number | Factor when Ctrl is pressed, multiply amount. |
| DefaultValue | number | Default (factory) value. |
| DisplayValueMask | Display value mask string or function If nil (default), display the raw value. | |
| IsInverted | boolean | Invert increase/decrease directions. |
| MaxValue | number | Maximum value |
| MinValue | number | Minimum value |
| ShiftFactor | number | Factor when Shift is pressed, multiply amount. |
| Step | number | Step between two possible values |
| Value | number | Current value. |
| Return type | Function and summary |
|---|---|
| OnChange(Dialog dlg, NumberEdit nbEdit, number value) Function fired when value is modified. |
Fields
number NumberEdit.MinValue
Minimum value
number NumberEdit.MaxValue
Maximum value
number NumberEdit.Step
Step between two possible values
number NumberEdit.DefaultValue
Default (factory) value.
A dual click or Space reset value to this one.
number NumberEdit.Value
Current value.
boolean NumberEdit.IsInverted
Invert increase/decrease directions.
By default, a NumberEdit increase the value when scrolling upward, pressing Up arrow, and decrease when scrolling downward or pressing Down arrow.
In some case, it may be useful to invert directions, especially when value represents a top margin, a position from the top (staff line, chord line, lyrics in the staff area).
NumberEdit.DisplayValueMask
Display value mask string or function If nil (default), display the raw value.
If string (by default if an entry name.DisplayValueMask exists in lexicon), "%x" means the value, e.g. "%x Hz"
If function, accept a number as unique argument and must return a string.
number NumberEdit.ShiftFactor
Factor when Shift is pressed, multiply amount.
number NumberEdit.CtrlFactor
Factor when Ctrl is pressed, multiply amount.
Function
NumberEdit.OnChange(Dialog dlg, NumberEdit nbEdit, number value)
Function fired when value is modified.
| Parameter | Type | Default | Description |
|---|---|---|---|
| dlg | Dialog | The MyrScript Dialog object | |
| nbEdit | NumberEdit | The component | |
| value | number | The new value |