]> git.saurik.com Git - wxWidgets.git/commitdiff
Added wxSafeYield(wxWindow *win=NULL).
authorKarsten Ballüder <ballueder@usa.net>
Mon, 22 Mar 1999 10:22:26 +0000 (10:22 +0000)
committerKarsten Ballüder <ballueder@usa.net>
Mon, 22 Mar 1999 10:22:26 +0000 (10:22 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1949 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/utils.h
src/common/utilscmn.cpp

index 222e822c5b014c274c28bc8df03ca97bb8d187d3..c18128a791ab259ce0eaddb6097e973ffc8764bd 100644 (file)
@@ -171,6 +171,9 @@ WXDLLEXPORT int wxFindMenuItemId(wxFrame *frame, const wxString& menuString, con
 // Yield to other apps/messages
 WXDLLEXPORT bool wxYield();
 
+// Yield to other apps/messages and disable user input
+WXDLLEXPORT bool wxSafeYield(wxWindow *win = NULL);
+
 // Format a message on the standard error (UNIX) or the debugging
 // stream (Windows)
 WXDLLEXPORT void wxDebugMsg(const char *fmt ...) ;
index f15e7f0bbd3b2bb100ac5ef9ab7860309be4f487..be9df90d2fb7162e8d935856b423a59d4b10c564 100644 (file)
@@ -748,6 +748,27 @@ whereami(name)
 
 #endif
 
+
+// Yield to other apps/messages and disable user input
+bool wxSafeYield(wxWindow *win)
+{
+   wxNode *node;
+   for ( node = wxTopLevelWindows.GetFirst();
+         node;
+         node = node->GetNext() )
+      ((wxWindow*)node->GetData())->Enable(FALSE);
+   
+   // always enable ourselves
+   if(win) win->Enable(true);
+   bool rc = wxYield();
+
+   for ( node = wxTopLevelWindows.GetFirst();
+         node;
+         node = node->GetNext() )
+      ((wxWindow*)node->GetData())->Enable(TRUE);
+   return rc;
+}
+
 /*
  * N.B. these convenience functions must be separate from msgdlgg.cpp, textdlgg.cpp
  * since otherwise the generic code may be pulled in unnecessarily.