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 wxImage
;
39 class WXDLLEXPORT wxCursorRefData
: public wxCursorRefDataBase
43 virtual ~wxCursorRefData() { Free(); }
53 class WXDLLEXPORT wxCursor
: public wxCursorBase
59 wxCursor(const wxCursor
& cursor
) { Ref(cursor
); }
60 wxCursor(const wxImage
& image
) ;
61 wxCursor(const char bits
[], int width
, int height
,
62 int hotSpotX
= -1, int hotSpotY
= -1,
63 const char maskBits
[] = NULL
);
64 wxCursor(const wxString
& name
,
65 long flags
= wxBITMAP_TYPE_CUR_RESOURCE
,
66 int hotSpotX
= 0, int hotSpotY
= 0);
67 wxCursor(int cursor_type
);
70 wxCursor
& operator = (const wxCursor
& cursor
) { if (*this == cursor
) return (*this); Ref(cursor
); return *this; }
71 bool operator == (const wxCursor
& cursor
) const { return m_refData
== cursor
.m_refData
; }
72 bool operator != (const wxCursor
& cursor
) const { return m_refData
!= cursor
.m_refData
; }
74 void SetHCURSOR(WXHCURSOR cursor
) { SetHandle((WXHANDLE
)cursor
); }
75 WXHCURSOR
GetHCURSOR() const { return (WXHCURSOR
)GetHandle(); }
78 virtual wxGDIImageRefData
*CreateData() const { return new wxCursorRefData
; }
81 DECLARE_DYNAMIC_CLASS(wxCursor
)