]>
Commit | Line | Data |
---|---|---|
0e320a79 DW |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: cursor.h | |
3 | // Purpose: wxCursor class | |
37f214d5 | 4 | // Author: David Webster |
0e320a79 | 5 | // Modified by: |
37f214d5 | 6 | // Created: 10/13/99 |
0e320a79 | 7 | // RCS-ID: $Id$ |
37f214d5 DW |
8 | // Copyright: (c) David Webster |
9 | // Licence: wxWindows licence | |
0e320a79 DW |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_CURSOR_H_ | |
13 | #define _WX_CURSOR_H_ | |
14 | ||
0e320a79 DW |
15 | #include "wx/bitmap.h" |
16 | ||
17 | class WXDLLEXPORT wxCursorRefData: public wxBitmapRefData | |
18 | { | |
19 | friend class WXDLLEXPORT wxBitmap; | |
20 | friend class WXDLLEXPORT wxCursor; | |
21 | public: | |
22 | wxCursorRefData(); | |
23 | ~wxCursorRefData(); | |
24 | ||
25 | protected: | |
37f214d5 | 26 | bool m_destroyCursor; |
0e320a79 DW |
27 | }; |
28 | ||
29 | #define M_CURSORDATA ((wxCursorRefData *)m_refData) | |
30 | #define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData) | |
31 | ||
32 | // Cursor | |
33 | class WXDLLEXPORT wxCursor: public wxBitmap | |
34 | { | |
35 | DECLARE_DYNAMIC_CLASS(wxCursor) | |
36 | ||
37 | public: | |
38 | wxCursor(); | |
39 | ||
40 | // Copy constructors | |
41 | inline wxCursor(const wxCursor& cursor) { Ref(cursor); } | |
b9b1d6c8 | 42 | wxCursor(const wxImage& rImage); |
0e320a79 DW |
43 | |
44 | wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1, | |
45 | const char maskBits[] = NULL); | |
0e320a79 DW |
46 | wxCursor(const wxString& name, long flags = wxBITMAP_TYPE_CUR_RESOURCE, |
47 | int hotSpotX = 0, int hotSpotY = 0); | |
0e320a79 DW |
48 | wxCursor(int cursor_type); |
49 | ~wxCursor(); | |
50 | ||
0e320a79 DW |
51 | virtual bool Ok() const { return (m_refData != NULL) ; } |
52 | ||
53 | inline wxCursor& operator = (const wxCursor& cursor) { if (*this == cursor) return (*this); Ref(cursor); return *this; } | |
54 | inline bool operator == (const wxCursor& cursor) { return m_refData == cursor.m_refData; } | |
55 | inline bool operator != (const wxCursor& cursor) { return m_refData != cursor.m_refData; } | |
56 | ||
0e320a79 DW |
57 | void SetHCURSOR(WXHCURSOR cursor); |
58 | inline WXHCURSOR GetHCURSOR() const { return (M_CURSORDATA ? M_CURSORDATA->m_hCursor : 0); } | |
0e320a79 | 59 | |
37f214d5 DW |
60 | bool FreeResource(bool force = FALSE); |
61 | }; | |
0e320a79 DW |
62 | |
63 | #endif | |
64 | // _WX_CURSOR_H_ |