1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFileDialog class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_FILEDLG_H_
13 #define _WX_FILEDLG_H_
16 #pragma interface "filedlg.h"
19 #include "wx/dialog.h"
25 WXDLLEXPORT_DATA(extern const wxChar
*) wxFileSelectorPromptStr
;
26 WXDLLEXPORT_DATA(extern const wxChar
*) wxFileSelectorDefaultWildcardStr
;
28 class WXDLLEXPORT wxFileDialog
: public wxDialog
31 wxFileDialog(wxWindow
*parent
, const wxString
& message
= wxFileSelectorPromptStr
,
32 const wxString
& defaultDir
= wxEmptyString
, const wxString
& defaultFile
= wxEmptyString
, const wxString
& wildCard
= wxFileSelectorDefaultWildcardStr
,
33 long style
= 0, const wxPoint
& pos
= wxDefaultPosition
);
35 void SetMessage(const wxString
& message
) { m_message
= message
; }
36 void SetPath(const wxString
& path
) { m_path
= path
; }
37 void SetDirectory(const wxString
& dir
) { m_dir
= dir
; }
38 void SetFilename(const wxString
& name
) { m_fileName
= name
; }
39 void SetWildcard(const wxString
& wildCard
) { m_wildCard
= wildCard
; }
40 void SetStyle(long style
) { m_dialogStyle
= style
; }
41 void SetFilterIndex(int filterIndex
) { m_filterIndex
= filterIndex
; }
43 wxString
GetMessage() const { return m_message
; }
44 wxString
GetPath() const { return m_path
; }
45 void GetPaths(wxArrayString
& paths
) const;
46 wxString
GetDirectory() const { return m_dir
; }
47 wxString
GetFilename() const { return m_fileName
; }
48 void GetFilenames(wxArrayString
& files
) const { files
= m_fileNames
; }
49 wxString
GetWildcard() const { return m_wildCard
; }
50 long GetStyle() const { return m_dialogStyle
; }
51 int GetFilterIndex() const { return m_filterIndex
; }
60 wxString m_path
; // Full path
62 wxArrayString m_fileNames
;
67 DECLARE_DYNAMIC_CLASS(wxFileDialog
)
70 // File selector - backward compatibility
72 wxFileSelector(const wxChar
*message
= wxFileSelectorPromptStr
,
73 const wxChar
*default_path
= NULL
,
74 const wxChar
*default_filename
= NULL
,
75 const wxChar
*default_extension
= NULL
,
76 const wxChar
*wildcard
= wxFileSelectorDefaultWildcardStr
,
78 wxWindow
*parent
= NULL
,
79 int x
= -1, int y
= -1);
81 // An extended version of wxFileSelector
83 wxFileSelectorEx(const wxChar
*message
= wxFileSelectorPromptStr
,
84 const wxChar
*default_path
= NULL
,
85 const wxChar
*default_filename
= NULL
,
86 int *indexDefaultExtension
= NULL
,
87 const wxChar
*wildcard
= wxFileSelectorDefaultWildcardStr
,
89 wxWindow
*parent
= NULL
,
90 int x
= -1, int y
= -1);
92 // Ask for filename to load
94 wxLoadFileSelector(const wxChar
*what
,
95 const wxChar
*extension
,
96 const wxChar
*default_name
= (const wxChar
*)NULL
,
97 wxWindow
*parent
= (wxWindow
*) NULL
);
99 // Ask for filename to save
101 wxSaveFileSelector(const wxChar
*what
,
102 const wxChar
*extension
,
103 const wxChar
*default_name
= (const wxChar
*) NULL
,
104 wxWindow
*parent
= (wxWindow
*) NULL
);