1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/filedlg.h
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
,
32 const wxString
& message
= wxFileSelectorPromptStr
,
33 const wxString
& defaultDir
= wxEmptyString
,
34 const wxString
& defaultFile
= wxEmptyString
,
35 const wxString
& wildCard
= wxFileSelectorDefaultWildcardStr
,
37 const wxPoint
& pos
= wxDefaultPosition
);
39 void SetMessage(const wxString
& message
) { m_message
= message
; }
40 void SetPath(const wxString
& path
);
41 void SetDirectory(const wxString
& dir
) { m_dir
= dir
; }
42 void SetFilename(const wxString
& name
) { m_fileName
= name
; }
43 void SetWildcard(const wxString
& wildCard
) { m_wildCard
= wildCard
; }
44 void SetStyle(long style
) { m_dialogStyle
= style
; }
45 void SetFilterIndex(int filterIndex
) { m_filterIndex
= filterIndex
; }
47 wxString
GetMessage() const { return m_message
; }
48 wxString
GetPath() const { return m_path
; }
49 void GetPaths(wxArrayString
& paths
) const;
50 wxString
GetDirectory() const { return m_dir
; }
51 wxString
GetFilename() const { return m_fileName
; }
52 void GetFilenames(wxArrayString
& files
) const { files
= m_fileNames
; }
53 wxString
GetWildcard() const { return m_wildCard
; }
54 long GetStyle() const { return m_dialogStyle
; }
55 int GetFilterIndex() const { return m_filterIndex
; }
57 virtual int ShowModal();
64 wxString m_path
; // Full path
66 wxArrayString m_fileNames
;
71 DECLARE_DYNAMIC_CLASS(wxFileDialog
)
74 // File selector - backward compatibility
76 wxFileSelector(const wxChar
*message
= wxFileSelectorPromptStr
,
77 const wxChar
*default_path
= NULL
,
78 const wxChar
*default_filename
= NULL
,
79 const wxChar
*default_extension
= NULL
,
80 const wxChar
*wildcard
= wxFileSelectorDefaultWildcardStr
,
82 wxWindow
*parent
= NULL
,
83 int x
= -1, int y
= -1);
85 // An extended version of wxFileSelector
87 wxFileSelectorEx(const wxChar
*message
= wxFileSelectorPromptStr
,
88 const wxChar
*default_path
= NULL
,
89 const wxChar
*default_filename
= NULL
,
90 int *indexDefaultExtension
= NULL
,
91 const wxChar
*wildcard
= wxFileSelectorDefaultWildcardStr
,
93 wxWindow
*parent
= NULL
,
94 int x
= -1, int y
= -1);
96 // Ask for filename to load
98 wxLoadFileSelector(const wxChar
*what
,
99 const wxChar
*extension
,
100 const wxChar
*default_name
= (const wxChar
*)NULL
,
101 wxWindow
*parent
= (wxWindow
*) NULL
);
103 // Ask for filename to save
105 wxSaveFileSelector(const wxChar
*what
,
106 const wxChar
*extension
,
107 const wxChar
*default_name
= (const wxChar
*) NULL
,
108 wxWindow
*parent
= (wxWindow
*) NULL
);