U_CTRCONTEXT

Establish context within a child window

WTSupported in traditional Synergy on Windows

 

 

 

xcall U_CTRCONTEXT(window_id, reason)

Arguments

window_id

The ID of the child window. (n)

reason

The reason the window was activated (which determines what U_CTRCONTEXT will move context to). This argument can be passed as blank (which indicates that the window was already activated), a program-supplied reason passed because it was activated programmatically, or one of the following: (a)

C_FIRST

Focus moved in attempt to reach the first child in the composite window. This instructs U_CTRCONTEXT to move focus to the window itself (rather than a button on the window).

C_LAST

Focus moved in attempt to reach the last child in the composite window. This instructs U_CTRCONTEXT to move context to the last active button for the window. If the window is part of a tab set with an active button, this moves context to the last active button for the tab set. If there is no active button for the window or tab set, this moves focus to the window itself.

C_NEXT

Focus moved from the previous child in the composite window—e.g., by pressing tab. This instructs U_CTRCONTEXT to move context to the window itself (rather than a button on the window).

C_PREV

Focus moved from the next child in the composite window—e.g., by pressing shift+tab. This instructs U_CTRCONTEXT to move context to the last active button for the window. If the window is part of a tab set with an active button, this moves context to the last active button for the tab set. If there is no active button for the window or tab set, this moves focus to the window itself.

C_SET

Window or button explicitly activated. For example, this could be the result of a mouse click, or it could be that the window or button was activated programmatically without a specified reason. With this reason, U_CTRCONTEXT does not change focus.

If reason is blank or any value other than the C_ values above, U_CTRCONTEXT does not change focus

Discussion

When used in a child processing method, U_CTRCONTEXT enables users to tab through buttons in windows that are part of a composite window. For example, if a composite window has a text window and a list, and the user presses shift+tab to move from the list back to the text window, U_CTRCONTEXT moves focus to the last button in the text window.

U_CTRCONTEXT uses reason to determine where to establish focus, and since C_PROCESS passes a reason code to child processing methods, this reason code can then be passed as reason to U_CTRCONTEXT. This enables focus to initially reflect the reason the window was activated.

There are several similar Toolkit routines that are designed to be called from child processing methods and that use a reason code to control focus in a child, but U_CTRCONTEXT is for child windows that are not input windows, container windows for lists, tab set windows, or composite container windows. For example, it is used in the default methods C_METHAX (for ActiveX windows), C_METHSEL (for selection windows), and C_METHTXT (for text windows). (For the other types of windows listed above, see I_CTRCONTEXT, L_CTRCONTEXT, DTS_CTRCONTEXT, and DC_CTRCONTEXT.)

For examples of how to use U_CTRCONTEXT in a child processing method, see the ctrmeths.dbl file included in the UI Toolkit distribution. This file has the code for the default methods C_METHAX, C_METHSEL, and C_METHTXT, all of which use U_CTRCONTEXT.

On UNIX and OpenVMS and in Synergy .NET, this routine is ignored.

See also