Code covered by the BSD License  

Highlights from
GridBagLayout

5.0

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

GridBagLayout

by Jason

 

13 Feb 2009 (Updated 16 Dec 2009)

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 submission has inspired the following:
UISIGNALBUILDER, GridLayout
MATLAB release MATLAB 7.7 (R2008b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (6)
09 Mar 2009 Yair Altman

Magnificent 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 :-)

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!

27 Aug 2009 Ashish Sadanandan  
30 Dec 2009 Ryan Ollos

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

29 Dec 2010 Dirk Engel  
Please login to add a comment or rating.
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.

Tag Activity for this File
Tag Applied By Date/Time
gui Jason 13 Feb 2009 14:13:00
layout Jason 13 Feb 2009 14:13:00
gridbag Jason 13 Feb 2009 14:13:00
gridbaglayout Jason 13 Feb 2009 14:13:00
resize Jason 13 Feb 2009 14:13:00
graphical user interface Jason 13 Feb 2009 14:13:00
grid bag Jason 13 Feb 2009 14:18:58
potw Shari Freedman 20 Apr 2009 12:39:26
position Ryan Ollos 02 Oct 2009 20:44:47
potw Jason 16 Dec 2009 08:30:51
position Jason 16 Dec 2009 08:30:54
layout manager Dirk Engel 29 Dec 2010 13:27:07
pick of the week Jiro Doke 11 Feb 2011 20:08:23

Contact us at files@mathworks.com