X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2aab96f58d53e83313cc1d619dde1c00f6ccaa80..66c2bf7b1d9326fb650acfaae22ec50528cfbf7c:/include/wx/preferences.h?ds=sidebyside diff --git a/include/wx/preferences.h b/include/wx/preferences.h index 6f107ed058..7eee648289 100644 --- a/include/wx/preferences.h +++ b/include/wx/preferences.h @@ -3,7 +3,6 @@ // Purpose: Declaration of wxPreferencesEditor class. // Author: Vaclav Slavik // Created: 2013-02-19 -// RCS-ID: $Id$ // Copyright: (c) 2013 Vaclav Slavik // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -12,6 +11,9 @@ #define _WX_PREFERENCES_H_ #include "wx/defs.h" + +#if wxUSE_PREFERENCES_EDITOR + #include "wx/bitmap.h" #include "wx/vector.h" @@ -24,9 +26,13 @@ class wxPreferencesEditorImpl; #define wxHAS_PREF_EDITOR_ICONS // Changes should be applied immediately #define wxHAS_PREF_EDITOR_APPLY_IMMEDIATELY + // The dialog is shown non-modally. + #define wxHAS_PREF_EDITOR_MODELESS #elif defined(__WXGTK__) // Changes should be applied immediately #define wxHAS_PREF_EDITOR_APPLY_IMMEDIATELY + // The dialog is shown non-modally. + #define wxHAS_PREF_EDITOR_MODELESS #endif // ---------------------------------------------------------------------------- @@ -37,6 +43,7 @@ class wxPreferencesEditorImpl; class WXDLLIMPEXP_CORE wxPreferencesPage { public: + wxPreferencesPage() {} virtual ~wxPreferencesPage() {} // Name of the page, used e.g. for tabs @@ -87,8 +94,10 @@ class WXDLLIMPEXP_CORE wxPreferencesEditor { public: // Ctor creates an empty editor, use AddPage() to add controls to it. - wxPreferencesEditor(); - ~wxPreferencesEditor(); + wxPreferencesEditor(const wxString& title = wxString()); + + // Dtor destroys the dialog if still shown. + virtual ~wxPreferencesEditor(); // Add a new page to the editor. The editor takes ownership of the page // and won't delete it until it is destroyed itself. @@ -97,10 +106,9 @@ public: // Show the preferences dialog or bring it to the top if it's already // shown. Notice that this method may or may not block depending on the // platform, i.e. depending on whether the dialog is modal or not. - 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 but should be called to + // Hide the currently shown dialog, if any. This is typically used to // dismiss the dialog if the object whose preferences it is editing was // closed. void Dismiss(); @@ -116,10 +124,22 @@ public: #endif } + // Whether the dialog is shown modally, i.e. Show() blocks, or not. + static bool ShownModally() + { +#ifdef wxHAS_PREF_EDITOR_MODELESS + return false; +#else + return true; +#endif + } + private: wxPreferencesEditorImpl* m_impl; wxDECLARE_NO_COPY_CLASS(wxPreferencesEditor); }; +#endif // wxUSE_PREFERENCES_EDITOR + #endif // _WX_PREFERENCES_H_