SETFOCUS


8.0.4, PLBCMP GUI Only

 

The SETFOCUS instruction changes the current focus to another currently active object. The SETFOCUS instruction may be used for objects in the main window and objects in a dialog. It uses one of the following formats:

 

(1)

[label]

SETFOCUS

{object}[,{item}]

(2)

[label]

SETFOCUS

{win},{relative}

(3)

[label]

SETFOCUS

{dialog},{dialog-no}[,{item}]

 

Where:

label

Optional. A Program Execution Label.

object

Required. A previously defined, created, and activated object or pointer to an object that is to receive focus.

item

Optional. A Numeric Variable, decimal constant, or Expression that indicates the item within the object that receives focus.

win

Required. A previously created WINDOW object.

relative

Required. A Numeric Variable, decimal constant, or Expression that indicates the item that receives focus.

dialog

Required. A previously defined and created DIALOG object or pointer to a DIALOG object containing an object that receives focus.

dialog-no

Required. A Numeric Variable, numeric literal, decimal constant, or Expression that indicates the item within the dialog that receives focus.

Flags Affected: NONE

Note the following:

  1. The optional parameter {item} may be a decimal constant or a numeric variable. It is ignored for all objects except for the following objects: CHECKGRP and RADIOGRP. For these two objects the value of {item} indicates which item in the group is to receive focus.

  2. If the specified {relative} value is '-1', the focus is changed to the next object in the TABID sequence relative to the object that currently has the focus on the {window} object.

  3. If the specified {relative} value is '-4', the focus is changed to the prior object in the TABID sequence relative to the object that currently has the focus on the {window} object.

  4. If {object} is a DIALOG, the second form of the instruction is used. The {dialog-no} indicates the object in the DIALOG to which the focus is set. If the value of {dialog-no} is invalid, no action is taken.

  5. If object selected is not on the active window, the window is activated and brought to the front.

  6. The SETFOCUS instruction supports NETCONTROL objects.

 

 

See Also: Example Code, GETFOCUS, Object Instructions

 



PL/B Language Reference LISTINS SETITEM