oi10:presentation_server:focus_property_system

FOCUS property (System)

Returns the name of the control that currently has focus, or sets the focus to a specified control.

A string containing the fully qualified name of the control with focus. When used with Set_Property this value can be the name of WINDOW to activate, and it may also be null to remove the focus from all PS controls.

DevelopmentRuntimeIndexedScaledSynthetic
N/AGet/SetNoNoNo

Using this property to move the focus to a PS control will trigger the appropriate LOSTFOCUS and GOTFOCUS events. When moving the FOCUS as a result of an error condition (e.g. due to invalid input data) then it is usually desirable to use the BLOCKEVENTS property to stop these events firing, thereby avoiding further validation checks that might send the program into a validation loop.

 
// Example: Get the current focus

   

   FocusCtrl = Get_Property( "SYSTEM", "FOCUS" )

   

   

   // Example: LOSTFOCUS event to check a code and move the focus

   // back to the current control if the data is wrong.

   //

   // The name of the current control is in the CtrlEntID variable.

   

   $Insert Logical

   

   CtrlData = Get_Property( CtrlEntID, "TEXT" )

   

   Locate CtrlData In "A,B,C" Using "," Setting Pos Then

      // Fine - All Good

      Null

   End Else

      Call Msg( @Window, "Bad Data" )

   

      // Move the focus back to this control without triggering

      // further validation   

      Call Set_Property_Only( "SYSTEM", "BLOCKEVENTS", TRUE$ )

      Call Set_Property_Only( "SYSTEM", "FOCUS", CtrlEntID )

      Call Set_Property_Only( "SYSTEM", "BLOCKEVENTS", FALSE$ )

   

   End
 
 
 

Common GUI FOCUS property.

  • oi10/presentation_server/focus_property_system.txt
  • Last modified: 2023/10/25 10:49
  • by 127.0.0.1