1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/cursor.h
3 // Purpose: wxCursor class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "cursor.h"
19 // compatible (even if incorrect) behaviour by default: derive wxCursor from
21 #ifndef wxICON_IS_BITMAP
22 #define wxICON_IS_BITMAP 1
26 #include "wx/bitmap.h"
28 #define wxCursorRefDataBase wxBitmapRefData
29 #define wxCursorBase wxBitmap
31 #include "wx/msw/gdiimage.h"
33 #define wxCursorRefDataBase wxGDIImageRefData
34 #define wxCursorBase wxGDIImage
37 class WXDLLEXPORT wxCursorRefData
: public wxCursorRefDataBase
41 virtual ~wxCursorRefData() { Free(); }
51 class WXDLLEXPORT wxCursor
: public wxCursorBase
57 wxCursor(const wxCursor
& cursor
) { Ref(cursor
); }
59 wxCursor(const char bits
[], int width
, int height
,
60 int hotSpotX
= -1, int hotSpotY
= -1,
61 const char maskBits
[] = NULL
);
62 wxCursor(const wxString
& name
,
63 long flags
= wxBITMAP_TYPE_CUR_RESOURCE
,
64 int hotSpotX
= 0, int hotSpotY
= 0);
65 wxCursor(int cursor_type
);
68 wxCursor
& operator = (const wxCursor
& cursor
) { if (*this == cursor
) return (*this); Ref(cursor
); return *this; }
69 bool operator == (const wxCursor
& cursor
) const { return m_refData
== cursor
.m_refData
; }
70 bool operator != (const wxCursor
& cursor
) const { return m_refData
!= cursor
.m_refData
; }
72 void SetHCURSOR(WXHCURSOR cursor
) { SetHandle((WXHANDLE
)cursor
); }
73 WXHCURSOR
GetHCURSOR() const { return (WXHCURSOR
)GetHandle(); }
76 virtual wxGDIImageRefData
*CreateData() const { return new wxCursorRefData
; }
79 DECLARE_DYNAMIC_CLASS(wxCursor
)