]>
Commit | Line | Data |
---|---|---|
99d80019 JS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/cursor.h | |
3 | // Purpose: wxCursor base header | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: | |
7 | // Copyright: (c) Julian Smart | |
8 | // RCS-ID: $Id$ | |
9 | // Licence: wxWindows Licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
34138703 JS |
12 | #ifndef _WX_CURSOR_H_BASE_ |
13 | #define _WX_CURSOR_H_BASE_ | |
c801d85f | 14 | |
86d2c809 VZ |
15 | #include "wx/defs.h" |
16 | ||
d6764050 FM |
17 | /* |
18 | wxCursor classes should have the following public API: | |
19 | ||
20 | class WXDLLIMPEXP_CORE wxCursor : public wxGDIObject | |
21 | { | |
22 | public: | |
23 | wxCursor(); | |
24 | wxCursor(const wxImage& image); | |
25 | wxCursor(const wxString& name, | |
26 | wxBitmapType type = wxCURSOR_DEFAULT_TYPE, | |
27 | int hotSpotX = 0, int hotSpotY = 0); | |
28 | wxCursor(wxStockCursor id) { InitFromStock(id); } | |
29 | #if WXWIN_COMPATIBILITY_2_8 | |
30 | wxCursor(int id) { InitFromStock((wxStockCursor)id); } | |
31 | #endif | |
32 | virtual ~wxCursor(); | |
33 | }; | |
34 | ||
35 | */ | |
36 | ||
bd362275 | 37 | #if defined(__WXMSW__) |
0ef5b1da | 38 | #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_CUR_RESOURCE |
86d2c809 | 39 | #include "wx/msw/cursor.h" |
2049ba38 | 40 | #elif defined(__WXMOTIF__) |
0ef5b1da | 41 | #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_XBM |
86d2c809 | 42 | #include "wx/motif/cursor.h" |
1be7a35c | 43 | #elif defined(__WXGTK20__) |
327972e7 VZ |
44 | #ifdef __WINDOWS__ |
45 | #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_CUR_RESOURCE | |
46 | #else | |
47 | #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_XPM | |
48 | #endif | |
86d2c809 | 49 | #include "wx/gtk/cursor.h" |
1be7a35c | 50 | #elif defined(__WXGTK__) |
0ef5b1da | 51 | #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_XPM |
1be7a35c | 52 | #include "wx/gtk1/cursor.h" |
83df96d6 | 53 | #elif defined(__WXX11__) |
0ef5b1da | 54 | #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_XPM |
86d2c809 | 55 | #include "wx/x11/cursor.h" |
b3c86150 | 56 | #elif defined(__WXDFB__) |
0ef5b1da | 57 | #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_CUR_RESOURCE |
b3c86150 | 58 | #include "wx/dfb/cursor.h" |
34138703 | 59 | #elif defined(__WXMAC__) |
0ef5b1da | 60 | #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_MACCURSOR_RESOURCE |
ef0e9220 | 61 | #include "wx/osx/cursor.h" |
e64df9bc | 62 | #elif defined(__WXCOCOA__) |
167d0cb3 | 63 | #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_MACCURSOR_RESOURCE |
86d2c809 | 64 | #include "wx/cocoa/cursor.h" |
1777b9bb | 65 | #elif defined(__WXPM__) |
0ef5b1da | 66 | #define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_CUR_RESOURCE |
86d2c809 | 67 | #include "wx/os2/cursor.h" |
c801d85f KB |
68 | #endif |
69 | ||
eebe4016 | 70 | #include "wx/utils.h" |
83141d3a | 71 | |
eebe4016 KB |
72 | /* This is a small class which can be used by all ports |
73 | to temporarily suspend the busy cursor. Useful in modal | |
74 | dialogs. | |
f6bcfd97 BP |
75 | |
76 | Actually that is not (any longer) quite true.. currently it is | |
77 | only used in wxGTK Dialog::ShowModal() and now uses static | |
78 | wxBusyCursor methods that are only implemented for wxGTK so far. | |
79 | The BusyCursor handling code should probably be implemented in | |
80 | common code somewhere instead of the separate implementations we | |
81 | currently have. Also the name BusyCursorSuspender is a little | |
82 | misleading since it doesn't actually suspend the BusyCursor, just | |
83 | masks one that is already showing. | |
84 | If another call to wxBeginBusyCursor is made while this is active | |
85 | the Busy Cursor will again be shown. But at least now it doesn't | |
86 | interfere with the state of wxIsBusy() -- RL | |
87 | ||
eebe4016 KB |
88 | */ |
89 | class wxBusyCursorSuspender | |
90 | { | |
91 | public: | |
f6bcfd97 BP |
92 | wxBusyCursorSuspender() |
93 | { | |
94 | if( wxIsBusy() ) | |
95 | { | |
96 | wxSetCursor( wxBusyCursor::GetStoredCursor() ); | |
f6bcfd97 BP |
97 | } |
98 | } | |
99 | ~wxBusyCursorSuspender() | |
100 | { | |
101 | if( wxIsBusy() ) | |
102 | { | |
103 | wxSetCursor( wxBusyCursor::GetBusyCursor() ); | |
f6bcfd97 BP |
104 | } |
105 | } | |
eebe4016 | 106 | }; |
c801d85f | 107 | #endif |
34138703 | 108 | // _WX_CURSOR_H_BASE_ |