]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/dnd.cpp
move wxGridCellRenderer::Draw before other derived classes implementations (no real...
[wxWidgets.git] / src / osx / carbon / dnd.cpp
index 172b99a437fdab905440699a868a5d02db4a7cd5..bc0f7e5485c6e1f408af1d0f6542a6cc2a565b34 100644 (file)
@@ -57,6 +57,12 @@ wxDragResult wxDropTarget::OnDragOver(
     return CurrentDragHasSupportedFormat() ? def : wxDragNone;
 }
 
     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)
 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 )
     {
     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;
 }
 
     return supported;
 }
@@ -166,17 +165,10 @@ bool wxDropTarget::GetData()
         }
     }
 
         }
     }
 
-#if wxOSX_USE_CARBON
     if ( !transferred )
     {
     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;
 }
 
     return transferred;
 }
@@ -369,7 +361,8 @@ pascal OSErr wxMacWindowDragTrackingHandler(
     DragAttributes attributes;
 
     GetDragAttributes( theDrag, &attributes );
     DragAttributes attributes;
 
     GetDragAttributes( theDrag, &attributes );
-
+    PasteboardRef   pasteboard = 0;
+    GetDragPasteboard( theDrag, &pasteboard );
     wxNonOwnedWindow* toplevel = wxNonOwnedWindow::GetFromWXWindow( (WXWindow) theWindow );
 
     bool optionDown = GetCurrentKeyModifiers() & optionKey;
     wxNonOwnedWindow* toplevel = wxNonOwnedWindow::GetFromWXWindow( (WXWindow) theWindow );
 
     bool optionDown = GetCurrentKeyModifiers() & optionKey;
@@ -427,7 +420,7 @@ pascal OSErr wxMacWindowDragTrackingHandler(
 #ifndef __LP64__
                             HideDragHilite( theDrag );
 #endif
 #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;
                             trackingGlobals->m_currentTarget->OnLeave();
                             trackingGlobals->m_currentTarget = NULL;
                             trackingGlobals->m_currentTargetWindow = NULL;
@@ -442,7 +435,7 @@ pascal OSErr wxMacWindowDragTrackingHandler(
                         {
                             if ( trackingGlobals->m_currentTarget )
                             {
                         {
                             if ( trackingGlobals->m_currentTarget )
                             {
-                                trackingGlobals->m_currentTarget->SetCurrentDrag( theDrag );
+                                trackingGlobals->m_currentTarget->SetCurrentDragPasteboard( pasteboard );
                                 result = trackingGlobals->m_currentTarget->OnEnter( localx, localy, result );
                             }
 
                                 result = trackingGlobals->m_currentTarget->OnEnter( localx, localy, result );
                             }
 
@@ -467,7 +460,7 @@ pascal OSErr wxMacWindowDragTrackingHandler(
                 {
                     if ( trackingGlobals->m_currentTarget )
                     {
                 {
                     if ( trackingGlobals->m_currentTarget )
                     {
-                        trackingGlobals->m_currentTarget->SetCurrentDrag( theDrag );
+                        trackingGlobals->m_currentTarget->SetCurrentDragPasteboard( pasteboard );
                         result = trackingGlobals->m_currentTarget->OnDragOver( localx, localy, result );
                     }
                 }
                         result = trackingGlobals->m_currentTarget->OnDragOver( localx, localy, result );
                     }
                 }
@@ -517,7 +510,7 @@ pascal OSErr wxMacWindowDragTrackingHandler(
 
             if (trackingGlobals->m_currentTarget)
             {
 
             if (trackingGlobals->m_currentTarget)
             {
-                trackingGlobals->m_currentTarget->SetCurrentDrag( theDrag );
+                trackingGlobals->m_currentTarget->SetCurrentDragPasteboard( pasteboard );
                 trackingGlobals->m_currentTarget->OnLeave();
 #ifndef __LP64__
                 HideDragHilite( theDrag );
                 trackingGlobals->m_currentTarget->OnLeave();
 #ifndef __LP64__
                 HideDragHilite( theDrag );
@@ -545,7 +538,9 @@ pascal OSErr wxMacWindowDragReceiveHandler(
         Point mouse, localMouse;
         int localx, localy;
 
         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;
         GetDragMouse( theDrag, &mouse, 0L );
         localMouse = mouse;
         localx = localMouse.h;