// Purpose: wxPreferencesEditor class documentation.
// Author: Vaclav Slavik
// Created: 2013-02-26
-// RCS-ID: $Id$
// Copyright: (c) 2013 Vaclav Slavik <vslavik@fastmail.fm>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
Constructor.
Creates an empty editor, use AddPage() to add controls to it.
+
+ @param title The title overriding the default title of the top level
+ window used by the editor. It is recommended to not specify this
+ parameter to use the native convention for the preferences dialogs
+ instead.
*/
- wxPreferencesEditor();
+ wxPreferencesEditor(const wxString& title = wxString());
/**
Destructor.
@param parent The window that invokes the preferences.
Call Dismiss() before it's destroyed.
*/
- void Show(wxWindow* parent);
+ virtual void Show(wxWindow* parent);
/**
Hide the currently shown dialog, if any.
- This doesn't do anything on the platforms using modal preferences
- dialogs (e.g. Windows) but should be called to dismiss the dialog if
- the object whose preferences it is editing was closed.
+ This is typically called to dismiss the dialog if the object whose
+ preferences it is editing was closed.
*/
void Dismiss();
in this case as well.
*/
static bool ShouldApplyChangesImmediately()
+
+ /**
+ Returns whether the preferences dialog is shown modally.
+
+ If this method returns false, as it currently does in wxGTK and wxOSX,
+ Show() simply makes the dialog visible and returns immediately. If it
+ returns true, as it does in wxMSW and under the other platforms, then
+ the dialog is shown modally, i.e. Show() blocks until the user
+ dismisses it.
+
+ Notice that it isn't necessary to test the return value of this method
+ to use this class normally, its interface is designed to work in both
+ cases. However it can sometimes be necessary to call it if the program
+ needs to handle modal dialogs specially, e.g. perhaps to block some
+ periodic background update operation while a modal dialog is shown.
+ */
+ static bool ShownModally();
};
class wxPreferencesPage
{
public:
+ /// Constructor.
+ wxPreferencesPage();
+
/// Destructor.
- virtual ~wxPreferencesPage() {}
+ virtual ~wxPreferencesPage();
/**
Return name of the page.
};
/// Constructor.
- wxStockPreferencesPage(Kind kind) : m_kind(kind) {}
+ wxStockPreferencesPage(Kind kind);
/// Returns the page's kind.
- Kind GetKind() const { return m_kind; }
+ Kind GetKind() const;
/// Reimplemented to return suitable name for the page's kind.
virtual wxString GetName() const;