]> git.saurik.com Git - wxWidgets.git/blob - include/wx/cursor.h
correction for Mac OS X
[wxWidgets.git] / include / wx / cursor.h
1 #ifndef _WX_CURSOR_H_BASE_
2 #define _WX_CURSOR_H_BASE_
3
4 #if defined(__WXMSW__)
5 #include "wx/msw/cursor.h"
6 #elif defined(__WXMOTIF__)
7 #include "wx/motif/cursor.h"
8 #elif defined(__WXGTK__)
9 #include "wx/gtk/cursor.h"
10 #elif defined(__WXQT__)
11 #include "wx/qt/cursor.h"
12 #elif defined(__WXMAC__)
13 #include "wx/mac/cursor.h"
14 #elif defined(__WXPM__)
15 #include "wx/os2/cursor.h"
16 #elif defined(__WXSTUBS__)
17 #include "wx/stubs/cursor.h"
18 #endif
19
20 #include "wx/utils.h"
21
22 /* This is a small class which can be used by all ports
23 to temporarily suspend the busy cursor. Useful in modal
24 dialogs.
25
26 Actually that is not (any longer) quite true.. currently it is
27 only used in wxGTK Dialog::ShowModal() and now uses static
28 wxBusyCursor methods that are only implemented for wxGTK so far.
29 The BusyCursor handling code should probably be implemented in
30 common code somewhere instead of the separate implementations we
31 currently have. Also the name BusyCursorSuspender is a little
32 misleading since it doesn't actually suspend the BusyCursor, just
33 masks one that is already showing.
34 If another call to wxBeginBusyCursor is made while this is active
35 the Busy Cursor will again be shown. But at least now it doesn't
36 interfere with the state of wxIsBusy() -- RL
37
38 */
39 class wxBusyCursorSuspender
40 {
41 public:
42 wxBusyCursorSuspender()
43 {
44 if( wxIsBusy() )
45 {
46 wxSetCursor( wxBusyCursor::GetStoredCursor() );
47 wxYield();
48 }
49 }
50 ~wxBusyCursorSuspender()
51 {
52 if( wxIsBusy() )
53 {
54 wxSetCursor( wxBusyCursor::GetBusyCursor() );
55 wxYield();
56 }
57 }
58 };
59 #endif
60 // _WX_CURSOR_H_BASE_