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
*parent
, const wxString
& message
= wxFileSelectorPromptStr
,
29 const wxString
& defaultDir
= "", const wxString
& defaultFile
= "", const wxString
& wildCard
= wxFileSelectorDefaultWildcardStr
,
30 long style
= 0, const wxPoint
& pos
= wxDefaultPosition
);
32 inline void SetMessage(const wxString
& message
) { m_message
= message
; }
33 inline void SetPath(const wxString
& path
) { m_path
= path
; }
34 inline void SetDirectory(const wxString
& dir
) { m_dir
= dir
; }
35 inline void SetFilename(const wxString
& name
) { m_fileName
= name
; }
36 inline void SetWildcard(const wxString
& wildCard
) { m_wildCard
= wildCard
; }
37 inline void SetStyle(long style
) { m_dialogStyle
= style
; }
38 inline void SetFilterIndex(int filterIndex
) { m_filterIndex
= filterIndex
; }
40 inline wxString
GetMessage() const { return m_message
; }
41 inline wxString
GetPath() const { return m_path
; }
42 inline void GetPaths(wxArrayString
& a
) { a
.Empty(); a
.Add(m_path
); }
43 inline wxString
GetDirectory() const { return m_dir
; }
44 inline wxString
GetFilename() const { return m_fileName
; }
45 inline void GetFilenames(wxArrayString
& a
) { a
.Empty();
47 inline wxString
GetWildcard() const { return m_wildCard
; }
48 inline long GetStyle() const { return m_dialogStyle
; }
49 inline int GetFilterIndex() const { return m_filterIndex
; }
58 wxString m_path
; // Full path
66 #define wxOVERWRITE_PROMPT 0x0004
67 #define wxHIDE_READONLY 0x0008
68 #define wxFILE_MUST_EXIST 0x0010
70 // File selector - backward compatibility
71 WXDLLEXPORT wxString
wxFileSelector( const char *message
= wxFileSelectorPromptStr
72 ,const char *default_path
= NULL
73 ,const char *default_filename
= NULL
74 ,const char *default_extension
= NULL
75 ,const char *wildcard
= wxFileSelectorDefaultWildcardStr
77 ,wxWindow
*parent
= NULL
82 // An extended version of wxFileSelector
83 WXDLLEXPORT wxString
wxFileSelectorEx( const char *message
= wxFileSelectorPromptStr
84 ,const char *default_path
= NULL
85 ,const char *default_filename
= NULL
86 ,int *indexDefaultExtension
= NULL
87 ,const char *wildcard
= wxFileSelectorDefaultWildcardStr
89 ,wxWindow
*parent
= NULL
94 // Generic file load dialog
95 WXDLLEXPORT wxString
wxLoadFileSelector( const char *what
96 ,const char *extension
97 ,const char *default_name
= NULL
98 ,wxWindow
*parent
= NULL
101 // Generic file save dialog
102 WXDLLEXPORT wxString
wxSaveFileSelector( const char *what
103 ,const char *extension
104 ,const char *default_name
= NULL
105 ,wxWindow
*parent
= NULL