Placing Focus on an Object vs. Selecting an Object

There is a difference between on object being selected, and an object that has the focus on a system page. An object that has the focus is ready for input from the user. If the object is an edit field for example, the cursor will blink within the field, indicating that it is ready for input. If the object with the focus is a button, it is highlighted when selected. It is very important to note that an object that has the focus is not necessarily selected. In order for an object that has the focus to be selected, it must be clicked by the mouse, or the <TAB> key, or the <RETURN> or <ENTER> key must be pressed.

It is possible to force the input focus to a certain graphic object by means of a NextFocusID statement. When dealing with statements that combine an If function and a GUIButton function, it is important to keep in mind that you may focus the button, but the script paired with the If function will not be executed until the button is actually selected (either by the keyboard or the mouse).

Focus movement (on a tab (Tab key) or reverse tab (i.e. Shift + Tab keys)) is that focusable statements in the topmost active state for a module are focused in the order that they appear in the source code. This applies, recursively, to calling sequences in steady state. For example:

ZButton(...1...); 

ChildMod(); 

ZButton(...2...); 

In this example, ZButton(...1...) would be first in the focus order, followed by any focusable statements in ChildMod, followed by ZButton(...2...).

Launched modules, however, should appear in the focus order after steady state focusable statements and steady-state calling sequences.

For example:

If Watch(1); 

LaunchedMod(); 

ZButton(...1...); 

ChildMod(); 

ZButton(...2...); 

In the above sequence, the focus order will be the same as that of the previous example above, with the addition of any focusable statements in LaunchedMod, after ZButton(...2...).