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 char*) wxFileSelectorPromptStr
;
26 WXDLLEXPORT_DATA(extern const char*) wxFileSelectorDefaultWildcardStr
;
28 class WXDLLEXPORT wxFileDialog
: public wxDialog
30 DECLARE_DYNAMIC_CLASS(wxFileDialog
)
36 wxString m_path
; // Full path
43 static wxString m_fileSelectorAnswer
;
44 static bool m_fileSelectorReturned
;
47 wxFileDialog(wxWindow
*parent
, const wxString
& message
= wxFileSelectorPromptStr
,
48 const wxString
& defaultDir
= "", const wxString
& defaultFile
= "", const wxString
& wildCard
= wxFileSelectorDefaultWildcardStr
,
49 long style
= 0, const wxPoint
& pos
= wxDefaultPosition
);
51 inline void SetMessage(const wxString
& message
) { m_message
= message
; }
52 inline void SetPath(const wxString
& path
) { m_path
= path
; }
53 inline void SetDirectory(const wxString
& dir
) { m_dir
= dir
; }
54 inline void SetFilename(const wxString
& name
) { m_fileName
= name
; }
55 inline void SetWildcard(const wxString
& wildCard
) { m_wildCard
= wildCard
; }
56 inline void SetStyle(long style
) { m_dialogStyle
= style
; }
57 inline void SetFilterIndex(int filterIndex
) { m_filterIndex
= filterIndex
; }
59 inline wxString
GetMessage() const { return m_message
; }
60 inline wxString
GetPath() const { return m_path
; }
61 inline wxString
GetDirectory() const { return m_dir
; }
62 inline wxString
GetFilename() const { return m_fileName
; }
63 inline wxString
GetWildcard() const { return m_wildCard
; }
64 inline long GetStyle() const { return m_dialogStyle
; }
65 inline int GetFilterIndex() const { return m_filterIndex
; }
72 #define wxOVERWRITE_PROMPT 0x0004
73 #define wxHIDE_READONLY 0x0008
74 #define wxFILE_MUST_EXIST 0x0010
76 // File selector - backward compatibility
77 char* WXDLLEXPORT
wxFileSelector(const char *message
= wxFileSelectorPromptStr
, const char *default_path
= NULL
,
78 const char *default_filename
= NULL
, const char *default_extension
= NULL
,
79 const char *wildcard
= wxFileSelectorDefaultWildcardStr
, int flags
= 0,
80 wxWindow
*parent
= NULL
, int x
= -1, int y
= -1);
82 // An extended version of wxFileSelector
83 char* WXDLLEXPORT
wxFileSelectorEx(const char *message
= wxFileSelectorPromptStr
, const char *default_path
= NULL
,
84 const char *default_filename
= NULL
, int *indexDefaultExtension
= NULL
,
85 const char *wildcard
= wxFileSelectorDefaultWildcardStr
, int flags
= 0,
86 wxWindow
*parent
= NULL
, int x
= -1, int y
= -1);
88 // Generic file load dialog
89 char* WXDLLEXPORT
wxLoadFileSelector(const char *what
, const char *extension
, const char *default_name
= NULL
, wxWindow
*parent
= NULL
);
91 // Generic file save dialog
92 char* WXDLLEXPORT
wxSaveFileSelector(const char *what
, const char *extension
, const char *default_name
= NULL
, wxWindow
*parent
= NULL
);