IupSpinBox

Definition: include pGUI.e

Ihandle ih = IupSpin()
-- and --
Ihandle ih = IupSpinBox(Ihandln child=NULL, string attributes="", sequence data={})
Description: The IupSpin function creates a control set with a vertical box containing two buttons, one with an up arrow and the other with a down arrow, to be used to increment and decrement values.

Unlike the SPIN attribute of the IupText element, the IupSpin element can NOT automatically increment the value and it is NOT inserted inside the IupText area. But they can be used with any element.

IupSpin inherits from IupVbox, and contains two IupButton.

IupSpinBox is a horizontal container that already contains an IupSpin.

child: Identifier of an interface element which will receive the spinbox.
For more information on the attributes and data parameters see IupSetAttributes, and IupVbox for a list of the attributes that may apply here.

Returns: the identifier of the created element.
Notes: An IupSpinBox can be created with no elements and filled dynamically using IupAppend() or IupInsert().

IupSpinbox (with a lower case 'b') is a simple alias of IupSpinBox and behaves identically.

There is little point using an IupSpin directly, without associating it to some other visual element in much the same way that IupSpinBox does.

In many cases an IupText element with the SPIN attribute may be a better choice.
There is an example ("Width:") of an IupText with the SPIN attribute on the toolbox ("Tools" window) of demo\pGUI\simple_paint.exw
Callbacks:
SPIN_CB Called each time the user clicks in the buttons.
It will increment 1 and decrement -1 by default.
Holding the Shift key will set a factor of 2, holding Ctrl a factor of 10, and both a factor of 100.

function spin_cb(Ihandle ih, integer inc)
Example: Ihandle spinbox = IupSpinBox(IupText(NULL))

See Also: IupText, IupVbox, IupHbox, IupButton