The thing is there’s a lot of different ways you can layout all these objects and then save/load the state. Are you docking to child Components, buttons, tabs etc. What does docking to a tab actually mean? (In Tracktion we have a custom TabButtonBar than controls the Component below it i.e. there’s no generic TabbedComponent) There’s also a lot of things to represent (more below). Believe me, it’s harder than it looks.
The general tab dragging/dropping isn’t too hard, it does use the juce::DragAndDropContainer but there’s a hell of a lot of stuff in between. You need to ensure the original Component stays alive to send the drag events (and this could be represented by no change, going invisible or disappearing completely), then you need a new window to represent the thing you’re dragging (in our case the tab button), then any attached Components (e.g. the Edit window that floats around with it).
Once you’ve got the Components semi-off the original one you need to detect this drag and act accordingly. For simplicity we show a red area when a tabbed would be docked on to a new TabButtonBar but in Tracktion you can also drag an Edit tab on to a Track to create an Edit Clip.
Once a source has been dropped you not only need to react to that but also clean up the original source e.g. by removing the corresponding tab. There’s also the case where no docking happens and you have to put all this stuff back where it came from.
You also need appropriately structured code to be able to do this at all. For example, you can’t have back pointers to windows in your tabs or Components you’ve moving. You also have to make sure any non-UI objects aren’t part of the window or these will dangle too.
I’m not saying it isn’t possible to do this in a generic way, it almost certainly is, just that there’s tons of gotchas and custom behaviour to build in to it. You may well end up with something that’s so confusing to customise it would be better to write a more concise, custom solution. I’m sure lambda’s would help with this nowadays though, I had to do it without them a few years ago.
If you do manage to get something up and running I’d be very interested in it though…