]>
Commit | Line | Data |
---|---|---|
0dbd6262 SC |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: cursor.h | |
3 | // Purpose: wxCursor class | |
4 | // Author: AUTHOR | |
5 | // Modified by: | |
6 | // Created: ??/??/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) AUTHOR | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_CURSOR_H_ | |
13 | #define _WX_CURSOR_H_ | |
14 | ||
af49c4b8 | 15 | #if defined(__GNUG__) && !defined(__APPLE__) |
0dbd6262 SC |
16 | #pragma interface "cursor.h" |
17 | #endif | |
18 | ||
19 | #include "wx/bitmap.h" | |
20 | ||
21 | class WXDLLEXPORT wxCursorRefData: public wxBitmapRefData | |
22 | { | |
be52b341 GD |
23 | DECLARE_NO_COPY_CLASS(wxCursorRefData) |
24 | ||
0dbd6262 SC |
25 | friend class WXDLLEXPORT wxBitmap; |
26 | friend class WXDLLEXPORT wxCursor; | |
27 | public: | |
28 | wxCursorRefData(); | |
29 | ~wxCursorRefData(); | |
30 | ||
31 | protected: | |
be52b341 | 32 | WXHCURSOR m_hCursor; |
0dbd6262 SC |
33 | }; |
34 | ||
35 | #define M_CURSORDATA ((wxCursorRefData *)m_refData) | |
36 | #define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData) | |
37 | ||
38 | // Cursor | |
39 | class WXDLLEXPORT wxCursor: public wxBitmap | |
40 | { | |
41 | DECLARE_DYNAMIC_CLASS(wxCursor) | |
42 | ||
43 | public: | |
44 | wxCursor(); | |
45 | ||
46 | // Copy constructors | |
be52b341 GD |
47 | wxCursor(const wxCursor& cursor) |
48 | : wxBitmap() | |
49 | { Ref(cursor); } | |
0dbd6262 SC |
50 | |
51 | wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1, | |
52 | const char maskBits[] = NULL); | |
53 | ||
519cb848 | 54 | wxCursor(const wxString& name, long flags = wxBITMAP_TYPE_MACCURSOR_RESOURCE, |
0dbd6262 SC |
55 | int hotSpotX = 0, int hotSpotY = 0); |
56 | ||
57 | wxCursor(int cursor_type); | |
58 | ~wxCursor(); | |
59 | ||
519cb848 | 60 | virtual bool Ok() const { return (m_refData != NULL && M_CURSORDATA->m_hCursor != NULL ) ; } |
0dbd6262 SC |
61 | |
62 | inline wxCursor& operator = (const wxCursor& cursor) { if (*this == cursor) return (*this); Ref(cursor); return *this; } | |
63 | inline bool operator == (const wxCursor& cursor) { return m_refData == cursor.m_refData; } | |
64 | inline bool operator != (const wxCursor& cursor) { return m_refData != cursor.m_refData; } | |
65 | ||
519cb848 SC |
66 | void MacInstall() const ; |
67 | ||
0dbd6262 SC |
68 | void SetHCURSOR(WXHCURSOR cursor); |
69 | inline WXHCURSOR GetHCURSOR() const { return (M_CURSORDATA ? M_CURSORDATA->m_hCursor : 0); } | |
0dbd6262 SC |
70 | }; |
71 | ||
72 | extern WXDLLEXPORT void wxSetCursor(const wxCursor& cursor); | |
73 | ||
74 | #endif | |
75 | // _WX_CURSOR_H_ |