The only difference between this and a Fl_Menu_Button is that the name of the most recent chosen menu item is displayed inside the box, while the label is displayed outside the box. However, since the use of this is most often to control a single variable rather than do individual callbacks, some of the Fl_Menu_Button methods are redescribed here in those terms.
When the user picks an item off the menu the value() is set to that item and then the callback is done.
All three mouse buttons pop up the menu. The Forms behavior of the first two buttons to increment/decrement the choice is not implemented. This could be added with a subclass, however.
The menu will also pop up in response to shortcuts indicated by putting a '&' character in the label(). See Fl_Button for a description of this.
Typing the shortcut() of any of the items will do exactly the same as when you pick the item with the mouse. The '&' character in item names are only looked at when the menu is popped up, however.
Fl_Choice::Fl_Choice(int,int,int,int,const char * =0);
int Fl_Choice::value() const ;
int Fl_Choice::value(int);
int Fl_Choice::value(const Fl_Menu *);
int Fl_Widget::changed() const;
void Fl_Widget::set_changed();
void Fl_Widget::clear_changed();
Fl_When Fl_Widget::when() const;
void Fl_Widget::when(Fl_When);
FL_WHEN_RELEASE
:0
: The callback is not done, instead changed() is
turned on.
FL_WHEN_RELEASE
: The callback is done when the user
picks an item.
FL_WHEN_RELEASE|FL_WHEN_NOT_CHANGED
: Does the callback
even if the user picks the same value.
Fl_Boxtype Fl_Choice::down_box() const ;
void Fl_Choice::down_box(Fl_Boxtype);