bool ArgumentCoder<DragData>::decode(ArgumentDecoder* decoder, DragData& dragData) { IntPoint clientPosition; if (!decoder->decode(clientPosition)) return false; IntPoint globalPosition; if (!decoder->decode(globalPosition)) return false; uint64_t sourceOperationMask; if (!decoder->decode(sourceOperationMask)) return false; uint64_t flags; if (!decoder->decode(flags)) return false; bool hasPlatformData; if (!decoder->decode(hasPlatformData)) return false; RefPtr<DataObjectGtk> platformData; if (hasPlatformData) { if (!decodeDataObject(decoder, platformData)) return false; } dragData = DragData(platformData.release().leakRef(), clientPosition, globalPosition, static_cast<DragOperation>(sourceOperationMask), static_cast<DragApplicationFlags>(flags)); return true; }
void wxGISToolExecuteView::OnBeginDrag(wxListEvent& event) { wxGxObject* pGxObject = m_pCatalog->GetRegisterObject(m_nParentGxObjectId); if(!pGxObject) return; wxGISTaskDataObject DragData(wxThread::GetMainId(), wxDataFormat(wxGIS_DND_ID)); long nItem = wxNOT_FOUND; int nCount(0); for ( ;; ) { nItem = GetNextItem(nItem, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if ( nItem == wxNOT_FOUND ) break; DragData.AddDecimal(GetItemData(nItem)); } wxDropSource dragSource( this ); dragSource.SetData( DragData ); wxDragResult result = dragSource.DoDragDrop( wxDrag_DefaultMove ); }