File Exchange Pick of the Week

Our best user submissions

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

GUI Layout (Part 7) 9

Posted by Jiro Doke,

Jiro's pick this week is GUI Layout Toolbox by Ben Tordoff and David Sampson, who are MathWorks consultants from our UK office.

It's been a while since I highlighted a GUI layout entry. For those interested in looking at my previous posts, here they are: Part 1, Part 2, Part 3, Part 4, Part 5, Part 6.

This is the ultimate GUI Layout Toolbox. This toolbox contains layout utilities that integrate seamlessly with MATLAB UI components. In addition, it allows components to resize dynamically (by draggable dividers) and comes with a highly-requested tab component. The toolbox is fully developed using the MATLAB Class system.

If you think you're impressed with all the capabilities that it offers, wait until you take a look at the full documentation that it comes with. The documentation includes Examples, Function Reference Pages, and Getting Started section -- all the sections you see in our documentation.

Let's see this thing in action!

fh = figure('Units', 'Pixels', ...
   'OuterPosition', [100 100 500 500], ...
   'Toolbar', 'none', 'Menu', 'none');
p = uiextras.TabPanel('Parent', fh, ...      % Tab Component
   'Padding', 5 );
axes('Parent', p);                           % 1st Tab
b1 = uiextras.HBox('Parent', p, ...          % 2nd Tab - Horiz Box
   'Spacing', 5);
load table_data
uitable('Parent', b1, ...                    %   Left Box
   'Data', d, ...
   'RowName', '', ...
   'ColumnName', {'Property', 'Value'}, ...
   'ColumnWidth', {150,100});
b2 = uiextras.VBoxFlex('Parent', b1, ...     %   Right Box - Flex Vert Box
   'Spacing', 5);
uicontrol('Parent', b2, ...                  %     Top Box
   'Style', 'listbox');
uicontrol('Parent', b2, ...                  %     Middle Box
   'Style', 'listbox');
b3 = uiextras.HButtonBox('Parent', b2, ...   %     Bottom Box - Horz Button
   'ButtonSize', [100 25]);
uicontrol('Parent', b3, ...                  %       Left Button
   'String', 'Set');
uicontrol('Parent', b3, ...                  %       Right Button
   'String', 'Clear');

% Set Tab Names
set(p, 'TabNames', {'Main Plot', 'Settings'});

% Set sizes of boxes
set(b1, 'Sizes', [-1 205]);
set(b2, 'Sizes', [-1 -1 25]);


Let us know what you think here.

Get the MATLAB code

Published with MATLAB® 7.10


Comments are closed.

9 CommentsOldest to Newest

Øyvind replied on : 3 of 9
This stuff is golden! But I've noticed that none of the examples in the documentation, nor your example here try to line up text with other controls. And I can't make it work. Any tips?
jiro replied on : 4 of 9
@a, Sorry about the table data. After creating the figure (the command with fh = figure...), run this to create the data:
figSettings = get(fh);
fnames = fieldnames(figSettings);
vals = struct2cell(figSettings);
charIdx = cellfun('isclass', vals, 'char');
d = [fnames(charIdx), vals(charIdx)];

@Øyvind, I'm not sure I understand what you mean by "line up text with other controls". You can create a UICONTROL with a style of "text" and have that line up with other components. You probably cannot use the TEXT command...
teru replied on : 6 of 9
hi sir. I'm pretty new with GUI so i really needs your helps. can you give me any links on how to create the GUI system for people tracking. I'm stuck with the last step by using bounding box to track the people in video that i had recorded, after read the input, background subtraction(threshold) and morphological process.can you help me sir. waiting for your reply. thank you. this is my email just in case:
jiro replied on : 9 of 9
@Chris, It probably won't integrate so well with the GUIDE environment. But you can include calls to these utilities from callbacks made in GUIDE. Essentially, you can add these calls to the GUI Opening Function, for instance.