CycleButton Class Reference

Inherits Menu.

List of all members.

Public Member Functions

int handle (int)
 CycleButton (int, int, int, int, const char *=0)

Static Public Attributes

NamedStyledefault_style

Protected Member Functions

void draw ()


Detailed Description

This widget lets the user select one of a set of choices by clicking on it. Each click cycles to the next choice. Holding down any shift key or using the middle or right mouse button cycles backwards.

Notice that the number of items can be 2. In this case this widget serves the common purpose of a "toggle" button that shows the current on/off state by changing it's label.

This is a subclass of Menu. The possible states are defined by using Menu::add() or other methods that define the menu items. You can also put a different callback on each item. Or you can replace this widget's callback with your own and use value() to get the index of the current setting. Items that are not visible() or are not active() are skipped by the cycling.

If you set buttonbox() to NO_BOX then you must define your items to draw identical-sized and fully opaque images, so that drawing one completely obscures any other one. This was done to avoid blinking when drawing "artistic" user interfaces where all the entire button is an image.


The documentation for this class was generated from the following files:
Sun Jan 7 00:55:17 2007. FLTK ©2006 Bill Spitzak and others.
Permission is granted to reproduce this manual or any portion for any purpose, provided this copyright and permission notice are preserved.