Next: , Previous: , Up: Positioner Object   [Contents][Index]


17.4.3 Positioner Interaction

The user changes the setting of the positioner using the mouse inside the box. Per default whenever the values changes, the object is returned by the interaction routines or its callback invoked (if one exists.

To change the default use the function

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

where when can be one of the following

FL_RETURN_NONE

Never report or invoke callback.

FL_RETURN_END_CHANGED

Return or invoke callback at end (mouse release) and only when the positioner ended in a different position than the one it started from.

FL_RETURN_CHANGED

Return or invoke callback whenever the positioners value is changed, default setting.

FL_RETURN_END

Return or invoke callback at the end only but regardless if the positioners value changed or not.

FL_RETURN_ALWAYS

Return or invoke callback when value has changed or mouse button has been released.

Per default a positioner only reacts to the left mouse button. But sometimes it can be useful to modify which mouse buttons it will reacts to. To set this use

void fl_set_positioner_mouse_buttons(FL_OBJECT *obj,
                                     int mbuttons);

mbuttons is the bitwise OR of the numbers 1 for the left mouse button, 2 for the middle, 4 for the right mouse button, 8 for moving the scroll wheel up "button" and 16 for scrolling down "button".

To determine which mouse buttons a positioner reacts to use

void fl_get_positioner_mouse_buttons(FL_OBJECT *obj,
                                     unsigned int *mbuttons);

The value returned via mbuttons is the same value as would be used in fl_set_positioner_mouse_buttons().

Sometimes you may want to assign different meanings to the mouse buttons used to interact with the positioner. To find out which one has been used there’s the function

int fl_get_positioner_numb(FL_OBJECT *obj);

It returns one of the constants FL_LEFT_MOUSE, FL_MIDDLE_MOUSE, FL_RIGHT_MOUSE, FL_SCROLLUP_MOUSE or FL_SCROLLDOWN_MOUSE (the latter two are from the scroll wheel of the mouse).


Next: , Previous: , Up: Positioner Object   [Contents][Index]