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:
parent
fc04109434
commit
a768d7410f
8 changed files with 87 additions and 69 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue