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