]> git.saurik.com Git - wxWidgets.git/blob - include/wx/dirdlg.h
correct access for virtuals
[wxWidgets.git] / include / wx / dirdlg.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/dirdlg.h
3 // Purpose: wxDirDialog base class
4 // Author: Robert Roebling
5 // Modified by:
6 // Created:
7 // Copyright: (c) Robert Roebling
8 // RCS-ID: $Id$
9 // Licence: wxWindows Licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_DIRDLG_H_BASE_
13 #define _WX_DIRDLG_H_BASE_
14
15 #if wxUSE_DIRDLG
16
17 #include "wx/dialog.h"
18
19 // ----------------------------------------------------------------------------
20 // constants
21 // ----------------------------------------------------------------------------
22
23 extern WXDLLEXPORT_DATA(const wxChar) wxDirDialogNameStr[];
24 extern WXDLLEXPORT_DATA(const wxChar) wxDirDialogDefaultFolderStr[];
25 extern WXDLLEXPORT_DATA(const wxChar) wxDirSelectorPromptStr[];
26
27
28 #ifdef __WXWINCE__
29 #define wxDD_DEFAULT_STYLE \
30 (wxDEFAULT_DIALOG_STYLE | wxDD_NEW_DIR_BUTTON)
31 #else
32 #define wxDD_DEFAULT_STYLE \
33 (wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxDD_NEW_DIR_BUTTON)
34 #endif
35
36 //-------------------------------------------------------------------------
37 // wxDirDialogBase
38 //-------------------------------------------------------------------------
39
40 class WXDLLEXPORT wxDirDialogBase : public wxDialog
41 {
42 public:
43 wxDirDialogBase(wxWindow *parent,
44 const wxString& title = wxDirSelectorPromptStr,
45 const wxString& defaultPath = wxEmptyString,
46 long style = wxDD_DEFAULT_STYLE,
47 const wxPoint& pos = wxDefaultPosition,
48 const wxSize& sz = wxDefaultSize,
49 const wxString& name = wxDirDialogNameStr)
50 : wxDialog(parent, wxID_ANY, title, pos, sz, style, name)
51 , m_path(defaultPath)
52 {}
53 wxDirDialogBase() {}
54
55 virtual ~wxDirDialogBase() {}
56
57 virtual void SetMessage(const wxString& message) { m_message = message; }
58 virtual void SetPath(const wxString& path) { m_path = path; }
59 virtual void SetStyle(long style) { SetWindowStyle(style); }
60
61 virtual wxString GetMessage() const { return m_message; }
62 virtual wxString GetPath() const { return m_path; }
63 virtual long GetStyle() const { return GetWindowStyle(); }
64
65 protected:
66 wxString m_message;
67 wxString m_path;
68 };
69
70
71 // Universal and non-port related switches with need for generic implementation
72 #if defined(__WXUNIVERSAL__)
73
74 #include "wx/generic/dirdlgg.h"
75 #define wxDirDialog wxGenericDirDialog
76
77 #elif defined(__WXMSW__) && (defined(__SALFORDC__) || \
78 !wxUSE_OLE || \
79 (defined (__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS))
80
81 #include "wx/generic/dirdlgg.h"
82 #define wxDirDialog wxGenericDirDialog
83
84 // MS PocketPC or MS Smartphone
85 #elif defined(__WXMSW__) && defined(__WXWINCE__) && !defined(__HANDHELDPC__)
86
87 #include "wx/generic/dirdlgg.h"
88 #define wxDirDialog wxGenericDirDialog
89
90 // Native MSW
91 #elif defined(__WXMSW__)
92
93 #include "wx/msw/dirdlg.h"
94
95 // Native GTK for gtk2.x and generic for gtk1.x
96 #elif defined(__WXGTK__)
97
98 #if defined( __WXGTK20__ )
99 #include "wx/gtk/dirdlg.h"
100 #define wxDirDialog wxDirDialogGTK
101 #else
102 #include "wx/generic/dirdlgg.h"
103 #define wxDirDialog wxGenericDirDialog
104 #endif
105
106 // Native Mac
107 #elif defined(__WXMAC__)
108
109 #include "wx/mac/dirdlg.h"
110
111 // Native Cocoa
112 #elif defined(__WXCOCOA__)
113
114 #include "wx/cocoa/dirdlg.h"
115
116 // Other ports use generic implementation
117 #elif defined(__WXMOTIF__) || \
118 defined(__WXX11__) || \
119 defined(__WXMGL__) || \
120 defined(__WXCOCOA__) || \
121 defined(__WXPM__)
122
123 #include "wx/generic/dirdlgg.h"
124 #define wxDirDialog wxGenericDirDialog
125
126 #endif
127
128 // ----------------------------------------------------------------------------
129 // common ::wxDirSelector() function
130 // ----------------------------------------------------------------------------
131
132 WXDLLEXPORT wxString
133 wxDirSelector(const wxString& message = wxDirSelectorPromptStr,
134 const wxString& defaultPath = wxEmptyString,
135 long style = wxDD_DEFAULT_STYLE,
136 const wxPoint& pos = wxDefaultPosition,
137 wxWindow *parent = NULL);
138
139 #endif // wxUSE_DIRDLG
140
141 #endif
142 // _WX_DIRDLG_H_BASE_