2 // "$Id: Fl_File_Browser.H,v 1.2 2002/12/01 15:38:37 neurosurg Exp $"
4 // FileBrowser definitions.
6 // Copyright 1999-2002 by Michael Sweet.
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.
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.
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
23 // Please report all bugs and problems to "fltk-bugs@fltk.org".
27 // Include necessary header files...
30 #ifndef _Fl_File_Browser_H_
31 # define _Fl_File_Browser_H_
33 # include "Fl_Browser.H"
34 # include "Fl_File_Icon.H"
35 # include "filename.H"
39 // Fl_File_Browser class...
42 class FL_EXPORT Fl_File_Browser : public Fl_Browser
45 const char *directory_;
49 int full_height() const;
50 int item_height(void *) const;
51 int item_width(void *) const;
52 void item_draw(void *, int, int, int, int) const;
53 int incr_height() const { return (item_height(0)); }
56 enum { FILES, DIRECTORIES };
58 Fl_File_Browser(int, int, int, int, const char * = 0);
60 uchar iconsize() const { return (iconsize_); };
61 void iconsize(uchar s) { iconsize_ = s; redraw(); };
63 void filter(const char *pattern);
64 const char *filter() const { return (pattern_); };
66 int load(const char *directory, Fl_File_Sort_F *sort = fl_numericsort);
68 uchar textsize() const { return (Fl_Browser::textsize()); };
69 void textsize(uchar s) { Fl_Browser::textsize(s); iconsize_ = (uchar)(3 * s / 2); };
71 int filetype() const { return (filetype_); };
72 void filetype(int t) { filetype_ = t; load(directory_); };
75 #endif // !_Fl_File_Browser_H_
78 // End of "$Id: Fl_File_Browser.H,v 1.2 2002/12/01 15:38:37 neurosurg Exp $".