Update the changelog
[opencv] / otherlibs / _fltk / include / FL / Fl_File_Browser.H
1 //
2 // "$Id: Fl_File_Browser.H,v 1.2 2002/12/01 15:38:37 neurosurg Exp $"
3 //
4 // FileBrowser definitions.
5 //
6 // Copyright 1999-2002 by Michael Sweet.
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 _Fl_File_Browser_H_
31 #  define _Fl_File_Browser_H_
32
33 #  include "Fl_Browser.H"
34 #  include "Fl_File_Icon.H"
35 #  include "filename.H"
36
37
38 //
39 // Fl_File_Browser class...
40 //
41
42 class FL_EXPORT Fl_File_Browser : public Fl_Browser
43 {
44   int           filetype_;
45   const char    *directory_;
46   uchar         iconsize_;
47   const char    *pattern_;
48
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)); }
54
55 public:
56   enum { FILES, DIRECTORIES };
57
58   Fl_File_Browser(int, int, int, int, const char * = 0);
59
60   uchar         iconsize() const { return (iconsize_); };
61   void          iconsize(uchar s) { iconsize_ = s; redraw(); };
62
63   void  filter(const char *pattern);
64   const char    *filter() const { return (pattern_); };
65
66   int           load(const char *directory, Fl_File_Sort_F *sort = fl_numericsort);
67
68   uchar         textsize() const { return (Fl_Browser::textsize()); };
69   void          textsize(uchar s) { Fl_Browser::textsize(s); iconsize_ = (uchar)(3 * s / 2); };
70
71   int           filetype() const { return (filetype_); };
72   void          filetype(int t) { filetype_ = t; load(directory_); };
73 };
74
75 #endif // !_Fl_File_Browser_H_
76
77 //
78 // End of "$Id: Fl_File_Browser.H,v 1.2 2002/12/01 15:38:37 neurosurg Exp $".
79 //