// 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 ...) ;
#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.