X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1777b9bbf4573dabecf4a3256d0d3c2c0c2a3fdf..ad115b2d656d79790b41b88d6dd578f0e624612c:/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_