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:
@@ -1390,6 +1390,18 @@ Returns the result of the call to \helpref{::wxYield}{wxyield}.
|
|||||||
|
|
||||||
<wx/utils.h>
|
<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}
|
\membersection{::wxSetDisplayName}\label{wxsetdisplayname}
|
||||||
|
|
||||||
\func{void}{wxSetDisplayName}{\param{const wxString\& }{displayName}}
|
\func{void}{wxSetDisplayName}{\param{const wxString\& }{displayName}}
|
||||||
|
@@ -239,6 +239,9 @@ WXDLLEXPORT bool wxYield();
|
|||||||
// Yield to other apps/messages and disable user input
|
// Yield to other apps/messages and disable user input
|
||||||
WXDLLEXPORT bool wxSafeYield(wxWindow *win = NULL);
|
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
|
// Check whether this window wants to process messages, e.g. Stop button
|
||||||
// in long calculations.
|
// in long calculations.
|
||||||
WXDLLEXPORT bool wxCheckForInterrupt(wxWindow *wnd);
|
WXDLLEXPORT bool wxCheckForInterrupt(wxWindow *wnd);
|
||||||
|
@@ -733,28 +733,23 @@ whereami(name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#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
|
// Yield to other apps/messages and disable user input
|
||||||
bool wxSafeYield(wxWindow *win)
|
bool wxSafeYield(wxWindow *win)
|
||||||
{
|
{
|
||||||
wxWindowList::Node *node;
|
wxEnableTopLevelWindow(FALSE);
|
||||||
for ( node = wxTopLevelWindows.GetFirst(); node; node = node->GetNext() )
|
// always enable ourselves
|
||||||
{
|
if ( win )
|
||||||
node->GetData()->Enable(FALSE);
|
win->Enable(TRUE);
|
||||||
}
|
bool rc = wxYield();
|
||||||
|
wxEnableToplevelWindows(TRUE);
|
||||||
// always enable ourselves
|
return rc;
|
||||||
if ( win )
|
|
||||||
win->Enable(TRUE);
|
|
||||||
bool rc = wxYield();
|
|
||||||
|
|
||||||
for ( node = wxTopLevelWindows.GetFirst(); node; node = node->GetNext() )
|
|
||||||
{
|
|
||||||
node->GetData()->Enable(TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
return rc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user