1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFileDialog
4 // Author: Robert Roebling
7 // Copyright: (c) Robert Roebling
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_FILEDLGG_H_
13 #define _WX_FILEDLGG_H_
15 #if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "filedlgg.h"
19 #include "wx/dialog.h"
21 //-----------------------------------------------------------------------------
23 //-----------------------------------------------------------------------------
25 WXDLLEXPORT_DATA(extern const wxChar
*)wxFileSelectorPromptStr
;
26 WXDLLEXPORT_DATA(extern const wxChar
*)wxFileSelectorDefaultWildcardStr
;
28 //-----------------------------------------------------------------------------
30 //-----------------------------------------------------------------------------
41 //-------------------------------------------------------------------------
43 //-------------------------------------------------------------------------
45 class wxFileDialog
: public wxDialog
50 wxFileDialog(wxWindow
*parent
,
51 const wxString
& message
= wxFileSelectorPromptStr
,
52 const wxString
& defaultDir
= _T(""),
53 const wxString
& defaultFile
= _T(""),
54 const wxString
& wildCard
= wxFileSelectorDefaultWildcardStr
,
56 const wxPoint
& pos
= wxDefaultPosition
);
57 virtual ~wxFileDialog();
59 void SetMessage(const wxString
& message
) { SetTitle(message
); }
60 void SetPath(const wxString
& path
);
61 void SetDirectory(const wxString
& dir
) { m_dir
= dir
; }
62 void SetFilename(const wxString
& name
) { m_fileName
= name
; }
63 void SetWildcard(const wxString
& wildCard
) { m_wildCard
= wildCard
; }
64 void SetStyle(long style
) { m_dialogStyle
= style
; }
65 void SetFilterIndex(int filterIndex
);
67 wxString
GetMessage() const { return m_message
; }
68 wxString
GetPath() const { return m_path
; }
69 wxString
GetDirectory() const { return m_dir
; }
70 wxString
GetFilename() const { return m_fileName
; }
71 wxString
GetWildcard() const { return m_wildCard
; }
72 long GetStyle() const { return m_dialogStyle
; }
73 int GetFilterIndex() const { return m_filterIndex
; }
75 // for multiple file selection
76 void GetPaths(wxArrayString
& paths
) const;
77 void GetFilenames(wxArrayString
& files
) const;
79 // implementation only from now on
80 // -------------------------------
82 virtual int ShowModal();
84 void OnSelected( wxListEvent
&event
);
85 void OnActivated( wxListEvent
&event
);
86 void OnList( wxCommandEvent
&event
);
87 void OnReport( wxCommandEvent
&event
);
88 void OnUp( wxCommandEvent
&event
);
89 void OnHome( wxCommandEvent
&event
);
90 void OnListOk( wxCommandEvent
&event
);
91 void OnNew( wxCommandEvent
&event
);
92 void OnChoice( wxCommandEvent
&event
);
93 void OnTextEnter( wxCommandEvent
&event
);
94 void OnCheck( wxCommandEvent
&event
);
96 void HandleAction( const wxString
&fn
);
102 wxString m_path
; // Full path
106 wxString m_filterExtension
;
111 wxStaticText
*m_static
;
114 DECLARE_DYNAMIC_CLASS(wxFileDialog
)
115 DECLARE_EVENT_TABLE()
117 // these variables are preserved between wxFileDialog calls
118 static long ms_lastViewStyle
; // list or report?
119 static bool ms_lastShowHidden
; // did we show hidden files?
122 // File selector - backward compatibility
124 wxFileSelector(const wxChar
*message
= wxFileSelectorPromptStr
,
125 const wxChar
*default_path
= NULL
,
126 const wxChar
*default_filename
= NULL
,
127 const wxChar
*default_extension
= NULL
,
128 const wxChar
*wildcard
= wxFileSelectorDefaultWildcardStr
,
130 wxWindow
*parent
= NULL
,
131 int x
= -1, int y
= -1);
133 // An extended version of wxFileSelector
135 wxFileSelectorEx(const wxChar
*message
= wxFileSelectorPromptStr
,
136 const wxChar
*default_path
= NULL
,
137 const wxChar
*default_filename
= NULL
,
138 int *indexDefaultExtension
= NULL
,
139 const wxChar
*wildcard
= wxFileSelectorDefaultWildcardStr
,
141 wxWindow
*parent
= NULL
,
142 int x
= -1, int y
= -1);
144 // Ask for filename to load
146 wxLoadFileSelector(const wxChar
*what
,
147 const wxChar
*extension
,
148 const wxChar
*default_name
= (const wxChar
*)NULL
,
149 wxWindow
*parent
= (wxWindow
*) NULL
);
151 // Ask for filename to save
153 wxSaveFileSelector(const wxChar
*what
,
154 const wxChar
*extension
,
155 const wxChar
*default_name
= (const wxChar
*) NULL
,
156 wxWindow
*parent
= (wxWindow
*) NULL
);