Add wxPreferencesEditor class.
Implements native UI for preferences editing. In particular, the API handles the differences between modal (Windows) and non-modal (OS X) preferences windows and provides platform's native look. Currently implemented natively for wxOSX/Cocoa, wxGTK and Windows (the latter is used as a fallback generic implementation as well). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73576 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
69
src/common/preferencescmn.cpp
Normal file
69
src/common/preferencescmn.cpp
Normal file
@@ -0,0 +1,69 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/common/preferencescmn.cpp
|
||||
// Purpose: wxPreferencesEditor implementation common to all platforms.
|
||||
// Author: Vaclav Slavik
|
||||
// Created: 2013-02-19
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2013 Vaclav Slavik <vslavik@fastmail.fm>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// for compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#include "wx/private/preferences.h"
|
||||
#include "wx/intl.h"
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
wxString wxStockPreferencesPage::GetName() const
|
||||
{
|
||||
switch ( m_kind )
|
||||
{
|
||||
case Kind_General:
|
||||
return _("General");
|
||||
case Kind_Advanced:
|
||||
return _("Advanced");
|
||||
}
|
||||
return wxString(); // silence compiler warning
|
||||
}
|
||||
|
||||
wxPreferencesEditor::wxPreferencesEditor()
|
||||
: m_impl(wxPreferencesEditorImpl::Create())
|
||||
{
|
||||
}
|
||||
|
||||
wxPreferencesEditor::~wxPreferencesEditor()
|
||||
{
|
||||
delete m_impl;
|
||||
}
|
||||
|
||||
void wxPreferencesEditor::AddPage(wxPreferencesPage* page)
|
||||
{
|
||||
wxCHECK_RET( page, "can't set NULL page" );
|
||||
m_impl->AddPage(page);
|
||||
}
|
||||
|
||||
void wxPreferencesEditor::Show(wxWindow* parent)
|
||||
{
|
||||
m_impl->Show(parent);
|
||||
}
|
||||
|
||||
void wxPreferencesEditor::Dismiss()
|
||||
{
|
||||
m_impl->Dismiss();
|
||||
}
|
||||
Reference in New Issue
Block a user