]>
Commit | Line | Data |
---|---|---|
9b6dbb09 JS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: cursor.h | |
3 | // Purpose: wxCursor class | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 17/09/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart | |
65571936 | 9 | // Licence: wxWindows licence |
9b6dbb09 JS |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_CURSOR_H_ | |
13 | #define _WX_CURSOR_H_ | |
14 | ||
93e73c74 MB |
15 | #include "wx/object.h" |
16 | #include "wx/gdicmn.h" | |
9b6dbb09 | 17 | |
93e73c74 | 18 | class WXDLLEXPORT wxImage; |
9b6dbb09 JS |
19 | |
20 | // Cursor | |
93e73c74 | 21 | class WXDLLEXPORT wxCursor: public wxObject |
9b6dbb09 | 22 | { |
83df96d6 JS |
23 | DECLARE_DYNAMIC_CLASS(wxCursor) |
24 | ||
9b6dbb09 | 25 | public: |
83df96d6 JS |
26 | wxCursor(); |
27 | ||
28 | // Copy constructors | |
29 | wxCursor(const wxCursor& cursor) { Ref(cursor); } | |
30 | ||
ffa3d6b8 MB |
31 | wxCursor(const char bits[], int width, int height, |
32 | int hotSpotX = -1, int hotSpotY = -1, | |
33 | const char maskBits[] = NULL); | |
83df96d6 JS |
34 | |
35 | wxCursor(const wxString& name, long flags = wxBITMAP_TYPE_XBM, | |
36 | int hotSpotX = 0, int hotSpotY = 0); | |
4daa4d66 CE |
37 | |
38 | #if wxUSE_IMAGE | |
39 | wxCursor(const wxImage& image); | |
40 | #endif | |
41 | ||
83df96d6 JS |
42 | wxCursor(wxStockCursor id); |
43 | ~wxCursor(); | |
44 | ||
93e73c74 | 45 | virtual bool Ok() const; |
83df96d6 | 46 | |
93e73c74 MB |
47 | wxCursor& operator = (const wxCursor& cursor) |
48 | { if (*this == cursor) return (*this); Ref(cursor); return *this; } | |
49 | bool operator == (const wxCursor& cursor) const | |
50 | { return m_refData == cursor.m_refData; } | |
51 | bool operator != (const wxCursor& cursor) const | |
52 | { return m_refData != cursor.m_refData; } | |
53 | ||
83df96d6 JS |
54 | // Motif-specific. |
55 | // Create/get a cursor for the current display | |
bc6e28d5 | 56 | WXCursor GetXCursor(WXDisplay* display) const; |
93e73c74 | 57 | private: |
ffa3d6b8 MB |
58 | void Create(const char bits[], int width, int height, |
59 | int hotSpotX = -1, int hotSpotY = -1, | |
60 | const char maskBits[] = NULL); | |
61 | void Create(WXPixmap cursor, WXPixmap mask, int hotSpotX, int hotSpotY); | |
62 | ||
83df96d6 | 63 | // Make a cursor from standard id |
bc6e28d5 | 64 | WXCursor MakeCursor(WXDisplay* display, wxStockCursor id) const; |
9b6dbb09 JS |
65 | }; |
66 | ||
67 | extern WXDLLEXPORT void wxSetCursor(const wxCursor& cursor); | |
68 | ||
69 | #endif | |
83df96d6 | 70 | // _WX_CURSOR_H_ |