1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

ListBox: Allow ListBoxModel to control whether items may be dragged to other windows

This commit is contained in:
reuk 2023-02-16 20:04:56 +00:00
parent 882c2aa01d
commit 629a3ca14b
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C
2 changed files with 6 additions and 1 deletions

View file

@ -168,7 +168,7 @@ public:
if (! (dragDescription.isVoid() || (dragDescription.isString() && dragDescription.toString().isEmpty())))
{
isDragging = true;
owner.startDragAndDrop (e, rowsToDrag, dragDescription, true);
owner.startDragAndDrop (e, rowsToDrag, dragDescription, m->mayDragToExternalWindows());
}
}
}

View file

@ -156,6 +156,11 @@ public:
*/
virtual var getDragSourceDescription (const SparseSet<int>& rowsToDescribe);
/** Called when starting a drag operation on a list row to determine whether the item may be
dragged to other windows. Returns true by default.
*/
virtual bool mayDragToExternalWindows() const { return true; }
/** You can override this to provide tool tips for specific rows.
@see TooltipClient
*/