Do not derive wxCursor from wxBitmap, plus misc cleanup.
Derive wxGauge from wxGaugeBase, use XmScale for the implementation if the Motif version supports the XmTHERMOMETER style. Derive wxSlider from wxSliderBase; generate wxEVT_SCROLL_THUMBRELEASE in addition to wxEVT_SCROLL_THUMBTRACK; misc cleanup. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19705 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -16,38 +16,13 @@
|
||||
#pragma interface "cursor.h"
|
||||
#endif
|
||||
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/object.h"
|
||||
#include "wx/gdicmn.h"
|
||||
|
||||
/* Cursor for one display, so we can choose the correct one for
|
||||
* the current display.
|
||||
*/
|
||||
class wxXCursor : public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxXCursor)
|
||||
|
||||
public:
|
||||
WXDisplay* m_display;
|
||||
WXCursor m_cursor;
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxCursorRefData: public wxBitmapRefData
|
||||
{
|
||||
friend class WXDLLEXPORT wxBitmap;
|
||||
friend class WXDLLEXPORT wxCursor;
|
||||
public:
|
||||
wxCursorRefData();
|
||||
~wxCursorRefData();
|
||||
|
||||
wxList m_cursors; // wxXCursor objects, one per display
|
||||
wxStockCursor m_cursorId; // wxWindows standard cursor id
|
||||
};
|
||||
|
||||
#define M_CURSORDATA ((wxCursorRefData *)m_refData)
|
||||
#define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData)
|
||||
class WXDLLEXPORT wxImage;
|
||||
|
||||
// Cursor
|
||||
class WXDLLEXPORT wxCursor: public wxBitmap
|
||||
class WXDLLEXPORT wxCursor: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxCursor)
|
||||
|
||||
@@ -70,15 +45,19 @@ public:
|
||||
wxCursor(wxStockCursor id);
|
||||
~wxCursor();
|
||||
|
||||
virtual bool Ok() const { return ((m_refData != NULL) && M_CURSORDATA->m_ok); }
|
||||
|
||||
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; }
|
||||
virtual bool Ok() const;
|
||||
|
||||
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; }
|
||||
|
||||
// Motif-specific.
|
||||
// Create/get a cursor for the current display
|
||||
WXCursor GetXCursor(WXDisplay* display) ;
|
||||
private:
|
||||
// Make a cursor from standard id
|
||||
WXCursor MakeCursor(WXDisplay* display, wxStockCursor id);
|
||||
};
|
||||
|
Reference in New Issue
Block a user