source: MML/trunk/machine/SOLEIL/common/toolbox/GUILayout/layoutHelp/Examples/heirarchyexample.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 10 years ago

Initial import--MML version from SOLEIL@2013

File size: 1.2 KB
Line 
1%% A Heirarchy of Layouts Example
2% This example shows how to use layouts within other layouts to achieve
3% more complex user interface designs with the right mix of variable and
4% fixed sized components.
5
6%% Open the window
7% Open a new figure window and remove the toolbar and menus
8window = figure( 'Name', 'A Layout Heirarchy Example', ...
9    'MenuBar', 'none', ...
10    'Toolbar', 'none', ...
11    'NumberTitle', 'off', ...
12    'Position', 200*ones(1,4) );
13
14%% Create the first layout (vertical box)
15% Inside this vertical box we place the axes
16vbox = uiextras.VBox( 'Parent', window );
17axes( 'Parent', vbox );
18
19%% Create the second layout (horizontal box)
20% Inside this horizontal box we place two buttons
21hbox = uiextras.HButtonBox( 'Parent', vbox, 'Padding', 5 );
22uicontrol( 'Parent', hbox, ...
23    'String', 'Button 1' );
24uicontrol( 'Parent', hbox, ...
25    'String', 'Button 2' );
26
27%% Set the sizes
28% We want the axes to grow with the window so set the first size to be -1
29% (which means variable size with wieght 1) and the buttons to stay fixed
30% height so set the second size to 35 (fixed height of 35 pixels)
31set( vbox, 'Sizes', [-1 35] )
Note: See TracBrowser for help on using the repository browser.