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