Tab order¶
This run time property is an integer value representing the position of a control in the tab sequence of its parent window. The tab sequence is the order in which controls receive focus when the user presses the TAB key during a dialog.
The initial tab order is determined by the order in which controls are defined within a program. The tab_order clause may be used at run time to change a control’s position in the tab order. The tab order for other controls in the window is automatically renumbered.
The controls in a window are numbered from 1 to the total number of controls in that window. If a value less than 1 or higher than the total number of controls is assigned, the command is ignored. If the Sculptor system variable sys.Warn is set to 3 or higher, an attempt to assign an illegal tab_order value causes a debug message to be generated.
The tab order value of a grouped control is its position in the window, not the group, but controls in any given group must have consecutive tab order values. This is best illustrated with an example:
Control |
Textbox |
Textbox |
3-button group |
4-textbox group |
Button |
Button |
Tab order |
1 |
2 |
3-5 |
6-9 |
10 |
11 |
If a new value is assigned to a control in this window, it must fall within the range 1-11. When a new position is assigned, the control that was in that position, and all subsequent controls, are renumbered one higher.
So, if the tab_order of the penultimate button is changed to 2, the new order is:
Control |
Textbox |
Button |
Textbox |
3-textbox group |
4-textbox group |
Button |
Tab order |
1 |
2 |
3 |
4-6 |
7-10 |
11 |
A control may not be moved outside its group. Thus, a button in the 3-button group can only be assigned a value in the range 4-6, and controls outside the group are not affected.
The tab_order property can only be set at run time. It has no effect on the position of the controls. To alter the position of controls at run time, use the xcreate|ycreate clauses.
RELATED TOPICS |