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