trigger getFocus (Form)

Interactive trigger that responds to the form getting focus.

Declaration: trigger getFocus
Applies to: Form
Activation: Activated by the form getting focus as a result of user actions or ProcScript commands.
Default behavior: None
Behavior upon completion: None

Description

Caution: Do not use the getFocus trigger to change focus. For example, you should not use ProcScript instructions such as setformfocus or $prompt, display a dialog box, or activate another component instance in this trigger.

Trigger Activation

The getFocus trigger can be activated in several ways:

  • When a mouse click positions the cursor in the current form (whether or not it is minimized), after the loseFocus trigger of the previous form completes successfully.
  • When a form receives focus after a form that previously had focus stops, for example, following ^ACCEPT, return, and so on. (This occurs even if the form receiving focus is minimized.)

Communicating with a Parent Instance

The following example sends a message to the parent form when the current form get focus:

trigger getFocus
  if ($instanceparent != "")
     postmessage $instanceparent, "GETTING FOCUS", $instancename
  endif
end; getFocus

Related Topics