1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxCursor class
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #include "wx/bitmap.h"
17 class WXDLLEXPORT wxCursorRefData
: public wxBitmapRefData
19 friend class WXDLLEXPORT wxBitmap
;
20 friend class WXDLLEXPORT wxCursor
;
29 #define M_CURSORDATA ((wxCursorRefData *)m_refData)
30 #define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData)
33 class WXDLLEXPORT wxCursor
: public wxBitmap
35 DECLARE_DYNAMIC_CLASS(wxCursor
)
41 inline wxCursor(const wxCursor
& cursor
) { Ref(cursor
); }
43 wxCursor(const char bits
[], int width
, int height
, int hotSpotX
= -1, int hotSpotY
= -1,
44 const char maskBits
[] = NULL
);
45 wxCursor(const wxString
& name
, long flags
= wxBITMAP_TYPE_CUR_RESOURCE
,
46 int hotSpotX
= 0, int hotSpotY
= 0);
47 wxCursor(int cursor_type
);
50 virtual bool Ok() const { return (m_refData
!= NULL
) ; }
52 inline wxCursor
& operator = (const wxCursor
& cursor
) { if (*this == cursor
) return (*this); Ref(cursor
); return *this; }
53 inline bool operator == (const wxCursor
& cursor
) { return m_refData
== cursor
.m_refData
; }
54 inline bool operator != (const wxCursor
& cursor
) { return m_refData
!= cursor
.m_refData
; }
56 void SetHCURSOR(WXHCURSOR cursor
);
57 inline WXHCURSOR
GetHCURSOR() const { return (M_CURSORDATA
? M_CURSORDATA
->m_hCursor
: 0); }
59 bool FreeResource(bool force
= FALSE
);