Code covered by the BSD License  

Highlights from
GridBagLayout

5.0

5.0 | 6 ratings Rate this file 24 Downloads (last 30 days) File Size: 61.8 KB File ID: #22968

GridBagLayout

by

 

13 Feb 2009 (Updated )

A MATLAB class which controls layout and resize of a figure/uipanel/uicontainer.

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

| Watch this File

File Information
Description

layout.GridBagLayout is a MATLAB class which controls layout and resize of a figure/uipanel/uicontainer. This class helps the MATLAB GUI developer design complex Graphical User Interfaces without the need for calculations or complex code for performing initial layouts or writing resize functions.

To get this to work in 2007b/2008a you can simply replace the calls to ishghandle(h, 'figure') with strcmp(get(h, 'type'), 'figure').

Acknowledgements

This file inspired Ui Signal Builder2, Uisignalbuilder, and Grid Layout.

MATLAB release MATLAB 7.7 (R2008b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (6)
29 Dec 2010 Dirk Engel  
30 Dec 2009 Ryan Ollos

Author has done a great job of responding to suggestions and making improvements and minor bug fixes.

27 Aug 2009 Ashish Sadanandan  
28 Apr 2009 Ryan Ollos

This code makes up for a major shortcoming of MATLAB, and has helped me write GUIs more quickly and more cleanly. Thank you for sharing this great piece of work!

16 Apr 2009 Laurent Vaylet

WOW!! We finally get these nice Java layout features in MATLAB. Congratulations, it is a really useful, documented and illustrated piece of code. If a 6-star rating existed, you would surely get it :-)

09 Mar 2009 Yair Altman

Magnificent piece of work!

Updates
13 Feb 2009

Removed log files that were not relevant or useful.

24 Mar 2009

Update layout method to better handle Axes using the 'OuterPosition' property so that Insets are not always necessary. This will use MATLAB's built-in axes spacing management.

Recapture HTML.

28 Apr 2009

Fix typos and Axes positioning.

29 Apr 2009

Make Axes positioning dependent on the ActivePositionProperty. Thanks for the catch Ryan.

09 Oct 2009

Fix a bug with the use of UIPanel. Take into account the BorderWidth property when calculating the number of pixels available for the layout.

16 Dec 2009

Handle the user-defined Max < default Min case by not allowing the Minimum values to ever be greater than the corresponding Maximum values.

Contact us