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.
Have you read "readme.txt" file in "patch" folder, where p-file you've mentioned is located?
It mostly explains why they are there.
It looks like these files are fixed versions of core matlab functions, so developers won't release source code for them. Just hope that those issues would be removed some time.
It's easy to use, however, I've been facing same problem while trying to compile this GUI into standalone application.
When attempting to compile some of your code, warnings are given relative to the P-files missing their associated M-Files.
Here is one example :
Warning: Requirements cannot analyze P-code unless the user provides a corresponding M-code along with the P-code in the
same folder. The dependencies of D:\Codes\MATLAB\GUILayout-v1p14\Patch\getpixelposition.p may not be included in the
completion because its corresponding M-code cannot be found by REQUIREMENTS.
I was wondering if there's any workaround, or if you can release the m-code. Since the main reason to write a gui is to distribute it through standalone projects. Thanks for helping in advance.
There is a small "bug" that makes this package incompatible with the Matlab "Application compiler" app for redistributing compiled stand alone applications.
A work around is the following:
The problem lies with the image locations being hard-linked to the location of the package from the use of "fileparts". I replaced these lines with a test for "isdeployed", for example lines 424/5 of uiextras.TabPanel (iLoadIcon function) to:
this_dir = fileparts( mfilename( 'fullpath' ) );
icon_dir = fullfile( this_dir, 'Resources' );
this_dir = '.';
icon_dir = '.';
I then simply include the resource files in the list of additional files in the app.
Great way to plot graphs in different tabs. Highly recommended.
Note: There is a small bug with graphs from different tabs being plotted on top of each other. This can be fixed using uipanel for each graph (instead of uicontainer). See comments below from @eff and @Brett 22nd Aug 2013.