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
00033
00034
00035 #ifndef FXFILEDIALOGEX_H
00036 #define FXFILEDIALOGEX_H
00037
00038
00039 #if !defined(WIN32) && !defined (WIN32_COMDLG)
00040 #include <fox/fx.h>
00041 #define FXFileDialogEx FXFileDialog
00042 #else
00043 #include <fox/FXObject.h>
00044 using namespace FX;
00045 #include <commdlg.h>
00046 namespace FXEX {
00047
00048
00049 #define DLGEX_SAVE 0x00100000 // "Save" dialog box
00050 #define DLGEX_CREATEPROMPT 0x00400000 // -> OFN_CREATEPROMPT
00051 #define DLGEX_READONLY 0x00800000 // -> OFN_READONLY
00052 #define DLGEX_PATHMUSTEXIST 0x01000000 // -> OFN_PATHMUSTEXIST
00053 #define DLGEX_FILEMUSTEXIST 0x02000000 // -> OFN_FILEMUSTEXIST
00054 #define DLGEX_HIDEREADONLY 0x04000000 // -> OFN_HIDEREADONLY
00055 #define DLGEX_OVERWRITEPROMPT 0x08000000 // -> OFN_OVERWRITEPROMPT
00056
00057
00058
00059
00060 class FXAPI FXFileDialogEx : public FXObject {
00061 FXDECLARE(FXFileDialogEx)
00062
00063 public:
00064 OPENFILENAME m_ofn;
00065 FXuint m_opts;
00066 FXchar **m_pszFoxPats;
00067 FXchar *m_pszFoxCustomPat;
00068 FXint m_nFoxPats;
00069
00070 private:
00071 FXFileDialogEx(const FXFileDialogEx&);
00072 FXFileDialogEx& operator=(const FXFileDialogEx&);
00073
00074
00075 void getWinPattern(FXchar*& pszWinPat, const FXchar* pszFoxPat) const;
00076
00077 protected:
00078 FXFileDialogEx();
00079
00080 public:
00081
00082 FXFileDialogEx(FXWindow* owner,const FXString& title,FXuint opts=0,FXint x=0,FXint y=0,FXint w=500,FXint h=300);
00083
00084
00085 FXuint execute();
00086
00087
00088 void setFilename(const FXString& path);
00089
00090
00091 void setDirectory(const FXString& path);
00092
00093
00094 void setPattern(const FXString& ptrn);
00095
00096
00097 void setPatternList(const FXchar* ptrns[]);
00098
00099
00100 void setCurrentPattern(FXint n);
00101
00102
00103 void setPatternText(FXint patno,const FXString& text);
00104
00105
00106 FXString getFilename() const;
00107
00108
00109 FXString getPattern() const;
00110
00111
00112 FXString getDirectory() const;
00113
00114
00115 FXint getCurrentPattern() const;
00116
00117
00118 FXString getPatternText(FXint patno) const;
00119
00120
00121 void setTitle(const FXString& name);
00122
00123
00124 FXString getTitle() const;
00125
00126
00127 virtual ~FXFileDialogEx();
00128 };
00129
00130 }
00131 #endif
00132 #endif