From 51c9c13c05b3aa6e713b7bcfcc027e7ece75541c Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Wed, 21 Jan 2009 14:01:31 +0000 Subject: [PATCH] Add wxDataFormat GetMatchingPair() which wxGTK and wxMSW already had under different names git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58260 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk/dnd.h | 4 +++- include/wx/msw/ole/droptgt.h | 3 +++ src/gtk/dnd.cpp | 6 ++++++ src/msw/ole/droptgt.cpp | 5 +++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/include/wx/gtk/dnd.h b/include/wx/gtk/dnd.h index c29ded049e..08a12ec5ea 100644 --- a/include/wx/gtk/dnd.h +++ b/include/wx/gtk/dnd.h @@ -36,9 +36,11 @@ public: virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def); virtual bool GetData(); + // Can only be called during OnXXX methods. + wxDataFormat GetMatchingPair(); // implementation - + GdkAtom GtkGetMatchingPair(); void GtkRegisterWidget( GtkWidget *widget ); diff --git a/include/wx/msw/ole/droptgt.h b/include/wx/msw/ole/droptgt.h index aff3f84cc0..909a90dc41 100644 --- a/include/wx/msw/ole/droptgt.h +++ b/include/wx/msw/ole/droptgt.h @@ -47,6 +47,9 @@ public: virtual bool OnDrop(wxCoord x, wxCoord y); virtual bool GetData(); + // Can only be called during OnXXX methods. + wxDataFormat GetMatchingPair(); + // implementation only from now on // ------------------------------- diff --git a/src/gtk/dnd.cpp b/src/gtk/dnd.cpp index 45ab7ced5a..dd9fe2745c 100644 --- a/src/gtk/dnd.cpp +++ b/src/gtk/dnd.cpp @@ -497,6 +497,12 @@ wxDragResult wxDropTarget::OnData( wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), return GetData() ? def : wxDragNone; } + +wxDataFormat wxDropTarget::GetMatchingPair() +{ + return wxDataFormat( GtkGetMatchingPair() ); +} + GdkAtom wxDropTarget::GtkGetMatchingPair() { if (!m_dataObject) diff --git a/src/msw/ole/droptgt.cpp b/src/msw/ole/droptgt.cpp index 3ca2761733..ba1fccc45f 100644 --- a/src/msw/ole/droptgt.cpp +++ b/src/msw/ole/droptgt.cpp @@ -489,6 +489,11 @@ bool wxDropTarget::IsAcceptedData(IDataObject *pIDataSource) const // helper functions // ---------------------------------------------------------------------------- +wxDataFormat wxDropTarget::GetMatchingPair() +{ + return GetSupportedFormat( m_pIDataSource ); +} + wxDataFormat wxDropTarget::GetSupportedFormat(IDataObject *pIDataSource) const { // this strucutre describes a data of any type (first field will be -- 2.45.2