1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: cursor.h
|
|
|
|
// Purpose: wxCursor class
|
1999-10-14 00:43:46 -04:00
|
|
|
// Author: David Webster
|
1999-07-29 01:11:30 -04:00
|
|
|
// Modified by:
|
1999-10-14 00:43:46 -04:00
|
|
|
// Created: 10/13/99
|
1999-07-29 01:11:30 -04:00
|
|
|
// RCS-ID: $Id$
|
1999-10-14 00:43:46 -04:00
|
|
|
// Copyright: (c) David Webster
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1999-07-29 01:11:30 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_CURSOR_H_
|
|
|
|
#define _WX_CURSOR_H_
|
|
|
|
|
|
|
|
#include "wx/bitmap.h"
|
|
|
|
|
2002-08-04 23:12:36 -04:00
|
|
|
class WXDLLEXPORT wxCursorRefData: public wxGDIImageRefData
|
1999-07-29 01:11:30 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxCursorRefData();
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxCursorRefData() { Free(); }
|
2002-08-04 23:12:36 -04:00
|
|
|
virtual void Free(void);
|
|
|
|
bool m_bDestroyCursor;
|
|
|
|
}; // end of CLASS wxCursorRefData
|
1999-07-29 01:11:30 -04:00
|
|
|
|
|
|
|
#define M_CURSORDATA ((wxCursorRefData *)m_refData)
|
|
|
|
#define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData)
|
|
|
|
|
|
|
|
// Cursor
|
|
|
|
class WXDLLEXPORT wxCursor: public wxBitmap
|
|
|
|
{
|
|
|
|
public:
|
2002-08-04 23:12:36 -04:00
|
|
|
wxCursor();
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2002-08-04 23:12:36 -04:00
|
|
|
wxCursor(const wxImage& rImage);
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2002-08-04 23:12:36 -04:00
|
|
|
wxCursor( const char acBits[]
|
|
|
|
,int nWidth
|
|
|
|
,int nHeight
|
|
|
|
,int nHotSpotX = -1
|
|
|
|
,int nHotSpotY = -1
|
|
|
|
,const char zMaskBits[] = NULL
|
|
|
|
);
|
|
|
|
wxCursor( const wxString& rsName
|
|
|
|
,long lFlags = wxBITMAP_TYPE_CUR_RESOURCE
|
|
|
|
,int nHotSpotX = 0
|
|
|
|
,int nHotSpotY = 0
|
|
|
|
);
|
|
|
|
wxCursor(int nCursorType);
|
|
|
|
inline ~wxCursor() { }
|
2004-05-09 13:30:57 -04:00
|
|
|
inline bool operator == (const wxCursor& rCursor) const { return m_refData == rCursor.m_refData; }
|
|
|
|
inline bool operator != (const wxCursor& rCursor) const { return m_refData != rCursor.m_refData; }
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2002-08-04 23:12:36 -04:00
|
|
|
inline WXHCURSOR GetHCURSOR(void) const { return (M_CURSORDATA ? M_CURSORDATA->m_hCursor : 0); }
|
|
|
|
inline void SetHCURSOR(WXHCURSOR hCursor) { SetHandle((WXHANDLE)hCursor); }
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2002-08-04 23:12:36 -04:00
|
|
|
protected:
|
|
|
|
inline virtual wxGDIImageRefData* CreateData(void) const { return (new wxCursorRefData); }
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2002-08-04 23:12:36 -04:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxCursor)
|
|
|
|
}; // end of CLASS wxCursor
|
1999-07-29 01:11:30 -04:00
|
|
|
|
|
|
|
#endif
|
|
|
|
// _WX_CURSOR_H_
|