Table Knob

Knob: a component to pick a value between a min and a max, that accept keyboard and mouse wheel inputs.

See
SMDialog:addKnob

Summary

FieldTypeSummary
ArcColorstringColor of the arc (from min to max) in RRGGBB format.
DefaultValuenumberDefault (factory) value.
DisplayValueMask Display value mask string or function If nil (default), display the raw value.
GraduationstableGraduations of the knob.
GraduationsColorstringColor of the graduations in RRGGBB format.
IsVisibleMinMaxbooleanAre min and max visibles?
IsVisibleValuebooleanIs the value displayed at the center of the knob?
MaxValuenumberMaximum value
MinValuenumberMinimum value
StepnumberStep between two possible values
TextColorstringColor of texts (min, max, value) in RRGGBB format.
ValuenumberValue of the slider
ValueColorstringSelected value color, in RRGGBB format.
Return typeFunction and summary
 OnChange(Dialog dlg, Knob knob, number value)
Function fired when value is modified.

Fields

number Knob.MinValue

Minimum value

number Knob.MaxValue

Maximum value

boolean Knob.IsVisibleValue

Is the value displayed at the center of the knob?

Knob.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.

boolean Knob.IsVisibleMinMax

Are min and max visibles?

number Knob.Step

Step between two possible values

number Knob.DefaultValue

Default (factory) value.

A dual click on the slider reset value to this one.

number Knob.Value

Value of the slider

table Knob.Graduations

Graduations of the knob.

By default, no graduation. table of values, or values with alternative label.

Example
knobVolume.Graduations = {0, 16, 32, 48, 64, 80, 96, 112, 127}
 knobPanning.Graduations = {{0,"Left"}, 16, 32, 48, {64,"Center"}, 80, 96, 112, {127,"Right"}}

string Knob.ArcColor

Color of the arc (from min to max) in RRGGBB format.

Default is "2299BB"

string Knob.GraduationsColor

Color of the graduations in RRGGBB format.

Default is "444444"

string Knob.ValueColor

Selected value color, in RRGGBB format.

Default is "000000"

string Knob.TextColor

Color of texts (min, max, value) in RRGGBB format.

Default is "000000"

Function

Knob.OnChange(Dialog dlg, Knob knob, number value)

Function fired when value is modified.

ParameterTypeDefaultDescription
dlgDialog The MyrScript Dialog object
knobKnob The knob
valuenumber The new value of the knob