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