简体   繁体   中英

MATLAB GUI tab ordering

In my current project I have a bunch of edit text boxes in my gui. When I/m in the first text blank and hit the tab key it skips to the third text box, when I hit tab again it goes to the second box. Every time I hit tab it jumps around in this weird order. I found out that the order is dependent on the order of the callback function for each text box. Without going in an copy pasting and changing around the code that gets generated by guide is there a better way to order my text boxes. So for example when I'm in the box red x and hit tab it takes me to the box red z, than red y than green x then green z. I want to be able to click red x and then using just tab step through and fill out the other blocks. Is it at all possible to re-order?

在此处输入图片说明

GUIDE-generated GUI

When using GUIDE, you can simply use the "Tab Order Editor" . Get to it using the following menu item:

在此处输入图片说明

For this simple GUI, with a single button and two text boxes, you would see the following dialog box:

在此处输入图片说明

Then set the tab order by moving UI objects up/down.


Programmatic GUI

To set the tab order programatically , you can use uistack to reorder the handles.

For example, to move a uicontrol "up" one in the order:

uistack(hui,'up',1)

To see the order of the handles to all controls in figure hf :

ch = get(hf,'Children')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM