Public Member Functions | |
int | handle (int) |
CycleButton (int, int, int, int, const char *=0) | |
Static Public Attributes | |
NamedStyle * | default_style |
Protected Member Functions | |
void | draw () |
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.