wiring OnInit on osx to a later point in event processing
[wxWidgets.git] / src / common / preferencescmn.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/common/preferencescmn.cpp
3 // Purpose: wxPreferencesEditor implementation common to all platforms.
4 // Author: Vaclav Slavik
5 // Created: 2013-02-19
6 // RCS-ID: $Id$
7 // Copyright: (c) 2013 Vaclav Slavik <vslavik@fastmail.fm>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
10
11 // ============================================================================
12 // declarations
13 // ============================================================================
14
15 // ----------------------------------------------------------------------------
16 // headers
17 // ----------------------------------------------------------------------------
18
19 // for compilers that support precompilation, includes "wx.h".
20 #include "wx/wxprec.h"
21
22 #ifdef __BORLANDC__
23 #pragma hdrstop
24 #endif
25
26 #if wxUSE_PREFERENCES_EDITOR
27
28 #include "wx/private/preferences.h"
29 #include "wx/intl.h"
30
31 // ============================================================================
32 // implementation
33 // ============================================================================
34
35 wxString wxStockPreferencesPage::GetName() const
36 {
37 switch ( m_kind )
38 {
39 case Kind_General:
40 return _("General");
41 case Kind_Advanced:
42 return _("Advanced");
43 }
44 return wxString(); // silence compiler warning
45 }
46
47 wxPreferencesEditor::wxPreferencesEditor(const wxString& title)
48 : m_impl(wxPreferencesEditorImpl::Create(title))
49 {
50 }
51
52 wxPreferencesEditor::~wxPreferencesEditor()
53 {
54 delete m_impl;
55 }
56
57 void wxPreferencesEditor::AddPage(wxPreferencesPage* page)
58 {
59 wxCHECK_RET( page, "can't set NULL page" );
60 m_impl->AddPage(page);
61 }
62
63 void wxPreferencesEditor::Show(wxWindow* parent)
64 {
65 m_impl->Show(parent);
66 }
67
68 void wxPreferencesEditor::Dismiss()
69 {
70 m_impl->Dismiss();
71 }
72
73 #endif // wxUSE_PREFERENCES_EDITOR