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
00030
00031
00032 #include <FL/Fl_File_Chooser.H>
00033 #include <unistd.h>
00034
00082 class FL_EXPORT Fl_Native_File_Chooser {
00083 public:
00084 enum Type {
00085 BROWSE_FILE = 0,
00086 BROWSE_DIRECTORY,
00087 BROWSE_MULTI_FILE,
00088 BROWSE_MULTI_DIRECTORY,
00089 BROWSE_SAVE_FILE,
00090 BROWSE_SAVE_DIRECTORY
00091 };
00092 enum Option {
00093 NO_OPTIONS = 0x0000,
00094 SAVEAS_CONFIRM = 0x0001,
00095 NEW_FOLDER = 0x0002,
00096 PREVIEW = 0x0004,
00097 };
00098 private:
00099 int _btype;
00100 int _options;
00101 int _nfilters;
00102 char *_filter;
00103 char *_parsedfilt;
00104 int _filtvalue;
00105 char *_preset_file;
00106 char *_prevvalue;
00107 char *_directory;
00108 char *_errmsg;
00109 char *_old_dir;
00110 Fl_File_Chooser *_file_chooser;
00111
00112
00113 Fl_File_Browser *my_fileList;
00114 Fl_Check_Button *show_hidden;
00115 int prev_filtervalue;
00116 static void show_hidden_cb(Fl_Check_Button *o, void *data);
00117 static void remove_hidden_files(Fl_File_Browser *my_fileList);
00118
00119
00120 void errmsg(const char *msg);
00121 int type_fl_file(int);
00122 void parse_filter();
00123 void keeplocation();
00124 int exist_dialog();
00125
00126 public:
00127 Fl_Native_File_Chooser(int val=BROWSE_FILE);
00128 ~Fl_Native_File_Chooser();
00129
00130
00131 void type(int);
00132 int type() const;
00133 void options(int);
00134 int options() const;
00135 int count() const;
00136 const char *filename() const;
00137 const char *filename(int i) const;
00138 void directory(const char *val);
00139 const char *directory() const;
00140 void title(const char *);
00141 const char* title() const;
00142 const char *filter() const;
00143 void filter(const char *);
00144 int filters() const;
00145 void filter_value(int i);
00146 int filter_value() const;
00147 void preset_file(const char*);
00148 const char* preset_file() const;
00149 const char *errmsg() const;
00150 int show();
00151 };
00152
00153
00154
00155