]> git.saurik.com Git - wxWidgets.git/blame - include/wx/os2/cursor.h
added template wxScopedArray<> too
[wxWidgets.git] / include / wx / os2 / cursor.h
CommitLineData
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
53a2db12 17class WXDLLIMPEXP_CORE wxCursorRefData: public wxGDIImageRefData
0e320a79 18{
0e320a79
DW
19public:
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
53a2db12 30class WXDLLIMPEXP_CORE wxCursor: public wxBitmap
0e320a79 31{
0e320a79 32public:
760a4fb9 33 wxCursor();
0e320a79 34
760a4fb9 35 wxCursor(const wxImage& rImage);
0e320a79 36
760a4fb9 37 wxCursor( const wxString& rsName
0ef5b1da 38 ,wxBitmapType lType = wxCURSOR_DEFAULT_TYPE
760a4fb9
DW
39 ,int nHotSpotX = 0
40 ,int nHotSpotY = 0
41 );
0ef5b1da
FM
42 wxCursor(wxStockCursor id) { InitFromStock(id); }
43#if WXWIN_COMPATIBILITY_2_8
44 wxCursor(int id) { InitFromStock((wxStockCursor)id); }
45#endif
760a4fb9 46 inline ~wxCursor() { }
0e320a79 47
760a4fb9
DW
48 inline WXHCURSOR GetHCURSOR(void) const { return (M_CURSORDATA ? M_CURSORDATA->m_hCursor : 0); }
49 inline void SetHCURSOR(WXHCURSOR hCursor) { SetHandle((WXHANDLE)hCursor); }
0e320a79 50
760a4fb9 51protected:
0ef5b1da 52 void InitFromStock(wxStockCursor);
760a4fb9 53 inline virtual wxGDIImageRefData* CreateData(void) const { return (new wxCursorRefData); }
0e320a79 54
760a4fb9
DW
55private:
56 DECLARE_DYNAMIC_CLASS(wxCursor)
57}; // end of CLASS wxCursor
0e320a79
DW
58
59#endif
60 // _WX_CURSOR_H_