Documentation Center

  • Trial Software
  • Product Updates

Copy, Paste, and Arrange Components

This topic provides basic information about selecting, copying, pasting, and deleting components in the layout area.

Select Components

You can select components in the layout area in the following ways:

  • Click a single component to select it.

  • Press Ctrl+A to select all child objects of the figure. This does not select components that are child objects of panels or button groups.

  • Click and drag the cursor to create a rectangle that encloses the components you want to select. If the rectangle encloses a panel or button group, only the panel or button group is selected, not its children. If the rectangle encloses part of a panel or button group, only the components within the rectangle that are child objects of the panel or button group are selected.

  • Select multiple components using the Shift and Ctrl keys.

In some cases, a component may lie outside its parent's boundary. Such a component is not visible in the Layout Editor but can be selected by dragging a rectangle that encloses it or by selecting it in the Object Browser. Such a component is visible in the active GUI.

See View the GUIDE GUI Object Hierarchy for information about the Object Browser.

    Note   You can select multiple components only if they have the same parent. To determine the child objects of a figure, panel, or button group, use the Object Browser.

Copy, Cut, and Clear Components

Use standard menu and pop-up menu commands, toolbar icons, keyboard keys, and shortcut keys to copy, cut, and clear components.

Copy

Copying places a copy of the selected components on the clipboard. A copy of a panel or button group includes its children.

Cut

Cutting places a copy of the selected components on the clipboard and deletes them from the layout area. If you cut a panel or button group, you also cut its children.

Clear

Clearing deletes the selected components from the layout area. It does not place a copy of the components on the clipboard. If you clear a panel or button group, you also clear its children.

Paste and Duplicate Components

Paste

Use standard menu and pop-up menu commands, toolbar icons, and shortcut keys to paste components. GUIDE pastes the contents of the clipboard to the location of the last mouse click. It positions the upper-left corner of the contents at the mouse click.

Consecutive pastes place each copy to the lower right of the last one.

Duplicate

Select one or more components that you want to duplicate, then do one of the following:

  • Copy and paste the selected components as described above.

  • Select Edit > Duplicate. Duplicate places the copy to the lower right of the original.

  • Right-click and drag the component to the desired location. The position of the cursor when you drop the components determines the parent of all the selected components. Look for the highlight as described in Add a Component to a Panel or Button Group.

Front-to-Back Positioning

MATLAB® figures maintain separate stacks that control the front-to-back positioning for different kinds of components:

  • User interface controls such as buttons, sliders, and pop-up menus

  • Panels, button groups, and axes

  • ActiveX® controls

You can control the front-to-back positioning of components that overlap only if those components are in the same stack. For overlapping components that are in different stacks:

  • User interface controls always appear on top of panels, button groups, and axes that they overlap.

  • ActiveX controls appear on top of everything they overlap.

The Layout Editor provides four operations that enable you to control front-to-back positioning. All are available from the Layout menu, which is shown in the following figure.

  • Bring to Front — Move the selected object(s) in front of nonselected objects (available from the right-click context menu, the Layout menu, or the Ctrl+F shortcut).

  • Send to Back — Move the selected object(s) behind nonselected objects (available from the right-click context menu, the Layout menu, or the Ctrl+B shortcut).

  • Bring Forward — Move the selected object(s) forward by one level, i.e., in front of the object directly forward of it, but not in front of all objects that overlay it (available from the Layout menu).

  • Send Backward — Move the selected object(s) back by one level, i.e., behind the object directly in back of it, but not behind all objects that are behind it (available from the Layout menu).

    Note   Changing front-to-back positioning of components also changes their tab order. See Set Tab Order in a GUIDE GUI for more information.

Was this topic helpful?