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

Viewport positioning fix. Changed parameters of Viewport::visibleAreaChanged(). Small plugin header fix.

This commit is contained in:
Julian Storer 2011-01-10 12:33:38 +00:00
parent 5d30aecaf2
commit efd1e4c88a
10 changed files with 119 additions and 121 deletions

View file

@ -484,6 +484,32 @@ void ComponentPeer::handleFileDragExit (const StringArray& files)
lastDragAndDropCompUnderMouse = 0;
}
// We'll use an async message to deliver the drop, because if the target decides
// to run a modal loop, it can gum-up the operating system..
class AsyncFileDropMessage : public CallbackMessage
{
public:
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)
dropTarget->filesDropped (files, position.getX(), position.getY());
}
private:
WeakReference<Component> target;
FileDragAndDropTarget* const dropTarget;
const Point<int> position;
const StringArray files;
JUCE_DECLARE_NON_COPYABLE (AsyncFileDropMessage);
};
void ComponentPeer::handleFileDragDrop (const StringArray& files, const Point<int>& position)
{
handleFileDragMove (files, position);
@ -508,32 +534,6 @@ void ComponentPeer::handleFileDragDrop (const StringArray& files, const Point<in
return;
}
// We'll use an async message to deliver the drop, because if the target decides
// to run a modal loop, it can gum-up the operating system..
class AsyncFileDropMessage : public CallbackMessage
{
public:
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)
dropTarget->filesDropped (files, position.getX(), position.getY());
}
private:
WeakReference<Component> target;
FileDragAndDropTarget* dropTarget;
Point<int> position;
StringArray files;
// (NB: don't make this non-copyable, which messes up in VC)
};
(new AsyncFileDropMessage (targetComp, target, targetComp->getLocalPoint (component, position), files))->post();
}
}