diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2020-07-01 18:03:10 +0200 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2020-07-06 20:28:20 +0200 |
| commit | f09e17c3c564e8310125a10c03397cbf473ff643 (patch) | |
| tree | 8d0fd4a28e3686c33aaa140d07ddba26ab28bdc2 /FL/Fl_Browser_.H | |
| parent | b0e0c355edaa2e23148cb0260ada907aec930f05 (diff) | |
Remove $Id$ tags, update URL's, and more
- remove obsolete svn '$Id$' tags from all source files
- update .fl files and generated files accordingly
- replace 'http://www.fltk.org' URL's with 'https://...'
- replace bug report URL 'str.php' with 'bugs.php'
- remove trailing whitespace
- fix other whitespace errors flagged by Git
- add and/or fix missing or wrong standard headers
- convert tabs to spaces in all source files
The only relevant code changes are in the fluid/ folder where
some .fl files and other source files were used to generate
the '$Id' headers and footers.
Diffstat (limited to 'FL/Fl_Browser_.H')
| -rw-r--r-- | FL/Fl_Browser_.H | 112 |
1 files changed, 53 insertions, 59 deletions
diff --git a/FL/Fl_Browser_.H b/FL/Fl_Browser_.H index 308f47ce6..af86bc2c7 100644 --- a/FL/Fl_Browser_.H +++ b/FL/Fl_Browser_.H @@ -1,6 +1,4 @@ // -// "$Id$" -// // Common browser header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2016 by Bill Spitzak and others. @@ -9,11 +7,11 @@ // the file "COPYING" which should have been included with this file. If this // file is missing or damaged, see the license at: // -// http://www.fltk.org/COPYING.php +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // /* \file @@ -28,15 +26,15 @@ #include "Fl_Group.H" #endif #include "Fl_Scrollbar.H" -#include <FL/Fl.H> // Fl::scrollbar_size() +#include <FL/Fl.H> // Fl::scrollbar_size() -#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 */ +#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 */ -#define FL_SORT_ASCENDING 0 /**< sort browser items in ascending alphabetic order. */ -#define FL_SORT_DESCENDING 1 /**< sort in descending order */ +#define FL_SORT_ASCENDING 0 /**< sort browser items in ascending alphabetic order. */ +#define FL_SORT_DESCENDING 1 /**< sort in descending order */ /** This is the base class for browsers. To be useful it must be @@ -44,7 +42,7 @@ browser and the file chooser's browser are subclassed off of this. This has been designed so that the subclass has complete control - over the storage of the data, although because next() and + 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 searched for. @@ -76,21 +74,21 @@ Keyboard navigation of browser items extend a selection or de-selection. */ class FL_EXPORT Fl_Browser_ : public Fl_Group { - 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 + 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 Fl_Font textfont_; Fl_Fontsize textsize_; Fl_Color textcolor_; - void* top_; // which item scrolling position is in - void* selection_; // which is selected (except for FL_MULTI_BROWSER) + 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_ - int scrollbar_size_; // size of scrollbar trough + void* max_width_item; // which item has max_width_ + int scrollbar_size_; // size of scrollbar trough void update_top(); @@ -98,7 +96,7 @@ protected: // All of the following must be supplied by the subclass: /** - This method must be provided by the subclass + This method must be provided by the subclass to return the first item in the list. \see item_first(), item_next(), item_last(), item_prev() */ @@ -121,8 +119,8 @@ protected: \see item_first(), item_next(), item_last(), item_prev() */ virtual void *item_last() const { return 0L; } - /** - This method must be provided by the subclass to return + /** + 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. @@ -145,28 +143,28 @@ protected: */ virtual void item_draw(void *item,int X,int Y,int W,int H) const = 0; /** - This optional method returns a string (label) that may be used for sorting. + 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) */ virtual const char *item_text(void *item) const { (void)item; return 0L; } /** - This optional method should be provided by the subclass + 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. */ virtual void item_swap(void *a,void *b) { (void)a; (void)b; } /** - This method must be provided by the subclass - to return the item for the specified \p index. + 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. */ virtual void *item_at(int index) const { (void)index; return 0L; } // you don't have to provide these but it may help speed it up: - 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 + 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 // These only need to be done by subclass if you want a multi-browser: virtual void item_select(void *item,int val=1); virtual int item_selected(void *item) const ; @@ -178,9 +176,9 @@ protected: void *top() const { return top_; } /** Returns the item currently selected, or NULL if there is no selection. - + For multiple selection browsers this call returns the currently focused item, - even if it is not selected. To find all selected items, call + even if it is not selected. To find all selected items, call Fl_Multi_Browser::selected() for every item in question. */ void *selection() const { return selection_; } @@ -197,9 +195,9 @@ protected: */ void redraw_lines() { damage(FL_DAMAGE_SCROLL); } // redraw all of them void bbox(int &X,int &Y,int &W,int &H) const; - int leftedge() const; // x position after scrollbar & border + int leftedge() const; // x position after scrollbar & border void *find_item(int ypos); // item under mouse - + void draw(); Fl_Browser_(int X,int Y,int W,int H,const char *L=0); @@ -223,7 +221,7 @@ public: /** 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 + 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. \see position(), hposition() */ @@ -250,13 +248,13 @@ public: - bit 3-31: reserved for future use */ enum { // values for has_scrollbar() - 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. + 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. }; /** Returns the current scrollbar mode, see Fl_Browser_::has_scrollbar(uchar) @@ -265,9 +263,9 @@ public: /** Sets whether the widget should have scrollbars or not (default Fl_Browser_::BOTH). By default you can scroll in both directions, and the scrollbars - disappear if the data will fit in the widget. + disappear if the data will fit in the widget. has_scrollbar() changes this based on the value of \p mode: - + - 0 - No scrollbars. - Fl_Browser_::HORIZONTAL - Only a horizontal scrollbar. @@ -317,9 +315,9 @@ public: /** Gets the current size of the scrollbars' troughs, in pixels. - If this value is zero (default), this widget will use the + 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::scrollbar_size() is being used. \see Fl::scrollbar_size(int) */ @@ -330,24 +328,24 @@ public: Sets the pixel size of the scrollbars' troughs to \p newSize, 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 + 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. Only use THIS method if you really need to override the global scrollbar size. The need for this should be rare. - + Setting \p newSize to the special value of 0 causes the widget to track the global Fl::scrollbar_size(), which is the default. - + \param[in] newSize 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 newSize) { scrollbar_size_ = newSize; - } + } /** Returns the global value Fl::scrollbar_size(). \deprecated Use scrollbar_size() instead. @@ -379,7 +377,3 @@ public: }; #endif - -// -// End of "$Id$". -// |
