]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mac/cursor.h
Added back the missing Undo/Redo accelerators that unaccountably
[wxWidgets.git] / include / wx / mac / cursor.h
CommitLineData
0dbd6262
SC
1/////////////////////////////////////////////////////////////////////////////
2// Name: cursor.h
3// Purpose: wxCursor class
4// Author: AUTHOR
5// Modified by:
6// Created: ??/??/98
7// RCS-ID: $Id$
8// Copyright: (c) AUTHOR
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_CURSOR_H_
13#define _WX_CURSOR_H_
14
15#ifdef __GNUG__
16#pragma interface "cursor.h"
17#endif
18
19#include "wx/bitmap.h"
20
21class WXDLLEXPORT wxCursorRefData: public wxBitmapRefData
22{
23 friend class WXDLLEXPORT wxBitmap;
24 friend class WXDLLEXPORT wxCursor;
25public:
26 wxCursorRefData();
27 ~wxCursorRefData();
28
29protected:
0dbd6262 30 WXHCURSOR m_hCursor;
0dbd6262
SC
31};
32
33#define M_CURSORDATA ((wxCursorRefData *)m_refData)
34#define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData)
35
36// Cursor
37class WXDLLEXPORT wxCursor: public wxBitmap
38{
39 DECLARE_DYNAMIC_CLASS(wxCursor)
40
41public:
42 wxCursor();
43
44 // Copy constructors
45 inline wxCursor(const wxCursor& cursor) { Ref(cursor); }
46
47 wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1,
48 const char maskBits[] = NULL);
49
519cb848 50 wxCursor(const wxString& name, long flags = wxBITMAP_TYPE_MACCURSOR_RESOURCE,
0dbd6262
SC
51 int hotSpotX = 0, int hotSpotY = 0);
52
53 wxCursor(int cursor_type);
54 ~wxCursor();
55
519cb848 56 virtual bool Ok() const { return (m_refData != NULL && M_CURSORDATA->m_hCursor != NULL ) ; }
0dbd6262
SC
57
58 inline wxCursor& operator = (const wxCursor& cursor) { if (*this == cursor) return (*this); Ref(cursor); return *this; }
59 inline bool operator == (const wxCursor& cursor) { return m_refData == cursor.m_refData; }
60 inline bool operator != (const wxCursor& cursor) { return m_refData != cursor.m_refData; }
61
519cb848
SC
62 void MacInstall() const ;
63
0dbd6262
SC
64 void SetHCURSOR(WXHCURSOR cursor);
65 inline WXHCURSOR GetHCURSOR() const { return (M_CURSORDATA ? M_CURSORDATA->m_hCursor : 0); }
0dbd6262
SC
66};
67
68extern WXDLLEXPORT void wxSetCursor(const wxCursor& cursor);
69
70#endif
71 // _WX_CURSOR_H_