I want to implement drag’n’drop functionality in TreeView that allows fully re-arranging the TreeViewItems.
I’ve gotten the re-parenting working with the existing drag’n’drop functionality: You drag a TreeViewItem on top of an other, and the dragged item becomes the drop targets child in the tree.
The reordering of TreeViewItems I haven’t managed to figure out however! I expect there should be some functionality for highlighting the area between two TreeViewItems when one hovers over it during a drag’n’drop operation, during which moment dropping would mean inserting the dragged item between the items above and below the highlight, instead of making it the child of either.
I’ve been perusing the TreeView source to find some functionality that allows such functionality, but I’m none the wiser…
I’ve found this thing in the source called ‘dragInsertPointHighlight’, but I’m not sure if it is what I’m looking for, and it is not documented anywhere.
Any ideas? Perhaps an example of some JUCE code doing this or similar?