L_CTRCONTEXT

Establish focus within a child list window

WSupported on Windows

 

 

 

xcall L_CTRCONTEXT(list_id, reason) 

list_id

The ID of the child list. (n)

reason

The reason the list window was activated (which determines what L_CTRCONTEXT will move focus to). This argument can be passed as blank (which indicates that the list was already activated), a program-supplied reason (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 L_CTRCONTEXT to move focus to the list (rather than a button on the list window).

C_LAST

Focus moved in attempt to reach the last child in the composite window. This instructs L_CTRCONTEXT to move focus to the last active button on the tab set (if the list is on a tab). If there is no such button, it moves focus to the last active button for the list window. If there’s no active button for the window, it moves focus to the list itself.

C_NEXT

Focus moved from the previous child in the composite window—e.g., by pressing Tab. This instructs L_CTRCONTEXT to move focus to the list (rather than a button on the list window).

C_PREV

Focus moved from the next child in the composite window—e.g., by pressing Shift+Tab. This instructs L_CTRCONTEXT to move focus to the last active button on the tab set (if the list is on a tab). If there is no such button, it moves focus to the last active button for the list window. If there’s no active button for the list window, it moves focus to the list itself.

C_SET

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

If reason is blank or any value other than the above, L_CTRCONTEXT does not change focus.

L_CTRCONTEXT sets focus for a child list window to either the list or a button on the list window. (On Unix and OpenVMS and in Synergy .NET, this routine is ignored.) L_CTRCONTEXT uses reason to determine where to establish focus, and is designed for use in child list methods (C_METHLST by default), where it’s likely that you want focus to initially reflect the reason the list window was activated. For example, if you have a composite window with a list and an input window, and the user presses Shift+Tab to move from the input window back to the list, you may want the last button in the list to receive focus.

To use in a child method, pass the reason passed to the child method (by C_PROCESS) as the reason argument for L_CTRCONTEXT. See the ctrmeths.dbl file included in your UI Toolkit distribution for an example. This file includes code for the C_METHLST method, which uses L_CTRCONTEXT.