CreateSpinBox ( x,y,width,height,group[,style] )
Parameters
|
x,y - position of the spin box's top-left corner within the group's client area width,height - size of the spin box group - window or gadget group that owns the spin box style (optional) - 0 (default); the control is integer-only |
Description
|
Creates an integer spin box - an edit field with up/down arrows - and returns its handle. Requires Extended language mode. The precise-number control for inspector panels: position, count, grid size. The user can click the arrows to step the value or type a signed decimal number directly; typed text commits on Enter or when focus leaves the field, and invalid text quietly reverts to the last good value. A new spin box has range 0 to 100, value 0 and step 1 - change these with SetSpinBoxRange, SetSpinBoxValue and SetSpinBoxStep, all of which clamp into range. Read the current value with SpinBoxValue. User changes post a critical gadget-action event ($401) with the normalized value already in EventData; programmatic setters are silent. One gotcha: SetGadgetText on a spin box must be given valid integer text, otherwise it raises an Invalid spin box value runtime error - prefer SetSpinBoxValue. See it working in the native input controls sample. See also: SetSpinBoxRange, SetSpinBoxValue, SpinBoxValue, SetSpinBoxStep, CreateTrackBar, CreateTextField. |
Index