Add wxDataViewEvent::InitData() helper

Reuse it from both the generic and macOS versions to avoid doing the
same thing in both of them.
This commit is contained in:
Vadim Zeitlin
2021-12-10 20:11:33 +01:00
parent 31bdfd6523
commit 7797ffc730
4 changed files with 22 additions and 7 deletions

View File

@@ -2391,9 +2391,7 @@ wxDragResult wxDataViewMainWindow::OnData(wxDataFormat format, wxCoord x, wxCoor
wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_DROP, m_owner, dropItemInfo.m_item);
event.SetProposedDropIndex(dropItemInfo.m_proposedDropIndex);
event.SetDataFormat( format );
event.SetDataSize(obj->GetDataSize(format));
event.SetDataObject(obj->GetObject(format));
event.InitData(obj, format);
event.SetDropEffect( def );
if ( !m_owner->HandleWindowEvent( event ) || !event.IsAllowed() )
return wxDragNone;