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 #ifndef FL_DOXYGEN // PREVENT DOXYGEN'S USE OF THIS FILE
00031
00032
00033 #include <stdio.h>
00034 #include <stdlib.h>
00035 #include <windows.h>
00036 #include <commdlg.h>
00037 #include <shlobj.h>
00038
00039 class FL_EXPORT Fl_Native_File_Chooser {
00040 public:
00041 enum Type {
00042 BROWSE_FILE = 0,
00043 BROWSE_DIRECTORY,
00044 BROWSE_MULTI_FILE,
00045 BROWSE_MULTI_DIRECTORY,
00046 BROWSE_SAVE_FILE,
00047 BROWSE_SAVE_DIRECTORY
00048 };
00049 enum Option {
00050 NO_OPTIONS = 0x0000,
00051 SAVEAS_CONFIRM = 0x0001,
00052 NEW_FOLDER = 0x0002,
00053 PREVIEW = 0x0004,
00054 };
00055 private:
00056 int _btype;
00057 int _options;
00058 OPENFILENAMEW _ofn;
00059 BROWSEINFO _binf;
00060 char **_pathnames;
00061 int _tpathnames;
00062 char *_directory;
00063 char *_title;
00064 char *_filter;
00065 char *_parsedfilt;
00066 int _nfilters;
00067 char *_preset_file;
00068 char *_errmsg;
00069
00070
00071 void errmsg(const char *msg);
00072
00073 void clear_pathnames();
00074 void set_single_pathname(const char *s);
00075 void add_pathname(const char *s);
00076
00077 void FreePIDL(ITEMIDLIST *pidl);
00078 void ClearOFN();
00079 void ClearBINF();
00080 void Win2Unix(char *s);
00081 void Unix2Win(char *s);
00082 int showfile();
00083 static int CALLBACK Dir_CB(HWND win, UINT msg, LPARAM param, LPARAM data);
00084 int showdir();
00085
00086 void parse_filter(const char *);
00087 void clear_filters();
00088 void add_filter(const char *, const char *);
00089
00090 public:
00091 Fl_Native_File_Chooser(int val = BROWSE_FILE);
00092 ~Fl_Native_File_Chooser();
00093
00094
00095 void type(int val);
00096 int type() const;
00097 void options(int);
00098 int options() const;
00099 int count() const;
00100 const char *filename() const;
00101 const char *filename(int i) const;
00102 void directory(const char *val);
00103 const char *directory() const;
00104 void title(const char *val);
00105 const char *title() const;
00106 const char *filter() const;
00107 void filter(const char *val);
00108 int filters() const { return _nfilters; }
00109 void filter_value(int i);
00110 int filter_value() const;
00111 void preset_file(const char *);
00112 const char *preset_file() const;
00113 const char *errmsg() const;
00114 int show();
00115 };
00116 #endif
00118 //
00119
00120