Added wxSafeYield(wxWindow *win=NULL).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1949 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Karsten Ballüder 1999-03-22 10:22:26 +00:00
parent 8496896226
commit ead7ce1013
2 changed files with 24 additions and 0 deletions

View 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 ...) ;

View 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.