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
|
|
|
|
// 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();
|
2002-08-04 23:12:36 -04:00
|
|
|
~wxCursorRefData() { Free(); }
|
|
|
|
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
|
|
|
// Copy constructors
|
|
|
|
wxCursor(const wxCursor& rCursor) { Ref(rCursor); }
|
|
|
|
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() { }
|
1999-07-29 01:11:30 -04:00
|
|
|
|
2002-08-04 23:12:36 -04:00
|
|
|
inline wxCursor& operator = (const wxCursor& rCursor)
|
|
|
|
{
|
|
|
|
if (*this == rCursor)
|
|
|
|
return (*this);
|
|
|
|
Ref(rCursor);
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
inline bool operator == (const wxCursor& rCursor) { return m_refData == rCursor.m_refData; }
|
|
|
|
inline bool operator != (const wxCursor& rCursor) { 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_
|