|
|
@@ -34,14 +34,13 @@ public: |
|
|
DragImageComponent (const Image& im,
|
|
|
DragImageComponent (const Image& im,
|
|
|
const var& desc,
|
|
|
const var& desc,
|
|
|
Component* const sourceComponent,
|
|
|
Component* const sourceComponent,
|
|
|
Component* const mouseDragSource_,
|
|
|
|
|
|
DragAndDropContainer& owner_,
|
|
|
|
|
|
Point<int> imageOffset_)
|
|
|
|
|
|
|
|
|
Component* const mouseSource,
|
|
|
|
|
|
DragAndDropContainer& ddc,
|
|
|
|
|
|
Point<int> offset)
|
|
|
: sourceDetails (desc, sourceComponent, Point<int>()),
|
|
|
: sourceDetails (desc, sourceComponent, Point<int>()),
|
|
|
image (im),
|
|
|
|
|
|
owner (owner_),
|
|
|
|
|
|
mouseDragSource (mouseDragSource_),
|
|
|
|
|
|
imageOffset (imageOffset_),
|
|
|
|
|
|
|
|
|
image (im), owner (ddc),
|
|
|
|
|
|
mouseDragSource (mouseSource),
|
|
|
|
|
|
imageOffset (offset),
|
|
|
hasCheckedForExternalDrag (false)
|
|
|
hasCheckedForExternalDrag (false)
|
|
|
{
|
|
|
{
|
|
|
setSize (im.getWidth(), im.getHeight());
|
|
|
setSize (im.getWidth(), im.getHeight());
|
|
|
@@ -189,8 +188,9 @@ public: |
|
|
return targetComponent == mouseDragSource;
|
|
|
return targetComponent == mouseDragSource;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
DragAndDropTarget::SourceDetails sourceDetails;
|
|
|
DragAndDropTarget::SourceDetails sourceDetails;
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
Image image;
|
|
|
Image image;
|
|
|
DragAndDropContainer& owner;
|
|
|
DragAndDropContainer& owner;
|
|
|
WeakReference<Component> mouseDragSource, currentlyOverComp;
|
|
|
WeakReference<Component> mouseDragSource, currentlyOverComp;
|
|
|
@@ -391,8 +391,6 @@ void DragAndDropContainer::startDragging (const var& sourceDescription, |
|
|
dragImageComponent = new DragImageComponent (dragImage, sourceDescription, sourceComponent,
|
|
|
dragImageComponent = new DragImageComponent (dragImage, sourceDescription, sourceComponent,
|
|
|
draggingSource->getComponentUnderMouse(), *this, imageOffset);
|
|
|
draggingSource->getComponentUnderMouse(), *this, imageOffset);
|
|
|
|
|
|
|
|
|
currentDragDesc = sourceDescription;
|
|
|
|
|
|
|
|
|
|
|
|
if (allowDraggingToExternalWindows)
|
|
|
if (allowDraggingToExternalWindows)
|
|
|
{
|
|
|
{
|
|
|
if (! Desktop::canUseSemiTransparentWindows())
|
|
|
if (! Desktop::canUseSemiTransparentWindows())
|
|
|
@@ -435,7 +433,7 @@ bool DragAndDropContainer::isDragAndDropActive() const |
|
|
|
|
|
|
|
|
var DragAndDropContainer::getCurrentDragDescription() const
|
|
|
var DragAndDropContainer::getCurrentDragDescription() const
|
|
|
{
|
|
|
{
|
|
|
return dragImageComponent != nullptr ? currentDragDesc
|
|
|
|
|
|
|
|
|
return dragImageComponent != nullptr ? dragImageComponent->sourceDetails.description
|
|
|
: var();
|
|
|
: var();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|