]> git.saurik.com Git - wxWidgets.git/commitdiff
Useful little fix that automatically hides the busy cursor in modal dialogs.
authorKarsten Ballüder <ballueder@usa.net>
Thu, 12 Aug 1999 15:36:50 +0000 (15:36 +0000)
committerKarsten Ballüder <ballueder@usa.net>
Thu, 12 Aug 1999 15:36:50 +0000 (15:36 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3360 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/cursor.h
modules
src/gtk/dialog.cpp
src/gtk1/dialog.cpp

index 2e793baa8aac213dc328ccbe080570aa13e72c12..f163125fa6f11f5df2f9c8a4f487a4c446103005 100644 (file)
 #include "wx/stubs/cursor.h"
 #endif
 
+#include "wx/utils.h"
+/* This is a small class which can be used by all ports
+   to temporarily suspend the busy cursor. Useful in modal
+   dialogs.
+*/
+class wxBusyCursorSuspender
+{
+public:
+   wxBusyCursorSuspender()
+      {
+         m_wasBusy = wxIsBusy();
+         if(m_wasBusy)
+            wxEndBusyCursor();
+      }
+   ~wxBusyCursorSuspender()
+      {
+         if(m_wasBusy)
+            wxBeginBusyCursor();
+      }
+ private:
+   bool m_wasBusy;
+};
 #endif
     // _WX_CURSOR_H_BASE_
diff --git a/modules b/modules
index 0a7d7da39c85f7fef88f282937baebce447934ef..f6f3a0de2a4d9abad81122e2f56d7a789d167104 100644 (file)
--- a/modules
+++ b/modules
@@ -1,14 +1,9 @@
 wxGTK -a wxWindows !wxWindows/docs/latex \
-       !wxWindows/docs/msw !wxWindows/docs/motif  wxWindows/include/wx \
+       !wxWindows/docs/msw !wxWindows/docs/motif \
        !wxWindows/include/wx/msw !wxWindows/include/wx/motif  !wxWindows/include/wx/qt \
        !wxWindows/include/wx/stubs !wxWindows/src/msw !wxWindows/src/qt !wxWindows/src/motif \
        !wxWindows/include/wx/mac wxWindows/src/jpeg \
-       !wxWindows/src/stubs wxWindows/src/gdk_imlib wxWindows/src/generic wxWindows/src/common \
-       wxWindows/src/png wxWindows/src/zlib wxWindows/src/gtk wxWindows/src/unix \
-       wxWindows/lib wxWindows/src/gtk.inc wxWindows/setup \
-       wxWindows/configure.in wxWindows/configure wxWindows/config.sub \
-       wxWindows/config.guess wxWindows/wx-config.in wxWindows/src/Makefile wxWindows/src/Makefile.in \
-       !wxWindows/misc !wxWindows/user !wxWindows/samples !wxWindows/utils 
+       !wxWindows/src/stubs !wxWindows/misc !wxWindows/user !wxWindows/samples !wxWindows/utils 
 
 wxQt -a wxWindows/Makefile wxWindows/install/unix wxWindows/install-sh \
        wxWindows/template.mak wxWindows/docs !wxWindows/docs/latex !wxWindows/docs/msw \
index bed7d500ffc0419620660708ec89ddf1189231af..9812ec9c7b98f3593e5ee8383657113df33be3af 100644 (file)
@@ -18,6 +18,7 @@
 #include "gdk/gdk.h"
 #include "gtk/gtk.h"
 #include "wx/gtk/win_gtk.h"
+#include "wx/cursor.h"
 
 //-----------------------------------------------------------------------------
 // idle system
@@ -595,6 +596,8 @@ int wxDialog::ShowModal()
        return GetReturnCode();
     }
 
+    wxBusyCursorSuspender cs; // temporarily suppress the busy cursor
+    
     Show( TRUE );
 
     m_modalShowing = TRUE;
index bed7d500ffc0419620660708ec89ddf1189231af..9812ec9c7b98f3593e5ee8383657113df33be3af 100644 (file)
@@ -18,6 +18,7 @@
 #include "gdk/gdk.h"
 #include "gtk/gtk.h"
 #include "wx/gtk/win_gtk.h"
+#include "wx/cursor.h"
 
 //-----------------------------------------------------------------------------
 // idle system
@@ -595,6 +596,8 @@ int wxDialog::ShowModal()
        return GetReturnCode();
     }
 
+    wxBusyCursorSuspender cs; // temporarily suppress the busy cursor
+    
     Show( TRUE );
 
     m_modalShowing = TRUE;