Home » Developing U++ » UppHub » Docking: How to dock to the entire portion of what remains?
Docking: How to dock to the entire portion of what remains? [message #26504] |
Thu, 06 May 2010 21:17 |
ktj9
Messages: 17 Registered: April 2010
|
Promising Member |
|
|
Hello,
Docking has Left,Top,Right,Bottom. So I can always see blank portion that is not occupied, unless I drag a dockable. I am wondering how to specify so the last Dockable that I add will take all the space that remains. I guess I need to use Dock(int alingn,DockableCtrl& dc). But I don't quite understand the meaning and purpose of arguments; and cannot get what I want after playing some experiments.
Thanks!
|
|
|
|
Re: Docking: How to dock to the entire portion of what remains? [message #26774 is a reply to message #26628] |
Wed, 26 May 2010 19:40 |
ktj9
Messages: 17 Registered: April 2010
|
Promising Member |
|
|
Thanks you for your respond. Actually after playing Docking for a while, it is the approach of defining LEFT,RIGHT,TOP,BOTTOM that confuses me. As you have mentioned Visual Studio, I think VS' approach is more intuitive, or maybe it is just because I have got too much used to it. The definition in VS that I can see is to define docking, splitting vertically, and splitting horizontally. By defining L,R,T,B, there is always some moment confusing, e.g. " if I put it to the right, how the class will handling its top regarding existing widget ", which leaves me to look into codes. And if the behavior is not what I expect, I probably can nothing about it.
Thanks!
|
|
|
Re: Docking: How to dock to the entire portion of what remains? [message #26814 is a reply to message #26774] |
Mon, 31 May 2010 01:46 |
mrjt
Messages: 705 Registered: March 2007 Location: London
|
Contributor |
|
|
Well, the idea with docking is that you shouldn't have to be worrying about such things, it is up to the user. That is kind of the whole point. If you don't want this flexibility there are simpler ways of doing things without Docking.
And with serialization you don't even have to make the initial/default layout with code, you can set it up in the app and save it.
However, if you care about such things it is supportted. The sizing of widgets is determined by their size hints (min, std, max) and the order in which they are docked can be controlled in two ways:
1- Add the widgets in order (left to right, top to bottom)
2- Use the Dock function that has the position/pos parameter (I don't have code access right now, but it's something like DockWindow::Dock(int align, int pos). Then you can dock them in any order you like.
Other things are taking up my time at the moment so big changes are unlikely but I'm open to suggestions for improvements. Incidentally I added comments to DockWindow.h in my last update to make things a bit clearer (I hope ) so you may want to update from the SVN if you haven't already.
James
|
|
|
|
Goto Forum:
Current Time: Sat Sep 21 06:14:57 CEST 2024
Total time taken to generate the page: 0.04976 seconds
|