1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
1999-11-24 12:30:56 +00:00
|
|
|
// Name: wx/msw/cursor.h
|
1998-05-20 14:12:05 +00:00
|
|
|
// Purpose: wxCursor class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
1998-08-07 23:52:45 +00:00
|
|
|
// Copyright: (c) Julian Smart
|
1999-11-24 12:30:56 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 23:52:45 +00:00
|
|
|
#ifndef _WX_CURSOR_H_
|
|
|
|
#define _WX_CURSOR_H_
|
1998-05-20 14:12:05 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
1999-11-24 12:30:56 +00:00
|
|
|
#pragma interface "cursor.h"
|
1998-05-20 14:12:05 +00:00
|
|
|
#endif
|
|
|
|
|
1999-11-24 12:30:56 +00:00
|
|
|
// compatible (even if incorrect) behaviour by default: derive wxCursor from
|
|
|
|
// wxBitmap
|
|
|
|
#ifndef wxICON_IS_BITMAP
|
|
|
|
#define wxICON_IS_BITMAP 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if wxICON_IS_BITMAP
|
|
|
|
#include "wx/bitmap.h"
|
|
|
|
|
|
|
|
#define wxCursorRefDataBase wxBitmapRefData
|
|
|
|
#define wxCursorBase wxBitmap
|
|
|
|
#else
|
|
|
|
#include "wx/msw/gdiimage.h"
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-11-24 12:30:56 +00:00
|
|
|
#define wxCursorRefDataBase wxGDIImageRefData
|
|
|
|
#define wxCursorBase wxGDIImage
|
|
|
|
#endif
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxCursorRefData : public wxCursorRefDataBase
|
1998-05-20 14:12:05 +00:00
|
|
|
{
|
|
|
|
public:
|
1999-11-24 12:30:56 +00:00
|
|
|
wxCursorRefData();
|
|
|
|
virtual ~wxCursorRefData() { Free(); }
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-11-24 12:30:56 +00:00
|
|
|
virtual void Free();
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-11-24 12:30:56 +00:00
|
|
|
// for compatibility
|
|
|
|
public:
|
|
|
|
bool m_destroyCursor;
|
|
|
|
};
|
1998-05-20 14:12:05 +00:00
|
|
|
|
|
|
|
// Cursor
|
1999-11-24 12:30:56 +00:00
|
|
|
class WXDLLEXPORT wxCursor : public wxCursorBase
|
1998-05-20 14:12:05 +00:00
|
|
|
{
|
|
|
|
public:
|
1999-11-24 12:30:56 +00:00
|
|
|
wxCursor();
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-11-24 12:30:56 +00:00
|
|
|
// Copy constructors
|
|
|
|
wxCursor(const wxCursor& cursor) { Ref(cursor); }
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-11-24 12:30:56 +00:00
|
|
|
wxCursor(const char bits[], int width, int height,
|
|
|
|
int hotSpotX = -1, int hotSpotY = -1,
|
|
|
|
const char maskBits[] = NULL);
|
|
|
|
wxCursor(const wxString& name,
|
|
|
|
long flags = wxBITMAP_TYPE_CUR_RESOURCE,
|
|
|
|
int hotSpotX = 0, int hotSpotY = 0);
|
|
|
|
wxCursor(int cursor_type);
|
|
|
|
virtual ~wxCursor();
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-11-24 12:30:56 +00:00
|
|
|
wxCursor& operator = (const wxCursor& cursor) { if (*this == cursor) return (*this); Ref(cursor); return *this; }
|
|
|
|
bool operator == (const wxCursor& cursor) const { return m_refData == cursor.m_refData; }
|
|
|
|
bool operator != (const wxCursor& cursor) const { return m_refData != cursor.m_refData; }
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-11-24 12:30:56 +00:00
|
|
|
void SetHCURSOR(WXHCURSOR cursor) { SetHandle((WXHANDLE)cursor); }
|
|
|
|
WXHCURSOR GetHCURSOR() const { return (WXHCURSOR)GetHandle(); }
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-11-24 12:30:56 +00:00
|
|
|
protected:
|
|
|
|
virtual wxGDIImageRefData *CreateData() const { return new wxCursorRefData; }
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-11-24 12:30:56 +00:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxCursor)
|
1998-05-20 14:12:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
1998-08-07 23:52:45 +00:00
|
|
|
// _WX_CURSOR_H_
|