]> git.saurik.com Git - wxWidgets.git/blame - include/wx/os2/cursor.h
Don't define __STRICT_ANSI__, we should build both with and without it.
[wxWidgets.git] / include / wx / os2 / cursor.h
CommitLineData
0e320a79 1/////////////////////////////////////////////////////////////////////////////
80fdcdb9 2// Name: wx/os2/cursor.h
0e320a79 3// Purpose: wxCursor class
37f214d5 4// Author: David Webster
0e320a79 5// Modified by:
37f214d5 6// Created: 10/13/99
37f214d5 7// Copyright: (c) David Webster
65571936 8// Licence: wxWindows licence
0e320a79
DW
9/////////////////////////////////////////////////////////////////////////////
10
11#ifndef _WX_CURSOR_H_
12#define _WX_CURSOR_H_
13
0e320a79
DW
14#include "wx/bitmap.h"
15
53a2db12 16class WXDLLIMPEXP_CORE wxCursorRefData: public wxGDIImageRefData
0e320a79 17{
0e320a79
DW
18public:
19 wxCursorRefData();
d3c7fc99 20 virtual ~wxCursorRefData() { Free(); }
760a4fb9
DW
21 virtual void Free(void);
22 bool m_bDestroyCursor;
23}; // end of CLASS wxCursorRefData
0e320a79
DW
24
25#define M_CURSORDATA ((wxCursorRefData *)m_refData)
26#define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData)
27
28// Cursor
53a2db12 29class WXDLLIMPEXP_CORE wxCursor: public wxBitmap
0e320a79 30{
0e320a79 31public:
760a4fb9 32 wxCursor();
0e320a79 33
760a4fb9 34 wxCursor(const wxImage& rImage);
0e320a79 35
760a4fb9 36 wxCursor( const wxString& rsName
0ef5b1da 37 ,wxBitmapType lType = wxCURSOR_DEFAULT_TYPE
760a4fb9
DW
38 ,int nHotSpotX = 0
39 ,int nHotSpotY = 0
40 );
0ef5b1da
FM
41 wxCursor(wxStockCursor id) { InitFromStock(id); }
42#if WXWIN_COMPATIBILITY_2_8
43 wxCursor(int id) { InitFromStock((wxStockCursor)id); }
44#endif
760a4fb9 45 inline ~wxCursor() { }
0e320a79 46
760a4fb9
DW
47 inline WXHCURSOR GetHCURSOR(void) const { return (M_CURSORDATA ? M_CURSORDATA->m_hCursor : 0); }
48 inline void SetHCURSOR(WXHCURSOR hCursor) { SetHandle((WXHANDLE)hCursor); }
0e320a79 49
760a4fb9 50protected:
0ef5b1da 51 void InitFromStock(wxStockCursor);
760a4fb9 52 inline virtual wxGDIImageRefData* CreateData(void) const { return (new wxCursorRefData); }
0e320a79 53
760a4fb9
DW
54private:
55 DECLARE_DYNAMIC_CLASS(wxCursor)
56}; // end of CLASS wxCursor
0e320a79
DW
57
58#endif
59 // _WX_CURSOR_H_