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