# Perform an internal and external drag and drop

**URL:** <https://forum.juce.com/t/perform-an-internal-and-external-drag-and-drop/8635>\
**Category:** General JUCE discussion\
**Created:** [May 4, 2012, 10:20am UTC](https://forum.juce.com/t/perform-an-internal-and-external-drag-and-drop/8635 "2012-05-04T10:20:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nugen](https://avatars.discourse-cdn.com/v4/letter/n/dec6dc/32.png) [@nugen](https://forum.juce.com/u/nugen)\
**Post date:** [May 4, 2012, 10:20am UTC](https://forum.juce.com/t/perform-an-internal-and-external-drag-and-drop/8635/1 "2012-05-04T10:20:52Z")

</div>

Hi,

I’ve a class component that need to be draggable internally to enable drop on another component of the same type - for copying the business date for one object to another.  
I need also to be able to export it as a file, so i also need to be able to perform an external drag&drop.

I’ve found a solution but there’s a little issue. Peharps there’s something i missed.  
Here’s what i’ve done:

In my class component i’ve implemented DragAndDropTarget, and mouseDrag with a call to myContainer-\>startDragging in order to be able to do an internal drag.  
This works fine. Then in the same mouseDrag method, just after calling startDragging method, i make a call to DragAndDropContainer::performExternalDragDropOfFiles.  
This works fine too, when i drag the component, i’m able to export it as a file on the desktop and onto another component of the same class.

But there’s an issue when drag&dropping internally: During drop, when i release the mouse button on the destination component, the itemDropped function isn’t called if the mouse stay at the same point i dropped the item. if i move the mouse the itemDropped function is called. So it sounds that the system needs a mouseMove to trigger the itemDropped method in that case.

If i comment the call to DragAndDropContainer::performExternalDragDropOfFiles, the problem disappears.

Any idea?

Thanks!
