Function_reference |

## 1.1: uix.Panel

Arrange a single element inside a standard panel

`obj``= uix.Panel(``)`
  creates a standard `uipanel` object but 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.Panel(``prop``,``value``,``...``)`
  also sets one or more property values.

### uix.Panel properties

Property | Value | Description
--- | --- | ---
`BackgroundColor` | `colorspec` | 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 | Deletion status.
`BorderType` | none | etchedin | etchedout | beveledin | beveledout | line | Type of border around the uipanel area.
`BorderWidth` | positive integer | Width of the panel border.
`Contents` | empty GraphicsPlaceholder array | array of graphics objects | Children within this layout, regardless of HandleVisibility. Note that this can only be set to permutations of itself.
`DeleteFcn` | `function_handle` | Function to call when the layout is being deleted.
`FontAngle` | normal | italic | oblique | Title font angle.
`FontName` | string | Title font name (e.g. Arial, Helvetica etc).
`FontSize` | positive integer | Title font size.
`FontUnits` | inches | centimeters | normalized | points | pixels | Title font units for measuring size.
`FontWeight` | light | normal | demi | bold | Title font weight.
`ForegroundColor` | `colorspec` | Title font color and/or color of 2-D border line.
`HighlightColor` | `colorspec` | 3-D frame highlight color.
`Padding` | positive integer | Number of pixels of extra space around the outside of the layout.
`Parent` | empty GraphicsPlaceholder array | figure | container | Parent of the layout.
`Position` | [x y w h] | Position (x,y) and size (w,h) within figure or container.
`Selection` | positive integer or empty | Which child is visible.
`ShadowColor` | `colorspec` | 3-D frame shadow color.
`Tag` | string | Tag to associate with layout.
`Title` | string | Title string.
`TitlePosition` | lefttop | centertop | righttop | leftbottom | centerbottom | rightbottom | Location of title string in relation to the panel.
`Type` | string | Type of graphics object.
`Units` | inches | centimeters | normalized | points | pixels | characters | Position units.
`Visible` | on | off | Visibility.

### For example:

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

    f = figure();
    p = uix.Panel( 'Parent', f, 'Title', 'A Panel', 'TitlePosition', 'CenterTop');
    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] );

See also:

- `uix.CardPanel` - for creating an undecorated panel
- `uix.BoxPanel` - for creating a more boxy panel
- `uix.TabPanel` - for a panel with tabs for selecting the visible child

© 2024 The MathWorks Ltd `•` Terms of Use `•` Patents `•` Trademarks