Language Reference Guide : 5. Events : FrameActivate Event
 
Share this page                  
FrameActivate Event
The FrameActivate event is triggered when a frame changes from an inactive to an active state. This change occurs when a user selects an inactive frame with a mouse, or navigates to it using a keyboard interface. This event can be used, for example, to provide visual effects to an active frame. The frame being activated can be either a normal frame or a frame that has been minimized to an icon.
This event has the following syntax:
on frameactivate [compositefieldname]
compositefieldname is optional if you specify this event in a field script for a composite field.
The following attribute of the FrameExec class can be used in the FrameActivate event block:
ReasonCode
Specifies the type of operation that caused an event
Usage: In this example, the frame is waiting to show a data entry area if it is in an active state:
On FrameActivate =
begin
if CurFrame.ReasonCode = RC_NORMAL_CLICKACTIVE or
CurFrame.ReasonCode = RC_NORMAL_ACTIVE then
field(data_entry).CurBias = FB_VISIBLE +
FB_CHANGEABLE;
endif;
end
The ReasonCode attribute of the FrameExec object identifies the conditions of the activation as follows:
RC_NORMAL_CLICKACTIVE
Indicates that a normal frame is being activated using a mouse click
RC_NORMAL_ACTIVE
Indicates that a normal frame is being activated using a keyboard interface, or by other means such as change in z-order
RC_ICONIZED_CLICKACTIVE
Indicates that a frame minimized to an icon is being activated using a mouse click
RC_ICONIZED_ACTIVE
Indicates that a frame minimized to an icon is being activated using keyboard interface, or by other means
Note:  An indirect FrameActivate event cannot be caused from the invocation of a modal frame from either the use of a message statement, or from a pop-up window from any of the ProcExec modal pop-up methods.
More information:
ReasonCode Attribute