Activating - cUIObject
Sent by the object to itself whenever the object is first activated (placed on the screen)
Type: Event
Syntax
Procedure Activating
Description
The Activating event is sent by the object to itself whenever the object is first activated (placed on the screen). By default, the message does nothing and is designed for you to augment to add any setup processing code that the object may require before it is placed on the screen.
Activating is called for every single object in a view or dialog in a top down order. It is called before the Windows object is created. It is called before the child controls are created (i.e., it is called before Add_Focus is sent to the child objects). Therefore, at this point you can change properties, change Windows styles and perform even more aggressive customizations to the child objects. You should not try to do anything that changes the focus, deactivates objects or alters the existing focus tree. You cannot use this message to cancel the activation, it's not designed to do that. Therefore, don't return a value from this event. You can use Add_Focus to do so.
To add processing code to an object that should execute each time the object is activated instead of just the first time, augment the Activate message instead of Activating.
Activating is called right after an object is added to the focus tree and right before the Windows control is created. See Activate for detailed explanations of the View and Modal Dialog activation process.
Sample
This sample shows how to augment the Activating method to conditionally set the property pbExampleProperty based on the value of property piExampleValue.
Procedure Activating
Integer iTestValue
Forward Send Activating
Get piExampleValue to iTestValue
If (iTestValue > 10) Begin
Set pbExampleProperty to True
End
Else Begin
Set pbExampleProperty to False
End
End_Procedure
Some classes an subclasses may perform some actions during Activating, so we recommend always Forward Sending this message.
See Also