Useful little fix that automatically hides the busy cursor in modal dialogs.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3360 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -17,5 +17,27 @@
|
|||||||
#include "wx/stubs/cursor.h"
|
#include "wx/stubs/cursor.h"
|
||||||
#endif
|
#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
|
#endif
|
||||||
// _WX_CURSOR_H_BASE_
|
// _WX_CURSOR_H_BASE_
|
||||||
|
9
modules
9
modules
@@ -1,14 +1,9 @@
|
|||||||
wxGTK -a wxWindows !wxWindows/docs/latex \
|
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/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/stubs !wxWindows/src/msw !wxWindows/src/qt !wxWindows/src/motif \
|
||||||
!wxWindows/include/wx/mac wxWindows/src/jpeg \
|
!wxWindows/include/wx/mac wxWindows/src/jpeg \
|
||||||
!wxWindows/src/stubs wxWindows/src/gdk_imlib wxWindows/src/generic wxWindows/src/common \
|
!wxWindows/src/stubs !wxWindows/misc !wxWindows/user !wxWindows/samples !wxWindows/utils
|
||||||
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
|
|
||||||
|
|
||||||
wxQt -a wxWindows/Makefile wxWindows/install/unix wxWindows/install-sh \
|
wxQt -a wxWindows/Makefile wxWindows/install/unix wxWindows/install-sh \
|
||||||
wxWindows/template.mak wxWindows/docs !wxWindows/docs/latex !wxWindows/docs/msw \
|
wxWindows/template.mak wxWindows/docs !wxWindows/docs/latex !wxWindows/docs/msw \
|
||||||
|
@@ -18,6 +18,7 @@
|
|||||||
#include "gdk/gdk.h"
|
#include "gdk/gdk.h"
|
||||||
#include "gtk/gtk.h"
|
#include "gtk/gtk.h"
|
||||||
#include "wx/gtk/win_gtk.h"
|
#include "wx/gtk/win_gtk.h"
|
||||||
|
#include "wx/cursor.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// idle system
|
// idle system
|
||||||
@@ -595,6 +596,8 @@ int wxDialog::ShowModal()
|
|||||||
return GetReturnCode();
|
return GetReturnCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxBusyCursorSuspender cs; // temporarily suppress the busy cursor
|
||||||
|
|
||||||
Show( TRUE );
|
Show( TRUE );
|
||||||
|
|
||||||
m_modalShowing = TRUE;
|
m_modalShowing = TRUE;
|
||||||
|
@@ -18,6 +18,7 @@
|
|||||||
#include "gdk/gdk.h"
|
#include "gdk/gdk.h"
|
||||||
#include "gtk/gtk.h"
|
#include "gtk/gtk.h"
|
||||||
#include "wx/gtk/win_gtk.h"
|
#include "wx/gtk/win_gtk.h"
|
||||||
|
#include "wx/cursor.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// idle system
|
// idle system
|
||||||
@@ -595,6 +596,8 @@ int wxDialog::ShowModal()
|
|||||||
return GetReturnCode();
|
return GetReturnCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxBusyCursorSuspender cs; // temporarily suppress the busy cursor
|
||||||
|
|
||||||
Show( TRUE );
|
Show( TRUE );
|
||||||
|
|
||||||
m_modalShowing = TRUE;
|
m_modalShowing = TRUE;
|
||||||
|
Reference in New Issue
Block a user