• Main Page
  • Related Pages
  • Modules
  • Classes
  • Files
  • File List
  • File Members

Fl_File_Browser.H

00001 //
00002 // "$Id$"
00003 //
00004 // FileBrowser definitions.
00005 //
00006 // Copyright 1999-2010 by Michael Sweet.
00007 //
00008 // This library is free software. Distribution and use rights are outlined in
00009 // the file "COPYING" which should have been included with this file.  If this
00010 // file is missing or damaged, see the license at:
00011 //
00012 //     http://www.fltk.org/COPYING.php
00013 //
00014 // Please report all bugs and problems on the following page:
00015 //
00016 //     http://www.fltk.org/str.php
00017 //
00018 
00019 /* \file
00020    Fl_File_Browser widget . */
00021 
00022 //
00023 // Include necessary header files...
00024 //
00025 
00026 #ifndef _Fl_File_Browser_H_
00027 #  define _Fl_File_Browser_H_
00028 
00029 #  include "Fl_Browser.H"
00030 #  include "Fl_File_Icon.H"
00031 #  include "filename.H"
00032 
00033 
00034 //
00035 // Fl_File_Browser class...
00036 //
00037 
00039 class FL_EXPORT Fl_File_Browser : public Fl_Browser {
00040   
00041   int           filetype_;
00042   const char    *directory_;
00043   uchar         iconsize_;
00044   const char    *pattern_;
00045 
00046   int           full_height() const;
00047   int           item_height(void *) const;
00048   int           item_width(void *) const;
00049   void          item_draw(void *, int, int, int, int) const;
00050   int           incr_height() const { return (item_height(0)); }
00051 
00052 public:
00053   enum { FILES, DIRECTORIES };
00054 
00059   Fl_File_Browser(int, int, int, int, const char * = 0);
00060 
00062   uchar         iconsize() const { return (iconsize_); };
00064   void          iconsize(uchar s) { iconsize_ = s; redraw(); };
00065 
00071   void  filter(const char *pattern);
00077   const char    *filter() const { return (pattern_); };
00078 
00086   int           load(const char *directory, Fl_File_Sort_F *sort = fl_numericsort);
00087 
00088   Fl_Fontsize  textsize() const { return Fl_Browser::textsize(); };
00089   void          textsize(Fl_Fontsize s) { Fl_Browser::textsize(s); iconsize_ = (uchar)(3 * s / 2); };
00090 
00097   int           filetype() const { return (filetype_); };
00104   void          filetype(int t) { filetype_ = t; };
00105 };
00106 
00107 #endif // !_Fl_File_Browser_H_
00108 
00109 //
00110 // End of "$Id$".
00111 //
  • © 1998-2016 by Bill Spitzak and others.     FLTK

  • © 1998-2016 by Bill Spitzak and others.     FLTK

    Permission is granted to reproduce this manual or any portion for any purpose, provided this copyright and permission notice are preserved.