Programming Guide : Managing Event Queues : Event-based Programming : How You Can Obtain Information about the Current Event
 
Share this page          
How You Can Obtain Information about the Current Event
The FrameExec object (described in Programming Frames) contains information about the current event. This information can be very useful in your event code. The Language Reference Guide lists the FrameExec attributes you can use for each of the OpenROAD events.
The most useful of the FrameExec attributes are the following:
TriggerField
Data Type: FieldObject
Contains the field that triggered the event (the user originally interacted with this field)
OriginatorField
Data Type: FieldObject
Contains the field specified in the original on statement of the current event block
InputFocusField
Data Type: ActiveField
Contains the field on the form that currently has the input focus
PreviousField
Data Type: ActiveField
Contains the field that most recently had the input focus (the field that was just exited)
TargetField
Data Type: ActiveField
Contains the field that is to be the next field with the input focus (the field to be entered next)
In the following example, the TriggerField attribute is used to change the background color of the field that the user has just entered:
on childentry =
begin
    ActiveField(CurFrame.TriggerField).BgColor =
    CC_RED;
end
Note:  The data type of the TriggerField attribute is FieldObject, allowing it to refer to any field on a form. However, to manipulate a specific field's attributes, such as changing an entry field's background color, you must inform OpenROAD about the correct system class of the field being affected. The process for informing the system is called casting. For more information about casting, see How You Can Work with Attributes.