Thumbwheel Interaction (XForms (Forms Library) - Version 1.2 (Rev. 4) A Graphical User Interface Toolkit for X)

Next: Other Thumbwheel Routines, Previous: Thumbwheel Types, Up: Thumbwheel Object [Contents][Index]

#### 17.7.3 Thumbwheel Interaction

Whenever the user changes the value of the thumbwheel using the mouse or keyboard, the thumbwheel is returned (or the callback called) by the interaction routines. You change the value of a thumbwheel by dragging the mouse inside the wheel area or, for vertical thumbwheels also by using the scroll wheel of the mouse. Each pixel of movement changes the value of the thumbwheel by 0.005, which you can change using the `fl_set_thumbwheel_step()` function.

The keyboard can be used to change the value of a thumbwheel. Specifically, the `<Up>` and `<Down>` cursor keys can be used to increment or decrement the value of a vertical thumbwheel and the `<Right>` and `<Left>` cursor keys can be used to increment or decrement the value of horizontal thumbwheel. Each pressing of the cursor key changes the thumbwheel value by the current step value. The `<Home>` key can be used to set the thumbwheel to a known value, which is the average of the minimum and the maximum value of the thumbwheel.

In some applications you might not want the thumbwheel to be returned all the time. To change the default, call the following routine:

    void fl_set_object_return(FL_OBJECT *obj, unsigned int when);

where the parameter `when` can be one of the four values

`FL_RETURN_NONE`

  Never return or invoke callback.

`FL_RETURN_END_CHANGED`

  Return or invoke callback at end (mouse release) if value is changed since last return.

`FL_RETURN_CHANGED`

  Return or invoke callback whenever the thumbwheel value is changed.

`FL_RETURN_END`

  Return or invoke callback at end (mouse release) regardless if the value is changed or not.

`FL_RETURN_ALWAYS`

  Return or invoke callback whenever the value changes or the mouse button is released.

See demo program `thumbwheel.c` for an example use of this.

Next: Other Thumbwheel Routines, Previous: Thumbwheel Types, Up: Thumbwheel Object [Contents][Index]