1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-01 03:10:06 +00:00

Small fixes to drag-and-drop, leak detector.

This commit is contained in:
Julian Storer 2010-12-01 12:45:13 +00:00
parent fc04109434
commit a768d7410f
8 changed files with 87 additions and 69 deletions

View file

@ -512,26 +512,28 @@ void ComponentPeer::handleFileDragDrop (const StringArray& files, const Point<in
class AsyncFileDropMessage : public CallbackMessage
{
public:
AsyncFileDropMessage (Component* target_, const Point<int>& position_, const StringArray& files_)
: target (target_), position (position_), files (files_)
AsyncFileDropMessage (Component* target_, FileDragAndDropTarget* dropTarget_,
const Point<int>& position_, const StringArray& files_)
: target (target_), dropTarget (dropTarget_), position (position_), files (files_)
{
}
void messageCallback()
{
if (target != 0)
target->filesDropped (files, position.getX(), position.getY());
dropTarget->filesDropped (files, position.getX(), position.getY());
}
private:
Component::SafePointer<Component> target;
FileDragAndDropTarget* dropTarget;
Point<int> position;
StringArray files;
// (NB: don't make this non-copyable, which messes up in VC)
};
(new AsyncFileDropMessage (targetComp, targetComp->getLocalPoint (component, position), files))->post();
(new AsyncFileDropMessage (targetComp, target, targetComp->getLocalPoint (component, position), files))->post();
}
}
}