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
This commit is contained in:
Robert Roebling
2009-01-21 14:01:31 +00:00
parent d8efd2198f
commit 51c9c13c05
4 changed files with 17 additions and 1 deletions

View File

@@ -36,9 +36,11 @@ public:
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def); virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def);
virtual bool GetData(); virtual bool GetData();
// Can only be called during OnXXX methods.
wxDataFormat GetMatchingPair();
// implementation // implementation
GdkAtom GtkGetMatchingPair(); GdkAtom GtkGetMatchingPair();
void GtkRegisterWidget( GtkWidget *widget ); void GtkRegisterWidget( GtkWidget *widget );

View File

@@ -47,6 +47,9 @@ public:
virtual bool OnDrop(wxCoord x, wxCoord y); virtual bool OnDrop(wxCoord x, wxCoord y);
virtual bool GetData(); virtual bool GetData();
// Can only be called during OnXXX methods.
wxDataFormat GetMatchingPair();
// implementation only from now on // implementation only from now on
// ------------------------------- // -------------------------------

View File

@@ -497,6 +497,12 @@ wxDragResult wxDropTarget::OnData( wxCoord WXUNUSED(x), wxCoord WXUNUSED(y),
return GetData() ? def : wxDragNone; return GetData() ? def : wxDragNone;
} }
wxDataFormat wxDropTarget::GetMatchingPair()
{
return wxDataFormat( GtkGetMatchingPair() );
}
GdkAtom wxDropTarget::GtkGetMatchingPair() GdkAtom wxDropTarget::GtkGetMatchingPair()
{ {
if (!m_dataObject) if (!m_dataObject)

View File

@@ -489,6 +489,11 @@ bool wxDropTarget::IsAcceptedData(IDataObject *pIDataSource) const
// helper functions // helper functions
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
wxDataFormat wxDropTarget::GetMatchingPair()
{
return GetSupportedFormat( m_pIDataSource );
}
wxDataFormat wxDropTarget::GetSupportedFormat(IDataObject *pIDataSource) const wxDataFormat wxDropTarget::GetSupportedFormat(IDataObject *pIDataSource) const
{ {
// this strucutre describes a data of any type (first field will be // this strucutre describes a data of any type (first field will be