X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/eaa69588615bad177910f1dac8ee22142ce1dcb1..8e77fd8bca165aab9709649d79a7cbc6a172d4e1:/include/wx/preferences.h?ds=sidebyside diff --git a/include/wx/preferences.h b/include/wx/preferences.h index 935c7b1875..fb6387a075 100644 --- a/include/wx/preferences.h +++ b/include/wx/preferences.h @@ -24,9 +24,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 // ---------------------------------------------------------------------------- @@ -89,7 +93,9 @@ class WXDLLIMPEXP_CORE wxPreferencesEditor public: // Ctor creates an empty editor, use AddPage() to add controls to it. wxPreferencesEditor(const wxString& title = wxString()); - ~wxPreferencesEditor(); + + // 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. @@ -100,8 +106,7 @@ public: // platform, i.e. depending on whether the dialog is modal or not. 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(); @@ -117,6 +122,16 @@ 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;