]>
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 | ||
6d167489 VZ |
19 | // compatible (even if incorrect) behaviour by default: derive wxCursor from |
20 | // wxBitmap | |
21 | #ifndef wxICON_IS_BITMAP | |
22 | #define wxICON_IS_BITMAP 1 | |
23 | #endif | |
24 | ||
25 | #if wxICON_IS_BITMAP | |
26 | #include "wx/bitmap.h" | |
27 | ||
28 | #define wxCursorRefDataBase wxBitmapRefData | |
29 | #define wxCursorBase wxBitmap | |
30 | #else | |
31 | #include "wx/msw/gdiimage.h" | |
2bda0e17 | 32 | |
6d167489 VZ |
33 | #define wxCursorRefDataBase wxGDIImageRefData |
34 | #define wxCursorBase wxGDIImage | |
35 | #endif | |
36 | ||
4a38127b VZ |
37 | class WXDLLEXPORT wxImage; |
38 | ||
6d167489 | 39 | class WXDLLEXPORT wxCursorRefData : public wxCursorRefDataBase |
2bda0e17 | 40 | { |
2bda0e17 | 41 | public: |
6d167489 VZ |
42 | wxCursorRefData(); |
43 | virtual ~wxCursorRefData() { Free(); } | |
2bda0e17 | 44 | |
6d167489 | 45 | virtual void Free(); |
2bda0e17 | 46 | |
6d167489 VZ |
47 | // for compatibility |
48 | public: | |
49 | bool m_destroyCursor; | |
50 | }; | |
2bda0e17 KB |
51 | |
52 | // Cursor | |
6d167489 | 53 | class WXDLLEXPORT wxCursor : public wxCursorBase |
2bda0e17 | 54 | { |
2bda0e17 | 55 | public: |
6d167489 | 56 | wxCursor(); |
2bda0e17 | 57 | |
6d167489 VZ |
58 | // Copy constructors |
59 | wxCursor(const wxCursor& cursor) { Ref(cursor); } | |
bff4ec63 | 60 | wxCursor(const wxImage & image) ; |
6d167489 VZ |
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); | |
68 | virtual ~wxCursor(); | |
2bda0e17 | 69 | |
6d167489 VZ |
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; } | |
2bda0e17 | 73 | |
6d167489 VZ |
74 | void SetHCURSOR(WXHCURSOR cursor) { SetHandle((WXHANDLE)cursor); } |
75 | WXHCURSOR GetHCURSOR() const { return (WXHCURSOR)GetHandle(); } | |
2bda0e17 | 76 | |
6d167489 VZ |
77 | protected: |
78 | virtual wxGDIImageRefData *CreateData() const { return new wxCursorRefData; } | |
2bda0e17 | 79 | |
6d167489 VZ |
80 | private: |
81 | DECLARE_DYNAMIC_CLASS(wxCursor) | |
2bda0e17 KB |
82 | }; |
83 | ||
84 | #endif | |
bbcdf8bc | 85 | // _WX_CURSOR_H_ |