File Exchange

image thumbnail

GridBagLayout

version 2.0 (75 KB) by

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

7 Downloads

Updated

View License

Editor's Note: This file was selected as MATLAB Central Pick of the Week

layout.GridBagLayout and layout.ScrollableGridBagLayout are MATLAB classes which control 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').

Comments and Ratings (7)

Just fantastic! This is the cure for GUIDE!

Dirk Engel

Ryan Ollos

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

Ashish Sadanandan

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!

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

Yair Altman

Yair Altman (view profile)

Magnificent piece of work!

Updates

2.0

Add new ScrollableGridBagLayout for layouts that are bigger than the size available.

1.8

Update for new MATLAB Graphics system. Fix bug when making the UI visible for the first time.

1.7

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

1.6

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

1.4

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

1.3

Fix typos and Axes positioning.

1.2

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.

1.1

Removed log files that were not relevant or useful.

MATLAB Release
MATLAB 8.6 (R2015b)
Acknowledgements

Inspired: UISIGNALBUILDER, GridLayout, UISignalBuilder2

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video