1998-09-18 10:19:10 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: cursor.h
|
|
|
|
// Purpose: wxCursor class
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 17/09/98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-09-18 10:19:10 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_CURSOR_H_
|
|
|
|
#define _WX_CURSOR_H_
|
|
|
|
|
2003-08-09 12:38:21 +00:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
1998-09-18 10:19:10 +00:00
|
|
|
#pragma interface "cursor.h"
|
|
|
|
#endif
|
|
|
|
|
2003-03-22 15:46:22 +00:00
|
|
|
#include "wx/object.h"
|
|
|
|
#include "wx/gdicmn.h"
|
1998-09-18 10:19:10 +00:00
|
|
|
|
2003-03-22 15:46:22 +00:00
|
|
|
class WXDLLEXPORT wxImage;
|
1998-09-18 10:19:10 +00:00
|
|
|
|
|
|
|
// Cursor
|
2003-03-22 15:46:22 +00:00
|
|
|
class WXDLLEXPORT wxCursor: public wxObject
|
1998-09-18 10:19:10 +00:00
|
|
|
{
|
2002-02-05 16:34:33 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxCursor)
|
|
|
|
|
1998-09-18 10:19:10 +00:00
|
|
|
public:
|
2002-02-05 16:34:33 +00:00
|
|
|
wxCursor();
|
|
|
|
|
|
|
|
// Copy constructors
|
|
|
|
wxCursor(const wxCursor& cursor) { Ref(cursor); }
|
|
|
|
|
2003-05-27 20:31:41 +00:00
|
|
|
wxCursor(const char bits[], int width, int height,
|
|
|
|
int hotSpotX = -1, int hotSpotY = -1,
|
|
|
|
const char maskBits[] = NULL);
|
2002-02-05 16:34:33 +00:00
|
|
|
|
|
|
|
wxCursor(const wxString& name, long flags = wxBITMAP_TYPE_XBM,
|
|
|
|
int hotSpotX = 0, int hotSpotY = 0);
|
2002-07-01 20:34:20 +00:00
|
|
|
|
|
|
|
#if wxUSE_IMAGE
|
|
|
|
wxCursor(const wxImage& image);
|
|
|
|
#endif
|
|
|
|
|
2002-02-05 16:34:33 +00:00
|
|
|
wxCursor(wxStockCursor id);
|
|
|
|
~wxCursor();
|
|
|
|
|
2003-03-22 15:46:22 +00:00
|
|
|
virtual bool Ok() const;
|
2002-02-05 16:34:33 +00:00
|
|
|
|
2003-03-22 15:46:22 +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; }
|
|
|
|
|
2002-02-05 16:34:33 +00:00
|
|
|
// Motif-specific.
|
|
|
|
// Create/get a cursor for the current display
|
2004-06-28 19:22:48 +00:00
|
|
|
WXCursor GetXCursor(WXDisplay* display) const;
|
2003-03-22 15:46:22 +00:00
|
|
|
private:
|
2003-05-27 20:31:41 +00:00
|
|
|
void Create(const char bits[], int width, int height,
|
|
|
|
int hotSpotX = -1, int hotSpotY = -1,
|
|
|
|
const char maskBits[] = NULL);
|
|
|
|
void Create(WXPixmap cursor, WXPixmap mask, int hotSpotX, int hotSpotY);
|
|
|
|
|
2002-02-05 16:34:33 +00:00
|
|
|
// Make a cursor from standard id
|
2004-06-28 19:22:48 +00:00
|
|
|
WXCursor MakeCursor(WXDisplay* display, wxStockCursor id) const;
|
1998-09-18 10:19:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern WXDLLEXPORT void wxSetCursor(const wxCursor& cursor);
|
|
|
|
|
|
|
|
#endif
|
2002-02-05 16:34:33 +00:00
|
|
|
// _WX_CURSOR_H_
|