]> git.saurik.com Git - wxWidgets.git/blame - include/wx/osx/filedlg.h
Add functor-taking overload of CallAfter().
[wxWidgets.git] / include / wx / osx / filedlg.h
CommitLineData
6762286d 1/////////////////////////////////////////////////////////////////////////////
80fdcdb9 2// Name: wx/osx/filedlg.h
6762286d
SC
3// Purpose: wxFileDialog class
4// Author: Stefan Csomor
5// Modified by:
6// Created: 1998-01-01
7// RCS-ID: $Id$
8// Copyright: (c) Stefan Csomor
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_FILEDLG_H_
13#define _WX_FILEDLG_H_
14
2de61130
VZ
15class WXDLLIMPEXP_FWD_CORE wxChoice;
16
6762286d
SC
17//-------------------------------------------------------------------------
18// wxFileDialog
19//-------------------------------------------------------------------------
20
13390af4
SC
21// set this system option to 1 in order to always show the filetypes popup in
22// file open dialogs if possible
23
a37e1f0e 24#define wxOSX_FILEDIALOG_ALWAYS_SHOW_TYPES wxT("osx.openfiledialog.always-show-types")
13390af4 25
6762286d
SC
26class WXDLLIMPEXP_CORE wxFileDialog: public wxFileDialogBase
27{
28DECLARE_DYNAMIC_CLASS(wxFileDialog)
29protected:
30 wxArrayString m_fileNames;
31 wxArrayString m_paths;
32
33public:
aad2997b 34 wxFileDialog() { Init(); }
6762286d 35 wxFileDialog(wxWindow *parent,
aad2997b
VZ
36 const wxString& message = wxFileSelectorPromptStr,
37 const wxString& defaultDir = wxEmptyString,
38 const wxString& defaultFile = wxEmptyString,
39 const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
40 long style = wxFD_DEFAULT_STYLE,
41 const wxPoint& pos = wxDefaultPosition,
42 const wxSize& sz = wxDefaultSize,
43 const wxString& name = wxFileDialogNameStr)
44 {
45 Init();
46
47 Create(parent,message,defaultDir,defaultFile,wildCard,style,pos,sz,name);
48 }
49
50 void Create(wxWindow *parent,
6762286d
SC
51 const wxString& message = wxFileSelectorPromptStr,
52 const wxString& defaultDir = wxEmptyString,
53 const wxString& defaultFile = wxEmptyString,
54 const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
55 long style = wxFD_DEFAULT_STYLE,
56 const wxPoint& pos = wxDefaultPosition,
57 const wxSize& sz = wxDefaultSize,
58 const wxString& name = wxFileDialogNameStr);
59
681bf55c
SC
60#if wxOSX_USE_COCOA
61 ~wxFileDialog();
62#endif
63
6762286d
SC
64 virtual void GetPaths(wxArrayString& paths) const { paths = m_paths; }
65 virtual void GetFilenames(wxArrayString& files) const { files = m_fileNames ; }
66
67 virtual int ShowModal();
ce00f59b 68
bfa92264
KO
69#if wxOSX_USE_COCOA
70 virtual void ShowWindowModal();
71 virtual void ModalFinishedCallback(void* panel, int resultCode);
72#endif
6762286d 73
61ad44c7 74 virtual bool SupportsExtraControl() const;
13390af4
SC
75
76 // implementation only
77
78#if wxOSX_USE_COCOA
79 // returns true if the file can be shown as active
80 bool CheckFile( const wxString& filename );
81#endif
ce00f59b 82
6762286d
SC
83protected:
84 // not supported for file dialog, RR
85 virtual void DoSetSize(int WXUNUSED(x), int WXUNUSED(y),
86 int WXUNUSED(width), int WXUNUSED(height),
87 int WXUNUSED(sizeFlags) = wxSIZE_AUTO) {}
ce00f59b 88
2f30930a 89 void SetupExtraControls(WXWindow nativeWindow);
13390af4
SC
90
91#if wxOSX_USE_COCOA
92 virtual wxWindow* CreateFilterPanel(wxWindow *extracontrol);
cbbb1f54 93 void DoOnFilterSelected(int index);
13390af4
SC
94 virtual void OnFilterSelected(wxCommandEvent &event);
95
96 wxArrayString m_filterExtensions;
97 wxArrayString m_filterNames;
98 wxChoice* m_filterChoice;
99 wxWindow* m_filterPanel;
100 bool m_useFileTypeFilter;
101 int m_firstFileTypeFilter;
102 wxArrayString m_currentExtensions;
103 WX_NSObject m_delegate;
681bf55c 104 WX_NSObject m_sheetDelegate;
13390af4 105#endif
aad2997b
VZ
106
107private:
108 // Common part of all ctors.
109 void Init();
6762286d
SC
110};
111
112#endif // _WX_FILEDLG_H_