]>
Commit | Line | Data |
---|---|---|
0e320a79 DW |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: cursor.h | |
3 | // Purpose: wxCursor class | |
37f214d5 | 4 | // Author: David Webster |
0e320a79 | 5 | // Modified by: |
37f214d5 | 6 | // Created: 10/13/99 |
0e320a79 | 7 | // RCS-ID: $Id$ |
37f214d5 | 8 | // Copyright: (c) David Webster |
65571936 | 9 | // Licence: wxWindows licence |
0e320a79 DW |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_CURSOR_H_ | |
13 | #define _WX_CURSOR_H_ | |
14 | ||
0e320a79 DW |
15 | #include "wx/bitmap.h" |
16 | ||
760a4fb9 | 17 | class WXDLLEXPORT wxCursorRefData: public wxGDIImageRefData |
0e320a79 | 18 | { |
0e320a79 DW |
19 | public: |
20 | wxCursorRefData(); | |
d3c7fc99 | 21 | virtual ~wxCursorRefData() { Free(); } |
760a4fb9 DW |
22 | virtual void Free(void); |
23 | bool m_bDestroyCursor; | |
24 | }; // end of CLASS wxCursorRefData | |
0e320a79 DW |
25 | |
26 | #define M_CURSORDATA ((wxCursorRefData *)m_refData) | |
27 | #define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData) | |
28 | ||
29 | // Cursor | |
30 | class WXDLLEXPORT wxCursor: public wxBitmap | |
31 | { | |
0e320a79 | 32 | public: |
760a4fb9 | 33 | wxCursor(); |
0e320a79 | 34 | |
760a4fb9 | 35 | wxCursor(const wxImage& rImage); |
0e320a79 | 36 | |
760a4fb9 DW |
37 | wxCursor( const char acBits[] |
38 | ,int nWidth | |
39 | ,int nHeight | |
40 | ,int nHotSpotX = -1 | |
41 | ,int nHotSpotY = -1 | |
42 | ,const char zMaskBits[] = NULL | |
43 | ); | |
44 | wxCursor( const wxString& rsName | |
45 | ,long lFlags = wxBITMAP_TYPE_CUR_RESOURCE | |
46 | ,int nHotSpotX = 0 | |
47 | ,int nHotSpotY = 0 | |
48 | ); | |
49 | wxCursor(int nCursorType); | |
50 | inline ~wxCursor() { } | |
0e70f525 SN |
51 | inline bool operator == (const wxCursor& rCursor) const { return m_refData == rCursor.m_refData; } |
52 | inline bool operator != (const wxCursor& rCursor) const { return m_refData != rCursor.m_refData; } | |
0e320a79 | 53 | |
760a4fb9 DW |
54 | inline WXHCURSOR GetHCURSOR(void) const { return (M_CURSORDATA ? M_CURSORDATA->m_hCursor : 0); } |
55 | inline void SetHCURSOR(WXHCURSOR hCursor) { SetHandle((WXHANDLE)hCursor); } | |
0e320a79 | 56 | |
760a4fb9 DW |
57 | protected: |
58 | inline virtual wxGDIImageRefData* CreateData(void) const { return (new wxCursorRefData); } | |
0e320a79 | 59 | |
760a4fb9 DW |
60 | private: |
61 | DECLARE_DYNAMIC_CLASS(wxCursor) | |
62 | }; // end of CLASS wxCursor | |
0e320a79 DW |
63 | |
64 | #endif | |
65 | // _WX_CURSOR_H_ |