X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1777b9bbf4573dabecf4a3256d0d3c2c0c2a3fdf..20f2deb3cf287fd2857940cba0d5efbcfc3bb0ad:/include/wx/cursor.h diff --git a/include/wx/cursor.h b/include/wx/cursor.h index 2e793baa8a..f163125fa6 100644 --- a/include/wx/cursor.h +++ b/include/wx/cursor.h @@ -17,5 +17,27 @@ #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_