]> git.saurik.com Git - wxWidgets.git/commitdiff
Added wxEnableTopLevelWindows(bool enable) for use by wxSafeYield().
authorKarsten Ballüder <ballueder@usa.net>
Thu, 15 Apr 1999 14:18:12 +0000 (14:18 +0000)
committerKarsten Ballüder <ballueder@usa.net>
Thu, 15 Apr 1999 14:18:12 +0000 (14:18 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2177 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/function.tex
include/wx/utils.h
src/common/utilscmn.cpp

index 39a1950da38b5b9eb09bebd3723bc2ec5ca3bc66..88b47f7324fca27a11828c9135ee065a4071efd8 100644 (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}}
index a6d2991cc692c52823e7b236d24e19e14792d7e0..2f1bcc7768476dd1327ffaea33fafe142cec2111 100644 (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);
index f6cec3461c7c0b862c2a6c4112bed9c41ae5f398..813ca852f50885bf4446c4e213fb9564e9da75ed 100644 (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;
 }
 
 /*