]>
Commit | Line | Data |
---|---|---|
2bda0e17 | 1 | ///////////////////////////////////////////////////////////////////////////// |
6d167489 | 2 | // Name: wx/msw/cursor.h |
2bda0e17 KB |
3 | // Purpose: wxCursor class |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
7 | // RCS-ID: $Id$ | |
bbcdf8bc | 8 | // Copyright: (c) Julian Smart |
6d167489 | 9 | // Licence: wxWindows licence |
2bda0e17 KB |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
bbcdf8bc JS |
12 | #ifndef _WX_CURSOR_H_ |
13 | #define _WX_CURSOR_H_ | |
2bda0e17 KB |
14 | |
15 | #ifdef __GNUG__ | |
6d167489 | 16 | #pragma interface "cursor.h" |
2bda0e17 KB |
17 | #endif |
18 | ||
c781807d | 19 | #include "wx/msw/gdiimage.h" |
6d167489 | 20 | |
4a38127b VZ |
21 | class WXDLLEXPORT wxImage; |
22 | ||
c781807d | 23 | class WXDLLEXPORT wxCursorRefData : public wxGDIImageRefData |
2bda0e17 | 24 | { |
2bda0e17 | 25 | public: |
6d167489 VZ |
26 | wxCursorRefData(); |
27 | virtual ~wxCursorRefData() { Free(); } | |
2bda0e17 | 28 | |
6d167489 | 29 | virtual void Free(); |
2bda0e17 | 30 | |
6d167489 VZ |
31 | // for compatibility |
32 | public: | |
33 | bool m_destroyCursor; | |
34 | }; | |
2bda0e17 KB |
35 | |
36 | // Cursor | |
c781807d | 37 | class WXDLLEXPORT wxCursor : public wxGDIImage |
2bda0e17 | 38 | { |
2bda0e17 | 39 | public: |
6d167489 | 40 | wxCursor(); |
2bda0e17 | 41 | |
6d167489 VZ |
42 | // Copy constructors |
43 | wxCursor(const wxCursor& cursor) { Ref(cursor); } | |
c781807d | 44 | wxCursor(const wxImage& image); |
6d167489 VZ |
45 | wxCursor(const char bits[], int width, int height, |
46 | int hotSpotX = -1, int hotSpotY = -1, | |
47 | const char maskBits[] = NULL); | |
48 | wxCursor(const wxString& name, | |
49 | long flags = wxBITMAP_TYPE_CUR_RESOURCE, | |
50 | int hotSpotX = 0, int hotSpotY = 0); | |
51 | wxCursor(int cursor_type); | |
52 | virtual ~wxCursor(); | |
2bda0e17 | 53 | |
6d167489 VZ |
54 | wxCursor& operator = (const wxCursor& cursor) { if (*this == cursor) return (*this); Ref(cursor); return *this; } |
55 | bool operator == (const wxCursor& cursor) const { return m_refData == cursor.m_refData; } | |
56 | bool operator != (const wxCursor& cursor) const { return m_refData != cursor.m_refData; } | |
2bda0e17 | 57 | |
6d167489 VZ |
58 | void SetHCURSOR(WXHCURSOR cursor) { SetHandle((WXHANDLE)cursor); } |
59 | WXHCURSOR GetHCURSOR() const { return (WXHCURSOR)GetHandle(); } | |
2bda0e17 | 60 | |
6d167489 VZ |
61 | protected: |
62 | virtual wxGDIImageRefData *CreateData() const { return new wxCursorRefData; } | |
2bda0e17 | 63 | |
6d167489 VZ |
64 | private: |
65 | DECLARE_DYNAMIC_CLASS(wxCursor) | |
2bda0e17 KB |
66 | }; |
67 | ||
68 | #endif | |
bbcdf8bc | 69 | // _WX_CURSOR_H_ |