1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFileDialog class
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_FILEDLG_H_
13 #define _WX_FILEDLG_H_
15 #if defined(__GNUG__) && !defined(__APPLE__)
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
30 DECLARE_DYNAMIC_CLASS(wxFileDialog
)
36 wxString m_path
; // Full path
38 wxArrayString m_fileNames
;
39 wxArrayString m_paths
;
43 wxFileDialog(wxWindow
*parent
, const wxString
& message
= wxFileSelectorPromptStr
,
44 const wxString
& defaultDir
= wxEmptyString
, const wxString
& defaultFile
= wxEmptyString
, const wxString
& wildCard
= wxFileSelectorDefaultWildcardStr
,
45 long style
= 0, const wxPoint
& pos
= wxDefaultPosition
);
47 inline void SetMessage(const wxString
& message
) { m_message
= message
; }
48 inline void SetPath(const wxString
& path
) { m_path
= path
; }
49 inline void SetDirectory(const wxString
& dir
) { m_dir
= dir
; }
50 inline void SetFilename(const wxString
& name
) { m_fileName
= name
; }
51 inline void SetWildcard(const wxString
& wildCard
) { m_wildCard
= wildCard
; }
52 inline void SetStyle(long style
) { m_dialogStyle
= style
; }
53 inline void SetFilterIndex(int filterIndex
) { m_filterIndex
= filterIndex
; }
55 inline wxString
GetMessage() const { return m_message
; }
56 inline wxString
GetPath() const { return m_path
; }
57 inline wxString
GetDirectory() const { return m_dir
; }
58 inline wxString
GetFilename() const { return m_fileName
; }
59 void GetPaths(wxArrayString
& paths
) const { paths
= m_paths
; }
60 void GetFilenames(wxArrayString
& files
) const { files
= m_fileNames
; }
61 inline wxString
GetWildcard() const { return m_wildCard
; }
62 inline long GetStyle() const { return m_dialogStyle
; }
63 inline int GetFilterIndex() const { return m_filterIndex
; }
67 // not supported for file dialog, RR
68 virtual void DoSetSize(int WXUNUSED(x
), int WXUNUSED(y
),
69 int WXUNUSED(width
), int WXUNUSED(height
),
70 int WXUNUSED(sizeFlags
) = wxSIZE_AUTO
) {}
76 #define wxOVERWRITE_PROMPT 0x0004
77 #define wxHIDE_READONLY 0x0008
78 #define wxFILE_MUST_EXIST 0x0010
80 // File selector - backward compatibility
81 WXDLLEXPORT wxString
wxFileSelector(const wxChar
*message
= wxFileSelectorPromptStr
, const wxChar
*default_path
= NULL
,
82 const wxChar
*default_filename
= NULL
, const wxChar
*default_extension
= NULL
,
83 const wxChar
*wildcard
= wxFileSelectorDefaultWildcardStr
, int flags
= 0,
84 wxWindow
*parent
= NULL
, int x
= -1, int y
= -1);
86 // An extended version of wxFileSelector
87 WXDLLEXPORT wxString
wxFileSelectorEx(const wxChar
*message
= wxFileSelectorPromptStr
, const wxChar
*default_path
= NULL
,
88 const wxChar
*default_filename
= NULL
, int *indexDefaultExtension
= NULL
,
89 const wxChar
*wildcard
= wxFileSelectorDefaultWildcardStr
, int flags
= 0,
90 wxWindow
*parent
= NULL
, int x
= -1, int y
= -1);
92 // Generic file load dialog
93 WXDLLEXPORT wxString
wxLoadFileSelector(const wxChar
*what
, const wxChar
*extension
, const wxChar
*default_name
= NULL
, wxWindow
*parent
= NULL
);
95 // Generic file save dialog
96 WXDLLEXPORT wxString
wxSaveFileSelector(const wxChar
*what
, const wxChar
*extension
, const wxChar
*default_name
= NULL
, wxWindow
*parent
= NULL
);