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 //-------------------------------------------------------------------------
17 //-------------------------------------------------------------------------
19 // set this system option to 1 in order to always show the filetypes popup in
20 // file open dialogs if possible
22 #define wxOSX_FILEDIALOG_ALWAYS_SHOW_TYPES wxT("osx.filedlg.always-show-types")
24 class WXDLLIMPEXP_CORE wxFileDialog
: public wxFileDialogBase
26 DECLARE_DYNAMIC_CLASS(wxFileDialog
)
28 wxArrayString m_fileNames
;
29 wxArrayString m_paths
;
32 wxFileDialog(wxWindow
*parent
,
33 const wxString
& message
= wxFileSelectorPromptStr
,
34 const wxString
& defaultDir
= wxEmptyString
,
35 const wxString
& defaultFile
= wxEmptyString
,
36 const wxString
& wildCard
= wxFileSelectorDefaultWildcardStr
,
37 long style
= wxFD_DEFAULT_STYLE
,
38 const wxPoint
& pos
= wxDefaultPosition
,
39 const wxSize
& sz
= wxDefaultSize
,
40 const wxString
& name
= wxFileDialogNameStr
);
42 virtual void GetPaths(wxArrayString
& paths
) const { paths
= m_paths
; }
43 virtual void GetFilenames(wxArrayString
& files
) const { files
= m_fileNames
; }
45 virtual int ShowModal();
48 virtual void ShowWindowModal();
49 virtual void ModalFinishedCallback(void* panel
, int resultCode
);
52 virtual bool SupportsExtraControl() const;
54 // implementation only
57 // returns true if the file can be shown as active
58 bool CheckFile( const wxString
& filename
);
62 // not supported for file dialog, RR
63 virtual void DoSetSize(int WXUNUSED(x
), int WXUNUSED(y
),
64 int WXUNUSED(width
), int WXUNUSED(height
),
65 int WXUNUSED(sizeFlags
) = wxSIZE_AUTO
) {}
67 void SetupExtraControls(WXWindow nativeWindow
);
70 virtual wxWindow
* CreateFilterPanel(wxWindow
*extracontrol
);
71 virtual void OnFilterSelected(wxCommandEvent
&event
);
73 wxArrayString m_filterExtensions
;
74 wxArrayString m_filterNames
;
75 wxChoice
* m_filterChoice
;
76 wxWindow
* m_filterPanel
;
77 bool m_useFileTypeFilter
;
78 int m_firstFileTypeFilter
;
79 wxArrayString m_currentExtensions
;
80 WX_NSObject m_delegate
;
84 #endif // _WX_FILEDLG_H_