Make wxDragImage ctors taking hot spot point really deprecated in wxMSW.

They were documented as deprecated and deprecated in the generic version (and
actually not even available there any more without WXWIN_COMPATIBILITY_2_6)
but not in wxMSW, where we just had the weird wxLogDebug() statements that
were inconsistent with our handling of deprecation everywhere else.

Do deprecate them now, remove wxLogDebug() and also remove the deprecated
ctors and Create() overloads from the documentation.

Finally, remove the documentation of deprecated and available in the generic
version only ctor taking only wxCursor (closes #13967).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70584 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-02-15 00:35:25 +00:00
parent c3a0b0d876
commit 82b30473f9
3 changed files with 51 additions and 64 deletions

View File

@@ -114,14 +114,6 @@ public:
Create(image, cursor); Create(image, cursor);
} }
// Deprecated form of the above
wxDragImage(const wxBitmap& image, const wxCursor& cursor, const wxPoint& cursorHotspot)
{
Init();
Create(image, cursor, cursorHotspot);
}
wxDragImage(const wxIcon& image, const wxCursor& cursor = wxNullCursor) wxDragImage(const wxIcon& image, const wxCursor& cursor = wxNullCursor)
{ {
Init(); Init();
@@ -129,14 +121,6 @@ public:
Create(image, cursor); Create(image, cursor);
} }
// Deprecated form of the above
wxDragImage(const wxIcon& image, const wxCursor& cursor, const wxPoint& cursorHotspot)
{
Init();
Create(image, cursor, cursorHotspot);
}
wxDragImage(const wxString& str, const wxCursor& cursor = wxNullCursor) wxDragImage(const wxString& str, const wxCursor& cursor = wxNullCursor)
{ {
Init(); Init();
@@ -144,14 +128,6 @@ public:
Create(str, cursor); Create(str, cursor);
} }
// Deprecated form of the above
wxDragImage(const wxString& str, const wxCursor& cursor, const wxPoint& cursorHotspot)
{
Init();
Create(str, cursor, cursorHotspot);
}
#if wxUSE_TREECTRL #if wxUSE_TREECTRL
wxDragImage(const wxTreeCtrl& treeCtrl, wxTreeItemId& id) wxDragImage(const wxTreeCtrl& treeCtrl, wxTreeItemId& id)
{ {
@@ -180,27 +156,12 @@ public:
// Create a drag image from a bitmap and optional cursor // Create a drag image from a bitmap and optional cursor
bool Create(const wxBitmap& image, const wxCursor& cursor = wxNullCursor); bool Create(const wxBitmap& image, const wxCursor& cursor = wxNullCursor);
bool Create(const wxBitmap& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot))
{
wxLogDebug(wxT("wxDragImage::Create: use of a cursor hotspot is now deprecated. Please omit this argument."));
return Create(image, cursor);
}
// Create a drag image from an icon and optional cursor // Create a drag image from an icon and optional cursor
bool Create(const wxIcon& image, const wxCursor& cursor = wxNullCursor); bool Create(const wxIcon& image, const wxCursor& cursor = wxNullCursor);
bool Create(const wxIcon& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot))
{
wxLogDebug(wxT("wxDragImage::Create: use of a cursor hotspot is now deprecated. Please omit this argument."));
return Create(image, cursor);
}
// Create a drag image from a string and optional cursor // Create a drag image from a string and optional cursor
bool Create(const wxString& str, const wxCursor& cursor = wxNullCursor); bool Create(const wxString& str, const wxCursor& cursor = wxNullCursor);
bool Create(const wxString& str, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot))
{
wxLogDebug(wxT("wxDragImage::Create: use of a cursor hotspot is now deprecated. Please omit this argument."));
return Create(str, cursor);
}
#if wxUSE_TREECTRL #if wxUSE_TREECTRL
// Create a drag image for the given tree control item // Create a drag image for the given tree control item
@@ -248,6 +209,16 @@ public:
WXHIMAGELIST GetCursorHIMAGELIST() const { return m_hCursorImageList; } WXHIMAGELIST GetCursorHIMAGELIST() const { return m_hCursorImageList; }
#endif #endif
// don't use in new code, use versions without hot spot parameter
#if WXWIN_COMPATIBILITY_2_8
wxDEPRECATED_CONSTRUCTOR( wxDragImage(const wxBitmap& image, const wxCursor& cursor, const wxPoint& cursorHotspot) );
wxDEPRECATED_CONSTRUCTOR( wxDragImage(const wxString& str, const wxCursor& cursor, const wxPoint& cursorHotspot) );
wxDEPRECATED_CONSTRUCTOR( wxDragImage(const wxIcon& image, const wxCursor& cursor, const wxPoint& cursorHotspot) );
wxDEPRECATED( bool Create(const wxBitmap& image, const wxCursor& cursor, const wxPoint& cursorHotspot) );
wxDEPRECATED( bool Create(const wxIcon& image, const wxCursor& cursor, const wxPoint& cursorHotspot) );
wxDEPRECATED( bool Create(const wxString& str, const wxCursor& cursor, const wxPoint& cursorHotspot) );
#endif // WXWIN_COMPATIBILITY_2_8
protected: protected:
WXHIMAGELIST m_hImageList; WXHIMAGELIST m_hImageList;

