Added wxEnableTopLevelWindows(bool enable) for use by wxSafeYield().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2177 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Karsten Ballüder 1999-04-15 14:18:12 +00:00
parent af3de916ef
commit 95dee6514a
3 changed files with 28 additions and 18 deletions

View File

@ -1390,6 +1390,18 @@ Returns the result of the call to \helpref{::wxYield}{wxyield}.
<wx/utils.h>
\membersection{::wxEnableTopLevelWindows}{wxenabletoplevelwindows}
\func{void}{wxEnableTopLevelWindow}{\param{bool}{ enable = TRUE}}
This function enables or disables all top level windows. It is used by
\helpref{::wxSafeYield}{wxsafeyield}.
\wxheading{Include files}
<wx/utils.h>
\membersection{::wxSetDisplayName}\label{wxsetdisplayname}
\func{void}{wxSetDisplayName}{\param{const wxString\& }{displayName}}

View File

@ -239,6 +239,9 @@ WXDLLEXPORT bool wxYield();
// Yield to other apps/messages and disable user input
WXDLLEXPORT bool wxSafeYield(wxWindow *win = NULL);
// Enable or disable input to all top level windows
WXDLLEXPORT void wxEnableTopLevelWindows(bool enable = TRUE);
// Check whether this window wants to process messages, e.g. Stop button
// in long calculations.
WXDLLEXPORT bool wxCheckForInterrupt(wxWindow *wnd);

View File

@ -733,28 +733,23 @@ whereami(name)
}
#endif
void wxEnableTopLevelWindows(bool enable)
{
wxWindowList::Node *node;
for ( node = wxTopLevelWindows.GetFirst(); node; node = node->GetNext() )
node->GetData()->Enable(enable);
}
// Yield to other apps/messages and disable user input
bool wxSafeYield(wxWindow *win)
{
wxWindowList::Node *node;
for ( node = wxTopLevelWindows.GetFirst(); node; node = node->GetNext() )
{
node->GetData()->Enable(FALSE);
}
// always enable ourselves
if ( win )
win->Enable(TRUE);
bool rc = wxYield();
for ( node = wxTopLevelWindows.GetFirst(); node; node = node->GetNext() )
{
node->GetData()->Enable(TRUE);
}
return rc;
wxEnableTopLevelWindow(FALSE);
// always enable ourselves
if ( win )
win->Enable(TRUE);
bool rc = wxYield();
wxEnableToplevelWindows(TRUE);
return rc;
}
/*