From 7bb22bd68d70175ad7af10a9ec349d72c98f8a75 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 3 May 2012 23:30:40 +0000 Subject: [PATCH] Add wxDropSource::SetIcon for wxGTK to mimic SetCursor on the other ports. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71349 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk/dnd.h | 11 +++++++++++ interface/wx/dnd.h | 16 +++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/include/wx/gtk/dnd.h b/include/wx/gtk/dnd.h index 66a1c3a757..c9f677d3c7 100644 --- a/include/wx/gtk/dnd.h +++ b/include/wx/gtk/dnd.h @@ -81,6 +81,17 @@ public: virtual ~wxDropSource(); + // set the icon corresponding to given drag result + void SetIcon(wxDragResult res, const wxIcon& icon) + { + if ( res == wxDragCopy ) + m_iconCopy = icon; + else if ( res == wxDragMove ) + m_iconMove = icon; + else + m_iconNone = icon; + } + // start drag action virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly); diff --git a/interface/wx/dnd.h b/interface/wx/dnd.h index 278aa057d3..719ab99433 100644 --- a/interface/wx/dnd.h +++ b/interface/wx/dnd.h @@ -310,10 +310,24 @@ public: @param res The drag result to set the icon for. @param cursor - The ion to show when this drag result occurs. + The icon to show when this drag result occurs. + + @onlyfor{wxmsw,wxosx} */ void SetCursor(wxDragResult res, const wxCursor& cursor); + /** + Set the icon to use for a certain drag result. + + @param res + The drag result to set the icon for. + @param icon + The icon to show when this drag result occurs. + + @onlyfor{wxgtk} + */ + void SetIcon(wxDragResult res, const wxIcon& icon); + /** Sets the data wxDataObject associated with the drop source. This will not delete any previously associated data. -- 2.45.2