Rank: 9719 based on 0 downloads (last 30 days) and 0 file submitted
photo

David Sampson

E-mail
Company/University
MathWorks
Lat/Long
52.22888946533203, 0.151883006095886

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Comments and Ratings by David View all
Updated File Comments Rating
10 Jun 2013 GUI Layout Toolbox Layout management objects for MATLAB GUIs Author: Ben Tordoff

We will release support for HG2 in due course.

09 Dec 2010 GUI Layout Toolbox Layout management objects for MATLAB GUIs Author: Ben Tordoff

In response to the question about custom resize behavior, subclass our relevant class and implement your own resize method.

12 Aug 2010 GUI Layout Toolbox Layout management objects for MATLAB GUIs Author: Ben Tordoff

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.

11 Aug 2010 GUI Layout Toolbox Layout management objects for MATLAB GUIs Author: Ben Tordoff

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.

09 Aug 2010 GUI Layout Toolbox Layout management objects for MATLAB GUIs Author: Ben Tordoff

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];

Contact us