Creating Graphical User Interfaces Previous page   Next Page

Setting the Tab Order

A GUI's tab order is the order in which components of the GUI are selected when a user presses the Tab key on the keyboard.

The tab order for each level is determined independently. The figure is the base level, and each panel or button group establishes its own level. If, in tabbing through the components at the figure level, a user tabs to a panel or button group, then subsequent tabs sequence through the components of the panel or button group before returning to the level from which the panel or button group was reached.

The following topics discuss how to set the tab order.

The GUIDE Tab Order Editor

When you create a GUI, GUIDE sets the tab order at each level to be the order in which you add components to that level in the Layout Editor. This is often not the best order for the user.

The figure in the following GUI contains an axes, a slider, a panel, a static text, and a pop-up menu. Of these, only the slider, the panel, and the pop-up menu at the figure level can be tabbed. The panel contains three push buttons, which can all be tabbed.

GUI containing an axes, a slider, a panel, a static text, and a pop-up menu

To examine and change the tab order of the panel components, click the panel background to select it, then select Tab Order Editor in the Tools menu of the Layout Editor.

.

Tab order editor

The Tab Order Editor displays the panel's components in their current tab order. To change the tab order, select a component and press the up or down arrow to move the component up or down in the list. If you set the tab order for the three components in the example to be

  1. Surf push button
  2. Contour push button
  3. Mesh push button

the user first tabs to the Surf push button, then to the Contour push button and then to the Mesh push button. Subsequent tabs sequence through the remaining components at the figure level.


Previous page  Defining Context Menus Setting the Tab Order Programmatically Next page

© 1994-2005 The MathWorks, Inc.