Function reference previous pagenext page

2.5: uiextras.HButtonBox Go back up one level


Arrange buttons horizontally in a single row

obj = uiextras.HButtonBox( )
is a type of HBox specialised for arranging a row of buttons, check-boxes or similar graphical elements. All buttons are given equal size and by default are centered in the drawing area. The justification can be changed as required.
obj = uiextras.HButtonBox( prop, value, ... )
also sets one or more property values.

uiextras.HButtonBox properties

PropertyValueDescription
BackgroundColor colorspecThe color to use for exposed areas of the layout background. This can be an RGB triple (e.g. [0 0 1]) or a colour name (e.g. 'b').
BeingDeleted [ on | off ]is the object in the process of being deleted.
ButtonSize [w h]The size for the buttons (all are given equal size).
Children handle arrayList of child objects within this layout (note that this can only be set to permutations of itself).
DeleteFcn function_handleFunction to call when the layout is being deleted
Enable [ on | off ]Is interaction with this layout enabled? Note that changing the enable property will cause all children contained to also be enabled/disabled, however since they can be individually re-enabled the state of this property does not reflect the state of the children. See the enable example for more details.
HorizontalAlignment [ left | center | right ]The horizontal position of the buttons.
Padding positive integerNumber of pixels of extra space around the outside of the layout.
Parent handleThe handle of the parent figure or container.
Position [x y w h]The position (x,y) and size (w,h) of the layout.
Spacing positive integerNumber of pixels of extra space to leave between elements in the layout.
Tag stringA string that can be used to identify this object later.
Type stringthe object type (class).
Units [ inches | centimeters | normalized | points | pixels | characters ]The units of measurement for position the layout within its parent.
VerticalAlignment [ top | middle | bottom ]The vertical position of the buttons.
Visible [ on | off ]Is the object visible on screen.

For example:

f = figure();
b = uiextras.HButtonBox( 'Parent', f );
uicontrol( 'Parent', b, 'String', 'One' );
uicontrol( 'Parent', b, 'String', 'Two' );
uicontrol( 'Parent', b, 'String', 'Three' );
set( b, 'ButtonSize', [130 35], 'Spacing', 5 );


See also:
© 2014 The MathWorks Ltd Terms of Use Patents Trademarks