1998-10-20 01:39:29 +04:00
|
|
|
//
|
2005-02-25 00:55:12 +03:00
|
|
|
// "$Id$"
|
1998-10-20 01:39:29 +04:00
|
|
|
//
|
|
|
|
// Common browser header file for the Fast Light Tool Kit (FLTK).
|
|
|
|
//
|
2009-01-01 19:11:32 +03:00
|
|
|
// Copyright 1998-2009 by Bill Spitzak and others.
|
1998-10-20 01:39:29 +04:00
|
|
|
//
|
|
|
|
// This library is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Library General Public
|
|
|
|
// License as published by the Free Software Foundation; either
|
|
|
|
// version 2 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// Library General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Library General Public
|
|
|
|
// License along with this library; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
// USA.
|
|
|
|
//
|
2005-04-16 04:13:17 +04:00
|
|
|
// Please report all bugs and problems on the following page:
|
|
|
|
//
|
|
|
|
// http://www.fltk.org/str.php
|
1998-10-20 01:39:29 +04:00
|
|
|
//
|
1998-10-06 22:21:25 +04:00
|
|
|
|
2008-10-15 17:46:06 +04:00
|
|
|
/* \file
|
2008-09-16 11:26:22 +04:00
|
|
|
Fl_Browser_ widget . */
|
|
|
|
|
1998-10-06 22:21:25 +04:00
|
|
|
// Yes, I know this should be a template...
|
|
|
|
|
|
|
|
#ifndef Fl_Browser__H
|
|
|
|
#define Fl_Browser__H
|
|
|
|
|
|
|
|
#ifndef Fl_Group_H
|
|
|
|
#include "Fl_Group.H"
|
|
|
|
#endif
|
|
|
|
#include "Fl_Scrollbar.H"
|
2009-04-02 10:44:34 +04:00
|
|
|
#include <FL/Fl.H> // Fl::scrollbar_size()
|
1998-10-06 22:21:25 +04:00
|
|
|
|
2008-09-21 01:04:28 +04:00
|
|
|
#define FL_NORMAL_BROWSER 0 /**< type() of Fl_Browser */
|
|
|
|
#define FL_SELECT_BROWSER 1 /**< type() of FL_Select_Browser */
|
|
|
|
#define FL_HOLD_BROWSER 2 /**< type() of Fl_Hold_Browser */
|
|
|
|
#define FL_MULTI_BROWSER 3 /**< type() of Fl_Multi_Browser */
|
1998-10-06 22:21:25 +04:00
|
|
|
|
2009-03-26 02:09:04 +03:00
|
|
|
#define FL_SORT_ASCENDING 0 /**< sort browser items in ascending alphabetic order. */
|
|
|
|
#define FL_SORT_DESCENDING 1 /**< sort in descending order */
|
2008-12-27 00:20:38 +03:00
|
|
|
|
2008-09-14 16:45:42 +04:00
|
|
|
/**
|
2009-03-26 02:09:04 +03:00
|
|
|
This is the base class for browsers. To be useful it must be
|
2008-09-14 16:45:42 +04:00
|
|
|
subclassed and several virtual functions defined. The Forms-compatible
|
|
|
|
browser and the file chooser's browser are subclassed off of this.
|
2008-09-21 01:04:28 +04:00
|
|
|
|
|
|
|
This has been designed so that the subclass has complete control
|
2008-09-14 16:45:42 +04:00
|
|
|
over the storage of the data, although because next() and
|
|
|
|
prev() functions are used to index, it works best as a linked list
|
|
|
|
or as a large block of characters in which the line breaks must be
|
2008-09-21 01:04:28 +04:00
|
|
|
searched for.
|
|
|
|
|
|
|
|
A great deal of work has been done so that the "height" of a data
|
2008-09-14 16:45:42 +04:00
|
|
|
object does not need to be determined until it is drawn. This is
|
|
|
|
useful if actually figuring out the size of an object requires
|
|
|
|
accessing image data or doing stat() on a file or doing some
|
|
|
|
other slow operation.
|
|
|
|
*/
|
2002-08-14 20:49:38 +04:00
|
|
|
class FL_EXPORT Fl_Browser_ : public Fl_Group {
|
1998-10-06 22:21:25 +04:00
|
|
|
int position_; // where user wants it scrolled to
|
|
|
|
int real_position_; // the current vertical scrolling position
|
|
|
|
int hposition_; // where user wants it panned to
|
|
|
|
int real_hposition_; // the current horizontal scrolling position
|
|
|
|
int offset_; // how far down top_ item the real_position is
|
|
|
|
int max_width; // widest object seen so far
|
|
|
|
uchar has_scrollbar_; // which scrollbars are enabled
|
2008-04-23 23:09:28 +04:00
|
|
|
Fl_Font textfont_;
|
2008-08-16 01:11:21 +04:00
|
|
|
Fl_Fontsize textsize_;
|
2009-09-27 15:06:56 +04:00
|
|
|
Fl_Color textcolor_;
|
1998-10-06 22:21:25 +04:00
|
|
|
void* top_; // which item scrolling position is in
|
|
|
|
void* selection_; // which is selected (except for FL_MULTI_BROWSER)
|
|
|
|
void *redraw1,*redraw2; // minimal update pointers
|
|
|
|
void* max_width_item; // which item has max_width_
|
2009-04-02 10:44:34 +04:00
|
|
|
int scrollbar_size_; // size of scrollbar trough
|
1998-10-06 22:21:25 +04:00
|
|
|
|
2002-08-14 20:49:38 +04:00
|
|
|
void update_top();
|
1998-10-06 22:21:25 +04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
// All of the following must be supplied by the subclass:
|
2009-03-26 02:09:04 +03:00
|
|
|
/**
|
|
|
|
This method must be provided by the subclass
|
|
|
|
to return the first item in the list.
|
2009-03-27 19:52:31 +03:00
|
|
|
\see item_first(), item_next(), item_last(), item_prev()
|
2009-03-26 02:09:04 +03:00
|
|
|
*/
|
|
|
|
virtual void *item_first() const = 0;
|
|
|
|
/**
|
|
|
|
This method must be provided by the subclass
|
|
|
|
to return the item in the list after \p item.
|
2009-03-27 19:52:31 +03:00
|
|
|
\see item_first(), item_next(), item_last(), item_prev()
|
2009-03-26 02:09:04 +03:00
|
|
|
*/
|
|
|
|
virtual void *item_next(void *item) const = 0;
|
|
|
|
/**
|
|
|
|
This method must be provided by the subclass
|
|
|
|
to return the item in the list before \p item.
|
2009-03-27 19:52:31 +03:00
|
|
|
\see item_first(), item_next(), item_last(), item_prev()
|
2009-03-26 02:09:04 +03:00
|
|
|
*/
|
|
|
|
virtual void *item_prev(void *item) const = 0;
|
|
|
|
/**
|
|
|
|
This method must be provided by the subclass
|
|
|
|
to return the last item in the list.
|
2009-03-27 19:52:31 +03:00
|
|
|
\see item_first(), item_next(), item_last(), item_prev()
|
2009-03-26 02:09:04 +03:00
|
|
|
*/
|
|
|
|
virtual void *item_last() const { return 0L; }
|
2008-09-14 16:45:42 +04:00
|
|
|
/**
|
2009-03-26 02:09:04 +03:00
|
|
|
This method must be provided by the subclass to return
|
|
|
|
the height of \p item in pixels.
|
|
|
|
Allow for two additional pixels for the list selection box.
|
|
|
|
\param[in] item The item whose height is returned.
|
|
|
|
\returns The height of the specified \p item in pixels.
|
2009-03-27 19:52:31 +03:00
|
|
|
\see item_height(), item_width(), item_quick_height()
|
2008-09-14 16:45:42 +04:00
|
|
|
*/
|
2009-03-26 02:09:04 +03:00
|
|
|
virtual int item_height(void *item) const = 0;
|
2008-09-14 16:45:42 +04:00
|
|
|
/**
|
|
|
|
This method must be provided by the subclass to return the width of the
|
2009-03-26 02:09:04 +03:00
|
|
|
\p item in pixels. Allow for two additional pixels for the list
|
2008-09-14 16:45:42 +04:00
|
|
|
selection box.
|
2009-03-26 02:09:04 +03:00
|
|
|
\param[in] item The item whose width is returned.
|
|
|
|
\returns The width of the item in pixels.
|
2008-09-14 16:45:42 +04:00
|
|
|
*/
|
2009-03-26 02:09:04 +03:00
|
|
|
virtual int item_width(void *item) const = 0;
|
|
|
|
virtual int item_quick_height(void *item) const ;
|
2008-09-14 16:45:42 +04:00
|
|
|
/**
|
2009-03-26 02:09:04 +03:00
|
|
|
This method must be provided by the subclass to draw the \p item
|
|
|
|
in the area indicated by \p X, \p Y, \p W, \p H.
|
2008-09-14 16:45:42 +04:00
|
|
|
*/
|
2009-03-26 02:09:04 +03:00
|
|
|
virtual void item_draw(void *item,int X,int Y,int W,int H) const = 0;
|
2008-12-27 00:20:38 +03:00
|
|
|
/**
|
2009-03-26 02:09:04 +03:00
|
|
|
This optional method returns a string (label) that may be used for sorting.
|
|
|
|
\param[in] item The item whose label text is returned.
|
|
|
|
\returns The item's text label. (Can be NULL if blank)
|
2008-12-27 00:20:38 +03:00
|
|
|
*/
|
|
|
|
virtual const char *item_text(void *item) const { return 0L; }
|
|
|
|
/**
|
2009-03-26 02:09:04 +03:00
|
|
|
This optional method should be provided by the subclass
|
|
|
|
to efficiently swap browser items \p a and \p b, such as for sorting.
|
|
|
|
\param[in] a,b The two items to be swapped.
|
2008-12-27 00:20:38 +03:00
|
|
|
*/
|
2009-03-26 02:09:04 +03:00
|
|
|
virtual void item_swap(void *a,void *b) { }
|
2008-12-27 00:20:38 +03:00
|
|
|
/**
|
2009-03-26 02:09:04 +03:00
|
|
|
This method must be provided by the subclass
|
|
|
|
to return the item for the specified \p index.
|
|
|
|
\param[in] index The \p index of the item to be returned
|
|
|
|
\returns The item at the specified \p index.
|
2008-12-27 00:20:38 +03:00
|
|
|
*/
|
2009-03-26 02:09:04 +03:00
|
|
|
virtual void *item_at(int index) const { return 0L; }
|
1998-10-06 22:21:25 +04:00
|
|
|
// you don't have to provide these but it may help speed it up:
|
2002-08-14 20:49:38 +04:00
|
|
|
virtual int full_width() const ; // current width of all items
|
|
|
|
virtual int full_height() const ; // current height of all items
|
|
|
|
virtual int incr_height() const ; // average height of an item
|
1998-10-06 22:21:25 +04:00
|
|
|
// These only need to be done by subclass if you want a multi-browser:
|
2009-03-26 02:09:04 +03:00
|
|
|
virtual void item_select(void *item,int val=1);
|
|
|
|
virtual int item_selected(void *item) const ;
|
1998-10-06 22:21:25 +04:00
|
|
|
|
|
|
|
// things the subclass may want to call:
|
2009-03-26 02:09:04 +03:00
|
|
|
/**
|
|
|
|
Returns the item that appears at the top of the list.
|
|
|
|
*/
|
|
|
|
void *top() const { return top_; }
|
2008-09-14 16:45:42 +04:00
|
|
|
/**
|
|
|
|
Returns the item currently selected, or NULL if there is no selection.
|
|
|
|
|
2009-03-26 02:09:04 +03:00
|
|
|
For multiple selection browsers this call returns the currently focused item,
|
2008-09-14 16:45:42 +04:00
|
|
|
even if it is not selected. To find all selected items, call
|
|
|
|
Fl_Multi_Browser::selected() for every item in question.
|
|
|
|
*/
|
2009-03-26 02:09:04 +03:00
|
|
|
void *selection() const { return selection_; }
|
2002-08-14 20:49:38 +04:00
|
|
|
void new_list(); // completely clobber all data, as though list replaced
|
2009-03-26 02:09:04 +03:00
|
|
|
void deleting(void *item); // get rid of any pointers to item
|
2002-08-14 20:49:38 +04:00
|
|
|
void replacing(void *a,void *b); // change a pointers to b
|
2006-03-29 03:27:20 +04:00
|
|
|
void swapping(void *a,void *b); // exchange pointers a and b
|
2005-03-05 22:31:42 +03:00
|
|
|
void inserting(void *a,void *b); // insert b near a
|
2009-03-26 02:09:04 +03:00
|
|
|
int displayed(void *item) const ; // true if this item is visible
|
|
|
|
void redraw_line(void *item); // minimal update, no change in size
|
|
|
|
/**
|
|
|
|
This method will cause the entire list to be redrawn.
|
2009-03-27 19:52:31 +03:00
|
|
|
\see redraw_lines(), redraw_line()
|
2009-03-26 02:09:04 +03:00
|
|
|
*/
|
|
|
|
void redraw_lines() { damage(FL_DAMAGE_SCROLL); } // redraw all of them
|
|
|
|
void bbox(int &X,int &Y,int &W,int &H) const;
|
2002-08-14 20:49:38 +04:00
|
|
|
int leftedge() const; // x position after scrollbar & border
|
2009-03-26 02:09:04 +03:00
|
|
|
void *find_item(int ypos); // item under mouse
|
2008-09-21 01:04:28 +04:00
|
|
|
|
2002-08-14 20:49:38 +04:00
|
|
|
void draw();
|
2009-03-26 02:09:04 +03:00
|
|
|
Fl_Browser_(int X,int Y,int W,int H,const char *L=0);
|
1998-10-06 22:21:25 +04:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2009-03-26 02:09:04 +03:00
|
|
|
/**
|
|
|
|
Vertical scrollbar. Public, so that it can be accessed directly.
|
|
|
|
*/
|
2008-09-21 01:04:28 +04:00
|
|
|
Fl_Scrollbar scrollbar;
|
2009-03-26 02:09:04 +03:00
|
|
|
/**
|
|
|
|
Horizontal scrollbar. Public, so that it can be accessed directly.
|
|
|
|
*/
|
2008-09-21 01:04:28 +04:00
|
|
|
Fl_Scrollbar hscrollbar;
|
1998-10-06 22:21:25 +04:00
|
|
|
|
2009-03-26 02:09:04 +03:00
|
|
|
int handle(int event);
|
|
|
|
void resize(int X,int Y,int W,int H);
|
1998-10-06 22:21:25 +04:00
|
|
|
|
2009-03-26 02:09:04 +03:00
|
|
|
int select(void *item,int val=1,int docallbacks=0);
|
|
|
|
int select_only(void *item,int docallbacks=0);
|
2002-08-14 20:49:38 +04:00
|
|
|
int deselect(int docallbacks=0);
|
2008-09-14 16:45:42 +04:00
|
|
|
/**
|
2009-03-26 02:09:04 +03:00
|
|
|
Gets the vertical scroll position of the list as a pixel position \p pos.
|
|
|
|
The position returned is how many pixels of the list are scrolled off the top edge
|
|
|
|
of the screen. Example: A position of '3' indicates the top 3 pixels of
|
|
|
|
the list are scrolled off the top edge of the screen.
|
2009-03-27 19:52:31 +03:00
|
|
|
\see position(), hposition()
|
2008-09-14 16:45:42 +04:00
|
|
|
*/
|
2009-03-26 02:09:04 +03:00
|
|
|
int position() const { return position_; }
|
|
|
|
void position(int pos); // scroll to here
|
2008-09-14 16:45:42 +04:00
|
|
|
/**
|
2009-03-26 02:09:04 +03:00
|
|
|
Gets the horizontal scroll position of the list as a pixel position \p pos.
|
|
|
|
The position returned is how many pixels of the list are scrolled off the left edge
|
|
|
|
of the screen. Example: A position of '18' indicates the left 18 pixels of
|
|
|
|
the list are scrolled off the left edge of the screen.
|
2009-03-27 19:52:31 +03:00
|
|
|
\see position(), hposition()
|
2008-09-14 16:45:42 +04:00
|
|
|
*/
|
2009-03-26 02:09:04 +03:00
|
|
|
int hposition() const { return hposition_; }
|
2002-08-14 20:49:38 +04:00
|
|
|
void hposition(int); // pan to here
|
2009-03-26 02:09:04 +03:00
|
|
|
void display(void *item); // scroll so this item is shown
|
|
|
|
|
2008-09-14 16:45:42 +04:00
|
|
|
/**
|
2009-03-26 02:09:04 +03:00
|
|
|
Values for has_scrollbar().
|
|
|
|
*/
|
2009-03-27 19:52:31 +03:00
|
|
|
/** Anonymous enum bit flags for has_scrollbar().
|
|
|
|
- bit 0: horizontal
|
|
|
|
- bit 1: vertical
|
|
|
|
- bit 2: 'always' (to be combined with bits 0 and 1)
|
|
|
|
- bit 3-31: reserved for future use
|
|
|
|
*/
|
2009-03-26 02:09:04 +03:00
|
|
|
enum { // values for has_scrollbar()
|
2009-03-27 19:52:31 +03:00
|
|
|
HORIZONTAL = 1, ///< Only show horizontal scrollbar.
|
|
|
|
VERTICAL = 2, ///< Only show vertical scrollbar.
|
|
|
|
BOTH = 3, ///< Show both scrollbars. (default)
|
|
|
|
ALWAYS_ON = 4, ///< Specified scrollbar(s) should 'always' be shown (to be used with HORIZONTAL/VERTICAL)
|
|
|
|
HORIZONTAL_ALWAYS = 5, ///< Horizontal scrollbar always on.
|
|
|
|
VERTICAL_ALWAYS = 6, ///< Vertical scrollbar always on.
|
|
|
|
BOTH_ALWAYS = 7 ///< Both scrollbars always on.
|
2009-03-26 02:09:04 +03:00
|
|
|
};
|
|
|
|
/**
|
|
|
|
Returns the current scrollbar mode, see Fl_Browser_::has_scrollbar(uchar)
|
|
|
|
*/
|
|
|
|
uchar has_scrollbar() const { return has_scrollbar_; }
|
|
|
|
/**
|
|
|
|
Sets whether the widget should have scrollbars or not (default Fl_Browser_::BOTH).
|
2008-09-14 16:45:42 +04:00
|
|
|
By default you can scroll in both directions, and the scrollbars
|
2009-03-26 02:09:04 +03:00
|
|
|
disappear if the data will fit in the widget.
|
|
|
|
has_scrollbar() changes this based on the value of \p mode:
|
2008-09-14 16:45:42 +04:00
|
|
|
|
2009-03-26 02:09:04 +03:00
|
|
|
- 0 - No scrollbars.
|
|
|
|
|
|
|
|
- Fl_Browser_::HORIZONTAL - Only a horizontal scrollbar.
|
|
|
|
|
|
|
|
- Fl_Browser_::VERTICAL - Only a vertical scrollbar.
|
|
|
|
|
|
|
|
- Fl_Browser_::BOTH - The default is both scrollbars.
|
|
|
|
|
|
|
|
- Fl_Browser_::HORIZONTAL_ALWAYS - Horizontal scrollbar always on,
|
|
|
|
vertical always off.
|
|
|
|
|
|
|
|
- Fl_Browser_::VERTICAL_ALWAYS - Vertical scrollbar always on,
|
|
|
|
horizontal always off.
|
|
|
|
|
|
|
|
- Fl_Browser_::BOTH_ALWAYS - Both always on.
|
2008-09-14 16:45:42 +04:00
|
|
|
*/
|
2009-03-26 02:09:04 +03:00
|
|
|
void has_scrollbar(uchar mode) { has_scrollbar_ = mode; }
|
1998-10-06 22:21:25 +04:00
|
|
|
|
2008-09-14 16:45:42 +04:00
|
|
|
/**
|
2008-09-21 01:04:28 +04:00
|
|
|
Gets the default text font for the lines in the browser.
|
2009-03-27 19:52:31 +03:00
|
|
|
\see textfont(), textsize(), textcolor()
|
2008-09-14 16:45:42 +04:00
|
|
|
*/
|
2009-03-26 02:09:04 +03:00
|
|
|
Fl_Font textfont() const { return textfont_; }
|
2008-09-14 16:45:42 +04:00
|
|
|
/**
|
2009-03-26 02:09:04 +03:00
|
|
|
Sets the default text font for the lines in the browser to \p font.
|
2008-09-14 16:45:42 +04:00
|
|
|
*/
|
2009-03-26 02:09:04 +03:00
|
|
|
void textfont(Fl_Font font) { textfont_ = font; }
|
2008-09-21 01:04:28 +04:00
|
|
|
|
2008-09-14 16:45:42 +04:00
|
|
|
/**
|
2009-03-26 02:09:04 +03:00
|
|
|
Gets the default text size (in pixels) for the lines in the browser.
|
2008-09-14 16:45:42 +04:00
|
|
|
*/
|
2009-03-26 02:09:04 +03:00
|
|
|
Fl_Fontsize textsize() const { return textsize_; }
|
2008-09-21 01:04:28 +04:00
|
|
|
/**
|
2009-03-26 02:09:04 +03:00
|
|
|
Sets the default text size (in pixels) for the lines in the browser to \p size.
|
2008-09-21 01:04:28 +04:00
|
|
|
*/
|
2009-03-26 02:09:04 +03:00
|
|
|
void textsize(Fl_Fontsize size) { textsize_ = size; }
|
2008-09-21 01:04:28 +04:00
|
|
|
|
2008-09-14 16:45:42 +04:00
|
|
|
/**
|
2008-09-21 01:04:28 +04:00
|
|
|
Gets the default text color for the lines in the browser.
|
2008-09-14 16:45:42 +04:00
|
|
|
*/
|
2009-09-27 15:06:56 +04:00
|
|
|
Fl_Color textcolor() const { return textcolor_; }
|
2008-09-21 01:04:28 +04:00
|
|
|
/**
|
2009-03-26 02:09:04 +03:00
|
|
|
Sets the default text color for the lines in the browser to color \p col.
|
2008-09-21 01:04:28 +04:00
|
|
|
*/
|
2009-09-27 15:06:56 +04:00
|
|
|
void textcolor(Fl_Color col) { textcolor_ = col; }
|
1998-10-06 22:21:25 +04:00
|
|
|
|
2008-09-21 01:04:28 +04:00
|
|
|
/**
|
2009-04-02 10:44:34 +04:00
|
|
|
Gets the current size of the scrollbars' troughs, in pixels.
|
|
|
|
|
|
|
|
If this value is zero (default), this widget will use the
|
|
|
|
Fl::scrollbar_size() value as the scrollbar's width.
|
|
|
|
|
|
|
|
\returns Scrollbar size in pixels, or 0 if the global Fl::scrollsize() is being used.
|
|
|
|
\see Fl::scrollbar_size(int)
|
2008-09-21 01:04:28 +04:00
|
|
|
*/
|
2009-04-02 10:44:34 +04:00
|
|
|
int scrollbar_size() const {
|
|
|
|
return(scrollbar_size_);
|
|
|
|
}
|
2008-09-21 01:04:28 +04:00
|
|
|
/**
|
2009-04-02 10:44:34 +04:00
|
|
|
Sets the pixel size of the scrollbars' troughs to the \p size, in pixels.
|
|
|
|
|
|
|
|
Normally you should not need this method, and should use
|
|
|
|
Fl::scrollbar_size(int) instead to manage the size of ALL
|
|
|
|
your widgets' scrollbars. This ensures your application
|
|
|
|
has a consistent UI, is the default behavior, and is normally
|
|
|
|
what you want.
|
1998-10-06 22:21:25 +04:00
|
|
|
|
2009-04-02 10:44:34 +04:00
|
|
|
Only use THIS method if you really need to override the global
|
|
|
|
scrollbar size. The need for this should be rare.
|
|
|
|
|
|
|
|
Setting \p size to the special value of 0 causes the widget to
|
|
|
|
track the global Fl::scrollbar_size(), which is the default.
|
|
|
|
|
|
|
|
\param[in] size Sets the scrollbar size in pixels.\n
|
|
|
|
If 0 (default), scrollbar size tracks the global Fl::scrollbar_size()
|
|
|
|
\see Fl::scrollbar_size()
|
|
|
|
*/
|
|
|
|
void scrollbar_size(int size) {
|
|
|
|
scrollbar_size_ = size;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
This method has been deprecated, existing for backwards compatibility only.
|
|
|
|
Use scrollbar_size() instead.
|
|
|
|
This method always returns the global value Fl::scrollbar_size().
|
|
|
|
\returns Always returns the global value Fl::scrollbar_size().
|
|
|
|
\todo This method should eventually be removed in 1.4+
|
|
|
|
*/
|
|
|
|
int scrollbar_width() const {
|
|
|
|
return(Fl::scrollbar_size());
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
This method has been deprecated, existing for backwards compatibility only.
|
|
|
|
Use scrollbar_size(int) instead.
|
|
|
|
This method sets the global Fl::scrollbar_size(), and forces this
|
|
|
|
instance of the widget to use it.
|
|
|
|
\todo This method should eventually be removed in 1.4+
|
|
|
|
*/
|
|
|
|
void scrollbar_width(int width) {
|
|
|
|
Fl::scrollbar_size(width);
|
|
|
|
scrollbar_size_ = 0;
|
|
|
|
}
|
2008-09-21 01:04:28 +04:00
|
|
|
/**
|
|
|
|
Moves the vertical scrollbar to the righthand side of the list.
|
|
|
|
For back compatibility.
|
|
|
|
*/
|
2009-03-26 02:09:04 +03:00
|
|
|
void scrollbar_right() { scrollbar.align(FL_ALIGN_RIGHT); }
|
2008-09-21 01:04:28 +04:00
|
|
|
/**
|
|
|
|
Moves the vertical scrollbar to the lefthand side of the list.
|
|
|
|
For back compatibility.
|
|
|
|
*/
|
2009-03-26 02:09:04 +03:00
|
|
|
void scrollbar_left() { scrollbar.align(FL_ALIGN_LEFT); }
|
2008-12-27 00:20:38 +03:00
|
|
|
void sort(int flags=0);
|
1998-10-06 22:21:25 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
1998-10-20 01:39:29 +04:00
|
|
|
|
|
|
|
//
|
2005-02-25 00:55:12 +03:00
|
|
|
// End of "$Id$".
|
1998-10-20 01:39:29 +04:00
|
|
|
//
|