User`s guide

11 Lay Out a Programmatic GUI
Set Tab Order in a Programmatic GUI
In this section...
“How Tabbing Works” on page 11-70
“Default Tab O rder” on page 11-70
“Change the Tab Order” on page 11-73
How Tabbing Works
A GUI’s tab order is the order in which com ponents of the GUI acquire focus
when a user presses the keyboard Tab key. Focus is generally denoted by
aborderoradottedborder.
Tab order is determined separately for the children of each parent. For
example, child components of the GUI figure have their own tab order. Child
components of each panel or button group also have their own tab order.
If, in tabbing through the components at one level, a user tabs to a panel or
button group, then the tabbing sequences through the components of the
panel or button group before returning to the level from which the panel or
button group was reached. For example, if a G UI figure contains a panel that
contains three push buttons and the user tabs to the panel, then the tabbing
sequences through the three push buttons before returning to the figure.
Note You cannot tab to axes and static text components. You cannot
determine programmatically which component has focus.
Default Tab Order
The default tab order for each level is the order in which you create the
components at that level.
The following code creates a GUI that contains a pop-up menu with a static
text label, a panel with three push buttons, and an axes.
fh = figure('Position',[200 200 450 270]);
pmh = uicontrol(fh,'Style','pop upmenu',...
11-70