]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/appcmn.cpp
check in the 'selective yield' patch (see ticket #10320):
[wxWidgets.git] / src / common / appcmn.cpp
index afb51d63c8579d817d742f4f6c4208b9bed3a089..95da92def714e2316dd39e54cadf551fb62e35d8 100644 (file)
@@ -79,6 +79,7 @@ wxAppBase::wxAppBase()
     m_isActive = true;
 
     m_isInsideYield = false;
+    m_eventsToProcessInsideYield = wxEVT_CATEGORY_ALL;
 
     // We don't want to exit the app if the user code shows a dialog from its
     // OnInit() -- but this is what would happen if we set m_exitOnFrameDelete
@@ -325,6 +326,26 @@ void wxAppBase::SetActive(bool active, wxWindow * WXUNUSED(lastFocus))
     (void)ProcessEvent(event);
 }
 
+bool wxAppBase::IsEventAllowedInsideYield(wxEventCategory cat) const
+{
+    return m_eventsToProcessInsideYield & cat;
+}
+
+bool wxAppBase::SafeYield(wxWindow *win, bool onlyIfNeeded)
+{
+    wxWindowDisabler wd(win);
+
+    return Yield(onlyIfNeeded);
+}
+
+bool wxAppBase::SafeYieldFor(wxWindow *win, long eventsToProcess)
+{
+    wxWindowDisabler wd(win);
+
+    return YieldFor(eventsToProcess);
+}
+
+
 // ----------------------------------------------------------------------------
 // idle handling
 // ----------------------------------------------------------------------------