Implemented Chuck Messenger's naming and simplification improvements,
plus Move coordinate correction git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9701 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -23,6 +23,10 @@
|
||||
#include "wx/treectrl.h"
|
||||
#include "wx/listctrl.h"
|
||||
|
||||
// If 1, use a simple wxCursor instead of ImageList_SetDragCursorImage,
|
||||
// and some other simplifications
|
||||
#define wxUSE_SIMPLER_DRAGIMAGE 1
|
||||
|
||||
/*
|
||||
To use this class, create a wxDragImage when you start dragging, for example:
|
||||
|
||||
@@ -106,23 +110,23 @@ public:
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
wxDragImage();
|
||||
wxDragImage(const wxBitmap& image, const wxCursor& cursor = wxNullCursor, const wxPoint& hotspot = wxPoint(0, 0))
|
||||
wxDragImage(const wxBitmap& image, const wxCursor& cursor = wxNullCursor, const wxPoint& cursorHotspot = wxPoint(0, 0))
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(image, cursor, hotspot);
|
||||
Create(image, cursor, cursorHotspot);
|
||||
}
|
||||
wxDragImage(const wxIcon& image, const wxCursor& cursor = wxNullCursor, const wxPoint& hotspot = wxPoint(0, 0))
|
||||
wxDragImage(const wxIcon& image, const wxCursor& cursor = wxNullCursor, const wxPoint& cursorHotspot = wxPoint(0, 0))
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(image, cursor, hotspot);
|
||||
Create(image, cursor, cursorHotspot);
|
||||
}
|
||||
wxDragImage(const wxString& str, const wxCursor& cursor = wxNullCursor, const wxPoint& hotspot = wxPoint(0, 0))
|
||||
wxDragImage(const wxString& str, const wxCursor& cursor = wxNullCursor, const wxPoint& cursorHotspot = wxPoint(0, 0))
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(str, cursor, hotspot);
|
||||
Create(str, cursor, cursorHotspot);
|
||||
}
|
||||
wxDragImage(const wxTreeCtrl& treeCtrl, wxTreeItemId& id)
|
||||
{
|
||||
@@ -145,13 +149,13 @@ public:
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Create a drag image from a bitmap and optional cursor
|
||||
bool Create(const wxBitmap& image, const wxCursor& cursor = wxNullCursor, const wxPoint& hotspot = wxPoint(0, 0));
|
||||
bool Create(const wxBitmap& image, const wxCursor& cursor = wxNullCursor, const wxPoint& cursorHotspot = wxPoint(0, 0));
|
||||
|
||||
// Create a drag image from an icon and optional cursor
|
||||
bool Create(const wxIcon& image, const wxCursor& cursor = wxNullCursor, const wxPoint& hotspot = wxPoint(0, 0));
|
||||
bool Create(const wxIcon& image, const wxCursor& cursor = wxNullCursor, const wxPoint& cursorHotspot = wxPoint(0, 0));
|
||||
|
||||
// Create a drag image from a string and optional cursor
|
||||
bool Create(const wxString& str, const wxCursor& cursor = wxNullCursor, const wxPoint& hotspot = wxPoint(0, 0));
|
||||
bool Create(const wxString& str, const wxCursor& cursor = wxNullCursor, const wxPoint& cursorHotspot = wxPoint(0, 0));
|
||||
|
||||
// Create a drag image for the given tree control item
|
||||
bool Create(const wxTreeCtrl& treeCtrl, wxTreeItemId& id);
|
||||
@@ -190,14 +194,22 @@ public:
|
||||
// Returns the native image list handle
|
||||
WXHIMAGELIST GetHIMAGELIST() const { return m_hImageList; }
|
||||
|
||||
#if !wxUSE_SIMPLER_DRAGIMAGE
|
||||
// Returns the native image list handle for the cursor
|
||||
WXHIMAGELIST GetCursorHIMAGELIST() const { return m_hCursorImageList; }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
WXHIMAGELIST m_hImageList;
|
||||
|
||||
#if wxUSE_SIMPLER_DRAGIMAGE
|
||||
wxCursor m_oldCursor;
|
||||
#else
|
||||
WXHIMAGELIST m_hCursorImageList;
|
||||
#endif
|
||||
|
||||
wxCursor m_cursor;
|
||||
wxPoint m_hotspot;
|
||||
wxPoint m_cursorHotspot;
|
||||
wxPoint m_position;
|
||||
wxWindow* m_window;
|
||||
wxRect m_boundingRect;
|
||||
|
Reference in New Issue
Block a user