00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef FL_DOXYGEN // PREVENT DOXYGEN'S USE OF THIS FILE
00030
00031
00032
00033 #include <FL/filename.H>
00034 #define MAXFILTERS 80
00035
00036 class FL_EXPORT Fl_Native_File_Chooser {
00037 public:
00038 enum Type {
00039 BROWSE_FILE = 0,
00040 BROWSE_DIRECTORY,
00041 BROWSE_MULTI_FILE,
00042 BROWSE_MULTI_DIRECTORY,
00043 BROWSE_SAVE_FILE,
00044 BROWSE_SAVE_DIRECTORY
00045 };
00046 enum Option {
00047 NO_OPTIONS = 0x0000,
00048 SAVEAS_CONFIRM = 0x0001,
00049 NEW_FOLDER = 0x0002,
00050 PREVIEW = 0x0004
00051 };
00052 private:
00053 int _btype;
00054 int _options;
00055 void *_panel;
00056 char **_pathnames;
00057 int _tpathnames;
00058 char *_directory;
00059 char *_title;
00060 char *_preset_file;
00061
00062 char *_filter;
00063
00064
00065 char *_filt_names;
00066
00067
00068 char *_filt_patt[MAXFILTERS];
00069
00070
00071
00072
00073 int _filt_total;
00074 int _filt_value;
00075 char *_errmsg;
00076
00077
00078 void errmsg(const char *msg);
00079 void clear_pathnames();
00080 void set_single_pathname(const char *s);
00081 int get_saveas_basename(void);
00082 void clear_filters();
00083 void add_filter(const char *, const char *);
00084 void parse_filter(const char *from);
00085 int post();
00086
00087 public:
00088 Fl_Native_File_Chooser(int val = BROWSE_FILE);
00089 ~Fl_Native_File_Chooser();
00090
00091
00092 void type(int);
00093 int type() const;
00094 void options(int);
00095 int options() const;
00096 int count() const;
00097 const char *filename() const;
00098 const char *filename(int i) const;
00099 void directory(const char *);
00100 const char *directory() const;
00101 void title(const char *);
00102 const char *title() const;
00103 const char *filter() const;
00104 void filter(const char *);
00105 void filter_value(int i) { _filt_value = i; }
00106 int filter_value() { return(_filt_value); }
00107 int filters() { return(_filt_total); }
00108 void preset_file(const char *);
00109 const char *preset_file();
00110 const char *errmsg() const;
00111 int show();
00112 };
00113
00114 #endif
00116 //
00117
00118