Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Fl_Choice Class Reference

This is a button that when pushed pops up a menu (or hierarchy of menus) defined by an array of child items. More...

#include <Fl_Choice.h>

Inheritance diagram for Fl_Choice:

Fl_Menu_ Fl_Widget List of all members.

Public Methods

 Fl_Choice (int x, int y, int w, int h, const char *l=0)
 Creates a new choice widget using the given position, size, and label string.

 Fl_Choice (const char *l=0, int layout_size=30, Fl_Align layout_al=FL_ALIGN_TOP, int label_w=100)
 The new style constructor creates the choice widget using the label, size, alignment, and label_width.

int value (int v)
 The value is the index into the Fl_Menu array of the last item chosen by the user. More...

int value () const
 The value is the index into the Fl_Menu array of the last item chosen by the user. More...

virtual int popup (int X, int Y, int W, int H)
virtual int handle (int)
virtual void draw ()
virtual void reset ()

Static Public Attributes

Fl_Named_Styledefault_style

Detailed Description

This is a button that when pushed pops up a menu (or hierarchy of menus) defined by an array of child items.

The appearance is designed to look like a Windows "combo box" but it is somewhat different in that it does not contain a text editor, also the menu pops up with the current item under the cursor, which is immensely easier to use once you get used to it. Motif calls this an OptionButton.

The user can change the value by popping up the menu by clicking anywhere in the widget and moving the cursor to a different item, or by typing up and down arrow keys to cycle amoung the items. Typing the shortcut() of any of the items will also change the value to that item (The '&' character in item names are only looked at when the menu is popped up, however).

The menu will also pop up in response to shortcuts indicated by putting a '&' character in the label() or to the shortcut() of the Fl_Choice widget itself. The user can then use arrow keys or the mouse to change the selected item.

When the user changes the value() the callback is done.

Definition at line 39 of file Fl_Choice.h.


Member Function Documentation

int Fl_Choice::value   const [inline]
 

The value is the index into the Fl_Menu array of the last item chosen by the user.

It is zero initially. You can set it as an integer. Returns current selected item index.

Reimplemented from Fl_Menu_.

Definition at line 61 of file Fl_Choice.h.

int Fl_Choice::value int    v
 

The value is the index into the Fl_Menu array of the last item chosen by the user.

It is zero initially. You can set it as an integer. The set routines return non-zero if the new value is different than the old one. Changing it causes a redraw().

Reimplemented from Fl_Menu_.


The documentation for this class was generated from the following file:
Generated on Thu Jul 31 15:33:47 2003 for eFLTK by doxygen1.2.15