[773] | 1 | // |
---|
| 2 | // "$Id: FileBrowser.h 2871 2002-12-10 02:01:07Z easysw $" |
---|
| 3 | // |
---|
| 4 | // Fl_FileBrowser definitions for the Fast Light Tool Kit (FLTK). |
---|
| 5 | // |
---|
| 6 | // Copyright 1997-1999 by Easy Software Products. |
---|
| 7 | // |
---|
| 8 | // This library is free software; you can redistribute it and/or |
---|
| 9 | // modify it under the terms of the GNU Library General Public |
---|
| 10 | // License as published by the Free Software Foundation; either |
---|
| 11 | // version 2 of the License, or (at your option) any later version. |
---|
| 12 | // |
---|
| 13 | // This library is distributed in the hope that it will be useful, |
---|
| 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
| 16 | // Library General Public License for more details. |
---|
| 17 | // |
---|
| 18 | // You should have received a copy of the GNU Library General Public |
---|
| 19 | // License along with this library; if not, write to the Free Software |
---|
| 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
---|
| 21 | // USA. |
---|
| 22 | // |
---|
| 23 | // Please report all bugs and problems to "fltk-bugs@fltk.org". |
---|
| 24 | // |
---|
| 25 | |
---|
| 26 | // |
---|
| 27 | // Include necessary header files... |
---|
| 28 | // |
---|
| 29 | |
---|
| 30 | #ifndef fltk_FileBrowser_h |
---|
| 31 | #define fltk_FileBrowser_h |
---|
| 32 | |
---|
| 33 | #include <fltk/Browser.h> |
---|
| 34 | #include <fltk/FileIcon.h> |
---|
| 35 | |
---|
| 36 | namespace fltk { |
---|
| 37 | |
---|
| 38 | class FL_API FileBrowser : public Browser |
---|
| 39 | { |
---|
| 40 | const char *directory_; |
---|
| 41 | uchar icon_size_; |
---|
| 42 | const char *pattern_; |
---|
| 43 | |
---|
| 44 | int item_height(void *) const; |
---|
| 45 | int item_width(void *) const; |
---|
| 46 | void item_draw(void *, int, int, int, int) const; |
---|
| 47 | int incr_height() const { return (item_height(0)); } |
---|
| 48 | |
---|
| 49 | public: |
---|
| 50 | FileBrowser(int, int, int, int, const char * = 0); |
---|
| 51 | |
---|
| 52 | uchar icon_size() const { return (icon_size_); }; |
---|
| 53 | void icon_size(uchar s) { icon_size_ = s; redraw(); }; |
---|
| 54 | |
---|
| 55 | void directory(const char *directory) { load(directory); } |
---|
| 56 | const char *directory(void) const { return (directory_); } |
---|
| 57 | |
---|
| 58 | void filter(const char *pattern); |
---|
| 59 | const char *filter() const { return (pattern_); }; |
---|
| 60 | |
---|
| 61 | int load(const char *directory); |
---|
| 62 | |
---|
| 63 | }; |
---|
| 64 | |
---|
| 65 | } |
---|
| 66 | #endif |
---|
| 67 | |
---|
| 68 | // |
---|
| 69 | // End of "$Id: FileBrowser.h 2871 2002-12-10 02:01:07Z easysw $". |
---|
| 70 | // |
---|