SPINEDIT item type

Defines a spin box widget to enter integer values.

SPINEDIT item basics

The SPINEDIT form item defines a field where the users can increase or decrease the number value by a specific increment by clicking an up or down arrow button, or by typing the value directly into the text edit box.

Use a SMALLINT or INTEGER variable with a SLIDER form item. Larger types like BIGINT or DECIMAL are not supported.

Defining a SPINEDIT

The increment between two values is defined by the STEP attribute:
SPINEDIT ...
   STEP = 5;

The VALUEMIN and VALUEMAX attributes define respectively the lower and upper integer limit of the spin-edit range. There is no default minimum or maximum value for the SPINEDIT widget.

This widget is not designed for CONSTRUCT, as you can only enter an integer value.

Some front-ends support different presentation and behavior options, which can be controlled by a STYLE attribute. For more details, see Common style attributes.

Detecting SPINEDIT modification

To inform the dialog when a value changes, define an ON CHANGE block for the SPINEDIT field. The program can then react immediately to user changes in the field:

-- Form file (grid layout)
SLIDER s1 = options.opts_rate,
   VALUEMIN=0, VALUEMAX=100;

-- Program file:
ON CHANGE opts_rate
   -- The value of the spinedit has changed

For more details, see Reacting to field value changes.

Where to use a SPINEDIT

A SPINEDIT form item can be defined in two different ways:
  1. With an item tag and a SPINEDIT item definition in a grid-layout container (GRID, SCROLLGRID and TABLE).
  2. As a SPINEDIT stack item in a STACK container.