Files
wxWidgets/src/common/preferencescmn.cpp
Vadim Zeitlin 654c4b7b14 Allow to specify the title used by wxPreferencesEditor window.
Customize the title is useful for "Settings"-style windows which are used for
editing the properties of the given object, that should be identified in the
window title, as opposed to the global program preferences.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74006 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-05-16 14:42:56 +00:00

70 lines
1.9 KiB
C++

///////////////////////////////////////////////////////////////////////////////
// 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(const wxString& title)
: m_impl(wxPreferencesEditorImpl::Create(title))
{
}
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();
}