View File

@@ -56,11 +56,8 @@ public:
Bitmap to be used as the drag image. The bitmap can have a mask. Bitmap to be used as the drag image. The bitmap can have a mask.
@param cursor @param cursor
Optional cursor to combine with the image. Optional cursor to combine with the image.
@param cursorHotspot
This parameter is deprecated.
*/ */
wxDragImage(const wxBitmap& image, const wxCursor& cursor = wxNullCursor, wxDragImage(const wxBitmap& image, const wxCursor& cursor = wxNullCursor);
const wxPoint& cursorHotspot = wxPoint(0, 0));
/** /**
Constructs a drag image from an icon and optional cursor. Constructs a drag image from an icon and optional cursor.
@@ -68,15 +65,12 @@ public:
Icon to be used as the drag image. Icon to be used as the drag image.
@param cursor @param cursor
Optional cursor to combine with the image. Optional cursor to combine with the image.
@param cursorHotspot
This parameter is deprecated.
@beginWxPythonOnly @beginWxPythonOnly
This constructor is called wxDragIcon in wxPython. This constructor is called wxDragIcon in wxPython.
@endWxPythonOnly @endWxPythonOnly
*/ */
wxDragImage(const wxIcon& image, const wxCursor& cursor = wxNullCursor, wxDragImage(const wxIcon& image, const wxCursor& cursor = wxNullCursor);
const wxPoint& cursorHotspot = wxPoint(0, 0));
/** /**
Constructs a drag image from a text string and optional cursor. Constructs a drag image from a text string and optional cursor.
@@ -84,15 +78,12 @@ public:
Text used to construct a drag image. Text used to construct a drag image.
@param cursor @param cursor
Optional cursor to combine with the image. Optional cursor to combine with the image.
@param cursorHotspot
This parameter is deprecated.
@beginWxPythonOnly @beginWxPythonOnly
This constructor is called wxDragString in wxPython. This constructor is called wxDragString in wxPython.
@endWxPythonOnly @endWxPythonOnly
*/ */
wxDragImage(const wxString& text, const wxCursor& cursor = wxNullCursor, wxDragImage(const wxString& text, const wxCursor& cursor = wxNullCursor);
const wxPoint& cursorHotspot = wxPoint(0, 0));
/** /**
Constructs a drag image from the text in the given tree control item, Constructs a drag image from the text in the given tree control item,
and optional cursor. and optional cursor.
@@ -121,19 +112,6 @@ public:
@endWxPythonOnly @endWxPythonOnly
*/ */
wxDragImage(const wxListCtrl& listCtrl, long id); wxDragImage(const wxListCtrl& listCtrl, long id);
/**
Constructs a drag image an optional cursor. This constructor is only
available for wxGenericDragImage, and can be used when the application
supplies DoDrawImage() and GetImageRect().
@param cursor
Optional cursor to combine with the image.
@param cursorHotspot
This parameter is deprecated.
*/
wxDragImage(const wxCursor& cursor = wxNullCursor,
const wxPoint& cursorHotspot = wxPoint(0, 0));
/** /**
Start dragging the image, in a window or full screen. Start dragging the image, in a window or full screen.

View File

@@ -96,6 +96,44 @@ void wxDragImage::Init()
m_fullScreen = false; m_fullScreen = false;
} }
#if WXWIN_COMPATIBILITY_2_8
wxDragImage::wxDragImage(const wxBitmap& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot))
{
Init();
Create(image, cursor);
}
wxDragImage::wxDragImage(const wxIcon& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot))
{
Init();
Create(image, cursor);
}
wxDragImage::wxDragImage(const wxString& str, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot))
{
Init();
Create(str, cursor);
}
bool wxDragImage::Create(const wxBitmap& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot))
{
return Create(image, cursor);
}
bool wxDragImage::Create(const wxIcon& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot))
{
return Create(image, cursor);
}
bool wxDragImage::Create(const wxString& str, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot))
{
return Create(str, cursor);
}
#endif // WXWIN_COMPATIBILITY_2_8
// Attributes // Attributes
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////