FileTreeComponent drag'n'drop


#1

Since the FileTreeComponent is meant for showing & using files, would it not perhaps be better to implement drag’n’drop into it, something like adding this to line 96 of the juce_FileTreeComponent.cpp file :

virtual const String getDragSourceDescription() {return getUniqueName();}

This function could perhaps check a boolean flag in the FileTreeComponent if it should allow drag’n’drop and if not, return an empty String as usual.

Perhaps is there any reason for not doing this?


#2

I don’t think that’s quite what you’d want it to send, as the name is supposed to be used to recognise the purpose of the object that’s doing the dragging rather than a description of the item itself. What I’ve done now is to add a setDragAndDropDescription() method to the tree so you can set a description for the whole tree.


#3

That’s just perfect. Thanks.


#4