1998-08-15 00:23:28 +00:00
|
|
|
#ifndef _WX_CURSOR_H_BASE_
|
|
|
|
#define _WX_CURSOR_H_BASE_
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1998-07-10 14:15:17 +00:00
|
|
|
#if defined(__WXMSW__)
|
1998-05-20 14:01:55 +00:00
|
|
|
#include "wx/msw/cursor.h"
|
1998-07-10 14:15:17 +00:00
|
|
|
#elif defined(__WXMOTIF__)
|
1998-08-15 00:23:28 +00:00
|
|
|
#include "wx/motif/cursor.h"
|
1998-07-10 14:15:17 +00:00
|
|
|
#elif defined(__WXGTK__)
|
1998-05-20 14:01:55 +00:00
|
|
|
#include "wx/gtk/cursor.h"
|
1998-08-07 20:23:17 +00:00
|
|
|
#elif defined(__WXQT__)
|
|
|
|
#include "wx/qt/cursor.h"
|
1998-08-15 00:23:28 +00:00
|
|
|
#elif defined(__WXMAC__)
|
|
|
|
#include "wx/mac/cursor.h"
|
1999-07-28 03:38:12 +00:00
|
|
|
#elif defined(__WXPM__)
|
|
|
|
#include "wx/os2/cursor.h"
|
1998-08-15 00:23:28 +00:00
|
|
|
#elif defined(__WXSTUBS__)
|
|
|
|
#include "wx/stubs/cursor.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif
|
|
|
|
|
1999-08-12 15:36:50 +00:00
|
|
|
#include "wx/utils.h"
|
2000-09-12 15:15:44 +00:00
|
|
|
|
1999-08-12 15:36:50 +00:00
|
|
|
/* This is a small class which can be used by all ports
|
|
|
|
to temporarily suspend the busy cursor. Useful in modal
|
|
|
|
dialogs.
|
2000-07-15 19:51:35 +00:00
|
|
|
|
|
|
|
Actually that is not (any longer) quite true.. currently it is
|
|
|
|
only used in wxGTK Dialog::ShowModal() and now uses static
|
|
|
|
wxBusyCursor methods that are only implemented for wxGTK so far.
|
|
|
|
The BusyCursor handling code should probably be implemented in
|
|
|
|
common code somewhere instead of the separate implementations we
|
|
|
|
currently have. Also the name BusyCursorSuspender is a little
|
|
|
|
misleading since it doesn't actually suspend the BusyCursor, just
|
|
|
|
masks one that is already showing.
|
|
|
|
If another call to wxBeginBusyCursor is made while this is active
|
|
|
|
the Busy Cursor will again be shown. But at least now it doesn't
|
|
|
|
interfere with the state of wxIsBusy() -- RL
|
|
|
|
|
1999-08-12 15:36:50 +00:00
|
|
|
*/
|
|
|
|
class wxBusyCursorSuspender
|
|
|
|
{
|
|
|
|
public:
|
2000-07-15 19:51:35 +00:00
|
|
|
wxBusyCursorSuspender()
|
|
|
|
{
|
|
|
|
if( wxIsBusy() )
|
|
|
|
{
|
|
|
|
wxSetCursor( wxBusyCursor::GetStoredCursor() );
|
|
|
|
wxYield();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
~wxBusyCursorSuspender()
|
|
|
|
{
|
|
|
|
if( wxIsBusy() )
|
|
|
|
{
|
|
|
|
wxSetCursor( wxBusyCursor::GetBusyCursor() );
|
|
|
|
wxYield();
|
|
|
|
}
|
|
|
|
}
|
1999-08-12 15:36:50 +00:00
|
|
|
};
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif
|
1998-08-15 00:23:28 +00:00
|
|
|
// _WX_CURSOR_H_BASE_
|