In response to the question regarding sizes of panel decorations, first let me state the obvious, just in case it isn't obvious. Once a panel with a container inside is on screen, you can call getpixelposition on the panel and the container inside to find the size of the decorations.
The GUI Layout Toolbox takes an outside-in approach in that contents do not influence the size of a container. You give a container some space and it lays out the contents as best it can. If the contents are too big for the container then they just disappear to the top or the right. This is fundamental to how the Toolbox works.
I have been expecting a request to support minimum sizes for contents. Anyone interested in this could extend their container of choice by adding a property and overloading redraw. Care is required to react as children are added and removed; see how we handle 'Sizes' for guidance.
The next question that arises is how to establish the minimum reasonable size for each child. I recommend hard-coding. uicontrols do provide a property 'Extent', but it doesn't return anything useful for combo boxes, and it gives the wrong answer for normalized units, and neither containers nor axes report Extent.
It is possible to enforce limits on figure size by hooking into the figure ResizeFcn. I don't advise trying this below the figure level.
Dani, in response to your posting about vertical alignment of text in a row of controls, I agree that this is an issue. The issue is specific to the HBox.
We need a VerticalAlignment property for the uicontrol.
I think that the place to fix this is by creating a text label widget implemented as a uicontrol inside a uicontainer. The widget exposes a property to control vertical alignment and positions the uicontrol accordingly. I have created such a widget for inclusion in our upcoming GUI Controls Toolbox.
Another possibility is to set the vertical alignment in the underlying Java object, to which Yair Altman's findjobj can provide access.
I do not think that adding a property to provide vertical padding within the HBox is a good solution.
plotyy is another example of MATLAB using two axes at the same level of the HG hierarchy. Again, put the axes inside a container, and position the container.
>> h = uiextras.HBox( 'Padding', 10, 'Spacing', 10 );
>> c = uicontainer( 'Parent', h );
>> v = uiextras.VBox( 'Parent', h, 'Spacing', 10 );
>> for ii = 1:4, uicontrol( 'Parent', v, 'String', 'Press me' ); end
>> a = axes( 'Parent', c );
>> x = 0:0.1:10;
>> plotyy( a, x, sin( x ), x, 10*cos( x ) );
>> h.Sizes = [-1 150];
Is there any way to have the title bar for a panel have more than one line? I have a component that is say 30 wide, but the title I'd like to include needs more space than that and it's getting cut off. Any suggestions? Thanks.
Very slick and easy to work with. It's very well documented so anyone can pick this up in a heartbeat. However, if you have HG2 enabled, this will not work. Any plan in the future of this support?
http://undocumentedmatlab.com/blog/hg2-update/
Comment only