|
|
|
@@ -43,7 +43,7 @@ public: |
|
|
|
imageOffset (offset),
|
|
|
|
hasCheckedForExternalDrag (false)
|
|
|
|
{
|
|
|
|
setSize (im.getWidth(), im.getHeight());
|
|
|
|
updateSize();
|
|
|
|
|
|
|
|
if (mouseDragSource == nullptr)
|
|
|
|
mouseDragSource = sourceComponent;
|
|
|
|
@@ -160,6 +160,13 @@ public: |
|
|
|
forceMouseCursorUpdate();
|
|
|
|
}
|
|
|
|
|
|
|
|
void updateImage (const Image& newImage)
|
|
|
|
{
|
|
|
|
image = newImage;
|
|
|
|
updateSize();
|
|
|
|
repaint();
|
|
|
|
}
|
|
|
|
|
|
|
|
void timerCallback() override
|
|
|
|
{
|
|
|
|
forceMouseCursorUpdate();
|
|
|
|
@@ -207,6 +214,11 @@ private: |
|
|
|
bool hasCheckedForExternalDrag;
|
|
|
|
Time lastTimeOverTarget;
|
|
|
|
|
|
|
|
void updateSize()
|
|
|
|
{
|
|
|
|
setSize (image.getWidth(), image.getHeight());
|
|
|
|
}
|
|
|
|
|
|
|
|
void forceMouseCursorUpdate()
|
|
|
|
{
|
|
|
|
Desktop::getInstance().getMainMouseSource().forceMouseCursorUpdate();
|
|
|
|
@@ -472,6 +484,12 @@ var DragAndDropContainer::getCurrentDragDescription() const |
|
|
|
: var();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DragAndDropContainer::setCurrentDragImage (const Image& newImage)
|
|
|
|
{
|
|
|
|
if (dragImageComponent != nullptr)
|
|
|
|
dragImageComponent->updateImage (newImage);
|
|
|
|
}
|
|
|
|
|
|
|
|
DragAndDropContainer* DragAndDropContainer::findParentDragContainerFor (Component* c)
|
|
|
|
{
|
|
|
|
return c != nullptr ? c->findParentComponentOfClass<DragAndDropContainer>() : nullptr;
|
|
|
|
|