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