Function_reference previous pagenext page

1.3: uix.BoxPanel Go back up one level


Arrange a single element in a panel with boxed title

obj = uix.BoxPanel( )
creates a box-styled panel object with automatic management of the contained widget or layout. The properties available are largely the same as the builtin UIPANEL object. Where more than one child is added, the currently visible child is determined using the Selection property.
obj = uix.BoxPanel( prop, value, ... )
also sets one or more property values.

uix.BoxPanel properties

PropertyValueDescription
BackgroundColor colorspecColor 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 | offDeletion status.
BorderType none | etchedin | etchedout | beveledin | beveledout | lineType of border around the title and content areas.
Contents empty GraphicsPlaceholder array | array of graphics objectsChildren within this layout, regardless of HandleVisibility. Note that this can only be set to permutations of itself.
CloseRequestFcn function_handleFunction to call when the panel close icon is clicked. Note that if empty, no close button is shown.
CloseTooltipString stringCustom tooltip string for close button. Note that if CloseRequestFcn is empty, no close button is shown.
DeleteFcn function_handleFunction to call when the layout is being deleted.
Docked logicalIs this panel in a docked state. See advanced maneuvers with panels for details.
DockFcn function handleFunction to call when panel is docked or undocked. Note that if empty, no dock button is shown. See advanced maneuvers with panels for details.
DockTooltipString stringCustom tooltip string for dock button (when panel is undocked). Note that if DockFcn is empty, no dock button is shown.
FontAngle normal | italic | obliqueTitle font angle.
FontName stringTitle font name (e.g. Arial, Helvetica etc).
FontSize positive integerTitle font size.
FontUnits inches | centimeters | normalized | points | pixelsTitle font units for measuring size.
FontWeight light | normal | demi | boldTitle font weight.
ForegroundColor colorspecTitle font color and/or color of 2-D border line.
HelpFcn function handleFunction to call when the help icon is clicked. Note that if empty, no help button is shown. See advanced maneuvers with panels for details.
HelpTooltipString stringCustom tooltip string for help button. Note that if HelpFcn is empty, no help button is shown.
HighlightColor colorspec3-D frame highlight color.
MaximizeTooltipString stringCustom tooltip string for minimize button (when panel is minimized). Note that if MinimizeFcn is empty, no minimize button is shown.
Minimized logicalIs this panel in a minimized state. See advanced maneuvers with panels for details.
MinimizeFcn function handleFunction to call when panel is minimized or maximized. Note that if empty, no minimize button is shown. See advanced maneuvers with panels for details.
MinimizeTooltipString stringCustom tooltip string for minimize button (when panel is maximized). Note that if MinimizeFcn is empty, no minimize button is shown.
Padding positive integerNumber of pixels of extra space around the outside of the layout.
Parent empty GraphicsPlaceholder array | figure | containerParent of the layout.
Position [x y w h]Position (x,y) and size (w,h) within figure or container.
Selection positive integer or emptyWhich child is visible.
ShadowColor colorspec3-D frame shadow color.
Tag stringTag to associate with layout.
Title stringTitle string.
TitleColor colorspeccolor for the title bar background.
Type stringType of graphics object.
UndockTooltipString stringCustom tooltip string for dock button (when panel is docked). Note that if DockFcn is empty, no dock button is shown.
Units inches | centimeters | normalized | points | pixels | charactersPosition units.
Visible on | offVisibility. See the visible example for more details.

For example:

f = figure();
p = uix.BoxPanel( 'Parent', f, 'Title', 'A BoxPanel', 'Padding', 5 );
uicontrol( 'Parent', p, 'Background', 'r' )

f = figure();
p = uix.BoxPanel( 'Parent', f, 'Title', 'A BoxPanel', 'Padding', 5 );
b = uix.HBox( 'Parent', p, 'Spacing', 5, 'Padding', 5  );
uicontrol( 'Style', 'listbox', 'Parent', b, 'String', {'Item 1','Item 2'} );
uicontrol( 'Parent', b, 'Background', 'b' );
set( b, 'Widths', [100 -1] );
p.FontSize = 12;
p.FontWeight = 'bold';
p.HelpFcn = @(x,y) disp('Help me!');


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