Members - Reputation: 2029
Posted 16 June 2012 - 03:44 PM
I'm STUCK! I've been working on a docking system for use with Win32 applications, very much inspired by that used in Visual Studio. Such a system should be very useful for editor-type applications which is exactly what I'm going to be using it for. I've made good progress - have a look at this video here if you will:
I'm quite comfortable working with the Win32 GUI API, so I'm not really stuck on something technical, but rather on the design of the thing. Currently a tree structure keeps track of the windows' layout. What I'm stuck on is implementing the behavior of restoring a window to its previous position after it has been hidden or otherwise removed from the layout tree. This is the same issue of implementing the behavior of restoring the layout from file at startup or applying a certain layout in certain application operation modes and then restoring a previous layout.
For example, at 0:29 in the video, we have a floating "pane" which has two windows docked inside it. Once one of these windows is undocked, the pane is left with just one window docked inside it, making it a redundant pane, so the remaining window is undocked and the empty pane is removed. In VS, if the user hides one of these two windows, and then shows it again through the View window, the window is put back where it was and a pane is created again. So I guess my question is what would be the best way to represent the placement of a window, and how to use that representation when removing and restoring windows into the layout tree? Or maybe I'm thinking about this whole thing in the wrong way. Any thoughts are welcome.
If anybody has any experience with such a system in a different language or environment, I'd appreciate it if they would shed some light on how it's done there.