1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFileDialog class
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_FILEDLG_H_
13 #define _WX_FILEDLG_H_
15 #include "wx/dialog.h"
21 WXDLLEXPORT_DATA(extern const char*) wxFileSelectorPromptStr
;
22 WXDLLEXPORT_DATA(extern const char*) wxFileSelectorDefaultWildcardStr
;
24 class WXDLLEXPORT wxFileDialog
: public wxDialog
26 DECLARE_DYNAMIC_CLASS(wxFileDialog
)
28 wxFileDialog( wxWindow
* pParent
29 ,const wxString
& rsMessage
= wxFileSelectorPromptStr
30 ,const wxString
& rsDefaultDir
= ""
31 ,const wxString
& rsDefaultFile
= ""
32 ,const wxString
& rsWildCard
= wxFileSelectorDefaultWildcardStr
34 ,const wxPoint
& rPos
= wxDefaultPosition
37 inline void SetMessage(const wxString
& rsMessage
) { m_sMessage
= rsMessage
; }
38 inline void SetPath(const wxString
& rsPath
) { m_sPath
= rsPath
; }
39 inline void SetDirectory(const wxString
& rsDir
) { m_sDir
= rsDir
; }
40 inline void SetFilename(const wxString
& rsName
) { m_sFileName
= rsName
; }
41 inline void SetWildcard(const wxString
& rsWildCard
) { m_sWildCard
= rsWildCard
; }
42 inline void SetStyle(long lStyle
) { m_lDialogStyle
= lStyle
; }
43 inline void SetFilterIndex(int nFilterIndex
) { m_nFilterIndex
= nFilterIndex
; }
45 inline wxString
GetMessage(void) const { return m_sMessage
; }
46 inline wxString
GetPath(void) const { return m_sPath
; }
47 void GetPaths(wxArrayString
& rasPath
) const;
48 inline wxString
GetDirectory(void) const { return m_sDir
; }
49 inline wxString
GetFilename(void) const { return m_sFileName
; }
50 inline void GetFilenames(wxArrayString
& rasFilenames
) { rasFilenames
.Empty(); rasFilenames
.Add( m_sFileName
); }
51 inline wxString
GetWildcard(void) const { return m_sWildCard
; }
52 inline long GetStyle(void) const { return m_lDialogStyle
; }
53 inline int GetFilterIndex() const { return m_nFilterIndex
; }
62 wxString m_sPath
; // Full path
64 wxArrayString m_asFileNames
;
68 }; // end of CLASS wxFileDialog
72 #define wxOVERWRITE_PROMPT 0x0004
73 #define wxHIDE_READONLY 0x0008
74 #define wxFILE_MUST_EXIST 0x0010
77 // File selector - backward compatibility
79 WXDLLEXPORT wxString
wxFileSelector( const char* pzMessage
= wxFileSelectorPromptStr
80 ,const char* pzDefaultPath
= NULL
81 ,const char* pzDefaultFilename
= NULL
82 ,const char* pzDefaultExtension
= NULL
83 ,const char* pzWildcard
= wxFileSelectorDefaultWildcardStr
85 ,wxWindow
* pParent
= NULL
91 // An extended version of wxFileSelector
93 WXDLLEXPORT wxString
wxFileSelectorEx( const char* pzMessage
= wxFileSelectorPromptStr
94 ,const char* pzDefaultPath
= NULL
95 ,const char* pzDefaultFilename
= NULL
96 ,int* pnIndexDefaultExtension
= NULL
97 ,const char* pzWildcard
= wxFileSelectorDefaultWildcardStr
99 ,wxWindow
* pParent
= NULL
105 // Generic file load dialog
107 WXDLLEXPORT wxString
wxLoadFileSelector( const char* pzWhat
108 ,const char* pzExtension
109 ,const char* pzDefaultName
= NULL
110 ,wxWindow
* pParent
= NULL
114 // Generic file save dialog
116 WXDLLEXPORT wxString
wxSaveFileSelector( const char* pzWhat
117 ,const char* pzExtension
118 ,const char* pzDefaultName
= NULL
119 ,wxWindow
* pParent
= NULL