## Spinner

### Description

The Spinner class implements the Spinner control, a pair of up-down or left-right arrows for incrementing/decrementing a value.

The Spinner properties are:

`style`: 0=Vertical 1=Horizontal (Not needed under MacOS - the `where` property determines the orientation).

`value`: An integer giving the current value

`range`: A pair of integers giving the minimum and maximum values (default 0 100)

`increment`: The step by which the value property will change each time the user clicks one of the arrows

`wrap`: A boolean indicating if the value wraps round when the maximum/minimum is passed.

`tooltip`: Provides help text when the user moves the mouse pointer over the control and pauses.

The `onChange` callback is invoked when the user changes the value.

### Example

         ’DEMO_Spinner;CB_SPIN;DEMO
    [1]   © Sample function demonstrating use of the Spinner object
    [2]   DEMO„'Œ' ŒNEW 'Dialog' ª DEMO.scale„1
    [3]   DEMO.title„'Spinner Example'
    [4]   DEMO.Spin.New 'Spinner' ª DEMO.Spin.style„1 ª DEMO.Spin.where„2 1
    [5]   DEMO.Spin.value„32 ª DEMO.Spin.range„0 50
    [6]   DEMO.Lab.New 'Label' ª DEMO.Lab.where„4 1 ª DEMO.Lab.caption„'Value 32'
    [7]   © Create callback function which will run when the user spins the control
    [8]   0 0½ŒFX 'CB_SPIN;X' 'X„DEMO.Spin.value' 'DEMO.Lab.caption„''Value: '',•X'
    [9]   DEMO.Spin.onChange„'CB_SPIN'
    [10]  ©
    [11]  © Wait for the user to close the window
    [12]  0 0½ŒWE DEMO
         ’

### Properties

align anchors aquaadjust autodraw caption children class color data doublebuffered dragsource droptarget enabled events extent handle increment maxsize methods minsize name opened order pointer properties range scale self size sourceformats style tabstop targetformats tie tooltip units value visible where winptr wrap

### Methods

Click Clienttoscreen Close Create Delete Draw Focus Hide New Open Paint Resize Screentoclient Send Set Show Trigger

### Callbacks

onChange onClick onClose onDblClick onDestroy onDragDrop onDragEnd onDragEnter onDragLeave onDragOver onDragStart onFocus onHide onKeyDown onKeyPress onKeyUp onMouseDown onMouseMove onMouseUp onOpen onSend onShow onUnFocus

Topic: APLX Help : System Classes : List of Classes : Spinner

[ Previous | Next | Contents | Index ]