Add wxPreferencesEditor::ShownModally().

While this is not necessary to use wxPreferencesEditor in normal scenario, it
can be useful if the program needs to handle modal dialogs in some special way.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74009 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-05-16 14:43:06 +00:00
parent eaa6958861
commit b5c9627778
3 changed files with 31 additions and 4 deletions

View File

@@ -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
// ----------------------------------------------------------------------------
@@ -117,6 +121,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;

View File

@@ -17,10 +17,6 @@
#define wxHAS_PREF_EDITOR_NATIVE
#endif
#if defined(__WXOSX__) || defined(__WXGTK__)
#define wxHAS_PREF_EDITOR_MODELESS
#endif
// ----------------------------------------------------------------------------
// wxPreferencesEditorImpl: defines wxPreferencesEditor implementation.
// ----------------------------------------------------------------------------