1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxCursor class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "cursor.h"
19 #include "wx/bitmap.h"
21 class WXDLLEXPORT wxCursorRefData
: public wxBitmapRefData
23 friend class WXDLLEXPORT wxBitmap
;
24 friend class WXDLLEXPORT wxCursor
;
26 wxCursorRefData(void);
27 ~wxCursorRefData(void);
34 #define M_CURSORDATA ((wxCursorRefData *)m_refData)
35 #define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData)
38 class WXDLLEXPORT wxCursor
: public wxBitmap
40 DECLARE_DYNAMIC_CLASS(wxCursor
)
46 inline wxCursor(const wxCursor
& cursor
) { Ref(cursor
); }
48 wxCursor(const char bits
[], int width
, int height
, int hotSpotX
= -1, int hotSpotY
= -1,
49 const char maskBits
[] = NULL
);
50 wxCursor(const wxString
& name
, long flags
= wxBITMAP_TYPE_CUR_RESOURCE
,
51 int hotSpotX
= 0, int hotSpotY
= 0);
52 wxCursor(int cursor_type
);
55 virtual bool Ok(void) const { return (m_refData
!= NULL
&& M_CURSORDATA
->m_hCursor
) ; }
57 inline wxCursor
& operator = (const wxCursor
& cursor
) { if (*this == cursor
) return (*this); Ref(cursor
); return *this; }
58 inline bool operator == (const wxCursor
& cursor
) { return m_refData
== cursor
.m_refData
; }
59 inline bool operator != (const wxCursor
& cursor
) { return m_refData
!= cursor
.m_refData
; }
61 void SetHCURSOR(WXHCURSOR cursor
);
62 inline WXHCURSOR
GetHCURSOR(void) const { return (M_CURSORDATA
? M_CURSORDATA
->m_hCursor
: 0); }
64 bool FreeResource(bool force
= FALSE
);