X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/95710acb005a897ee75844bb202f03a8fff15db7..f8d0234d39c66f3d1d7fc2346562cb96c8c7be20:/src/osx/carbon/dnd.cpp diff --git a/src/osx/carbon/dnd.cpp b/src/osx/carbon/dnd.cpp index 172b99a437..bc0f7e5485 100644 --- a/src/osx/carbon/dnd.cpp +++ b/src/osx/carbon/dnd.cpp @@ -57,6 +57,12 @@ wxDragResult wxDropTarget::OnDragOver( return CurrentDragHasSupportedFormat() ? def : wxDragNone; } +wxDataFormat wxDropTarget::GetMatchingPair() +{ + wxFAIL_MSG("wxDropTarget::GetMatchingPair() not implemented in src/osx/carbon/dnd.cpp"); + return wxDF_INVALID; +} + bool wxDropTarget::OnDrop( wxCoord WXUNUSED(x), wxCoord WXUNUSED(y) ) { if (m_dataObject == NULL) @@ -107,17 +113,10 @@ bool wxDropTarget::CurrentDragHasSupportedFormat() } } -#if wxOSX_USE_CARBON if ( !supported ) { - PasteboardRef pasteboard; - - if ( GetDragPasteboard( (DragReference)m_currentDrag, &pasteboard ) == noErr ) - { - supported = m_dataObject->HasDataInPasteboard( pasteboard ); - } + supported = m_dataObject->HasDataInPasteboard( m_currentDragPasteboard ); } -#endif return supported; } @@ -166,17 +165,10 @@ bool wxDropTarget::GetData() } } -#if wxOSX_USE_CARBON if ( !transferred ) { - PasteboardRef pasteboard; - - if ( GetDragPasteboard( (DragReference)m_currentDrag, &pasteboard ) == noErr ) - { - transferred = m_dataObject->GetFromPasteboard( pasteboard ); - } + transferred = m_dataObject->GetFromPasteboard( m_currentDragPasteboard ); } -#endif return transferred; } @@ -369,7 +361,8 @@ pascal OSErr wxMacWindowDragTrackingHandler( DragAttributes attributes; GetDragAttributes( theDrag, &attributes ); - + PasteboardRef pasteboard = 0; + GetDragPasteboard( theDrag, &pasteboard ); wxNonOwnedWindow* toplevel = wxNonOwnedWindow::GetFromWXWindow( (WXWindow) theWindow ); bool optionDown = GetCurrentKeyModifiers() & optionKey; @@ -427,7 +420,7 @@ pascal OSErr wxMacWindowDragTrackingHandler( #ifndef __LP64__ HideDragHilite( theDrag ); #endif - trackingGlobals->m_currentTarget->SetCurrentDrag( theDrag ); + trackingGlobals->m_currentTarget->SetCurrentDragPasteboard( pasteboard ); trackingGlobals->m_currentTarget->OnLeave(); trackingGlobals->m_currentTarget = NULL; trackingGlobals->m_currentTargetWindow = NULL; @@ -442,7 +435,7 @@ pascal OSErr wxMacWindowDragTrackingHandler( { if ( trackingGlobals->m_currentTarget ) { - trackingGlobals->m_currentTarget->SetCurrentDrag( theDrag ); + trackingGlobals->m_currentTarget->SetCurrentDragPasteboard( pasteboard ); result = trackingGlobals->m_currentTarget->OnEnter( localx, localy, result ); } @@ -467,7 +460,7 @@ pascal OSErr wxMacWindowDragTrackingHandler( { if ( trackingGlobals->m_currentTarget ) { - trackingGlobals->m_currentTarget->SetCurrentDrag( theDrag ); + trackingGlobals->m_currentTarget->SetCurrentDragPasteboard( pasteboard ); result = trackingGlobals->m_currentTarget->OnDragOver( localx, localy, result ); } } @@ -517,7 +510,7 @@ pascal OSErr wxMacWindowDragTrackingHandler( if (trackingGlobals->m_currentTarget) { - trackingGlobals->m_currentTarget->SetCurrentDrag( theDrag ); + trackingGlobals->m_currentTarget->SetCurrentDragPasteboard( pasteboard ); trackingGlobals->m_currentTarget->OnLeave(); #ifndef __LP64__ HideDragHilite( theDrag ); @@ -545,7 +538,9 @@ pascal OSErr wxMacWindowDragReceiveHandler( Point mouse, localMouse; int localx, localy; - trackingGlobals->m_currentTarget->SetCurrentDrag( theDrag ); + PasteboardRef pasteboard = 0; + GetDragPasteboard( theDrag, &pasteboard ); + trackingGlobals->m_currentTarget->SetCurrentDragPasteboard( pasteboard ); GetDragMouse( theDrag, &mouse, 0L ); localMouse = mouse; localx = localMouse.h;