class Fl_Hold_Browser : public Fl_Browser
This is a subclass of Fl_Browser which lets the user select a single
item, or no items by clicking on the empty space. As long as the
mouse button is held down the item pointed to by it is highlighted,
and this highlighting remains on when the mouse button is released.
Normally the callback is done when the user releases the mouse, but
you can change this with when().
See Fl_Browser for methods to add and remove lines from the browser.
Fl_Hold_Browser::Fl_Hold_Browser(int x,int y,int w,int h,const char
*l)
Constructor.
uchar Fl_Widget::when() const;
void Fl_Widget::when(uchar);
Controls when callbacks are done. The following values are useful,
the default value is FL_WHEN_RELEASE
:
0
: The callback is not done, instead changed() is
turned on.
FL_WHEN_CHANGED
: The callback is done as the user
drags the mouse, each time the selected item changes.
FL_WHEN_RELEASE
(default value) : The callback will
be done when the user releases the mouse if they picked a different
value.
FL_WHEN_RELEASE|FL_WHEN_NOT_CHANGED
will do the callback
even if the user picks the same value.
uchar Fl_Browser::selection_color() const ;
void Fl_Browser::selection_color(n);
The color to draw the background of selected lines. Lines that aren't
selected use color().
int Fl_Browser::value() const ;
void Fl_Browser::value(int) ;
Set or get which line is selected. This returns zero if no line is
selected, be aware that this can happen in a callback.
int Fl_Browser::deselect();
Same as Fl_Browser::value(0).
int Fl_Browser::select(int,int=1);
int Fl_Browser::selected(int) const ;
You can use these for compatibility with the Fl_Multi_Browser.
However if you turn on the selection of more than one line the results
are unpredictable.