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 WXDLLIMPEXP_CORE wxCursorRefData
: public wxGDIImageRefData
21 virtual ~wxCursorRefData() { Free(); }
22 virtual void Free(void);
23 bool m_bDestroyCursor
;
24 }; // end of CLASS wxCursorRefData
26 #define M_CURSORDATA ((wxCursorRefData *)m_refData)
27 #define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData)
30 class WXDLLIMPEXP_CORE wxCursor
: public wxBitmap
35 wxCursor(const wxImage
& rImage
);
37 wxCursor( const wxString
& rsName
38 ,wxBitmapType lType
= wxCURSOR_DEFAULT_TYPE
42 wxCursor(wxStockCursor id
) { InitFromStock(id
); }
43 #if WXWIN_COMPATIBILITY_2_8
44 wxCursor(int id
) { InitFromStock((wxStockCursor
)id
); }
46 inline ~wxCursor() { }
48 inline WXHCURSOR
GetHCURSOR(void) const { return (M_CURSORDATA
? M_CURSORDATA
->m_hCursor
: 0); }
49 inline void SetHCURSOR(WXHCURSOR hCursor
) { SetHandle((WXHANDLE
)hCursor
); }
52 void InitFromStock(wxStockCursor
);
53 inline virtual wxGDIImageRefData
* CreateData(void) const { return (new wxCursorRefData
); }
56 DECLARE_DYNAMIC_CLASS(wxCursor
)
57 }; // end of CLASS wxCursor