1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/osx/filedlg.h
3 // Purpose: wxFileDialog class
4 // Author: Stefan Csomor
7 // Copyright: (c) Stefan Csomor
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_FILEDLG_H_
12 #define _WX_FILEDLG_H_
14 class WXDLLIMPEXP_FWD_CORE wxChoice
;
16 //-------------------------------------------------------------------------
18 //-------------------------------------------------------------------------
20 // set this system option to 1 in order to always show the filetypes popup in
21 // file open dialogs if possible
23 #define wxOSX_FILEDIALOG_ALWAYS_SHOW_TYPES wxT("osx.openfiledialog.always-show-types")
25 class WXDLLIMPEXP_CORE wxFileDialog
: public wxFileDialogBase
27 DECLARE_DYNAMIC_CLASS(wxFileDialog
)
29 wxArrayString m_fileNames
;
30 wxArrayString m_paths
;
33 wxFileDialog() { Init(); }
34 wxFileDialog(wxWindow
*parent
,
35 const wxString
& message
= wxFileSelectorPromptStr
,
36 const wxString
& defaultDir
= wxEmptyString
,
37 const wxString
& defaultFile
= wxEmptyString
,
38 const wxString
& wildCard
= wxFileSelectorDefaultWildcardStr
,
39 long style
= wxFD_DEFAULT_STYLE
,
40 const wxPoint
& pos
= wxDefaultPosition
,
41 const wxSize
& sz
= wxDefaultSize
,
42 const wxString
& name
= wxFileDialogNameStr
)
46 Create(parent
,message
,defaultDir
,defaultFile
,wildCard
,style
,pos
,sz
,name
);
49 void Create(wxWindow
*parent
,
50 const wxString
& message
= wxFileSelectorPromptStr
,
51 const wxString
& defaultDir
= wxEmptyString
,
52 const wxString
& defaultFile
= wxEmptyString
,
53 const wxString
& wildCard
= wxFileSelectorDefaultWildcardStr
,
54 long style
= wxFD_DEFAULT_STYLE
,
55 const wxPoint
& pos
= wxDefaultPosition
,
56 const wxSize
& sz
= wxDefaultSize
,
57 const wxString
& name
= wxFileDialogNameStr
);
63 virtual void GetPaths(wxArrayString
& paths
) const { paths
= m_paths
; }
64 virtual void GetFilenames(wxArrayString
& files
) const { files
= m_fileNames
; }
66 virtual int ShowModal();
69 virtual void ShowWindowModal();
70 virtual void ModalFinishedCallback(void* panel
, int resultCode
);
73 virtual bool SupportsExtraControl() const;
75 // implementation only
78 // returns true if the file can be shown as active
79 bool CheckFile( const wxString
& filename
);
83 // not supported for file dialog, RR
84 virtual void DoSetSize(int WXUNUSED(x
), int WXUNUSED(y
),
85 int WXUNUSED(width
), int WXUNUSED(height
),
86 int WXUNUSED(sizeFlags
) = wxSIZE_AUTO
) {}
88 void SetupExtraControls(WXWindow nativeWindow
);
91 virtual wxWindow
* CreateFilterPanel(wxWindow
*extracontrol
);
92 void DoOnFilterSelected(int index
);
93 virtual void OnFilterSelected(wxCommandEvent
&event
);
95 wxArrayString m_filterExtensions
;
96 wxArrayString m_filterNames
;
97 wxChoice
* m_filterChoice
;
98 wxWindow
* m_filterPanel
;
99 bool m_useFileTypeFilter
;
100 int m_firstFileTypeFilter
;
101 wxArrayString m_currentExtensions
;
102 WX_NSObject m_delegate
;
103 WX_NSObject m_sheetDelegate
;
107 // Common part of all ctors.
111 #endif // _WX_FILEDLG_H_