Language Reference Guide : Events : FrameDeactivate Event
 
Share this page          
FrameDeactivate Event
The FrameDeactivate event is triggered when a frame changes from an active to an inactive state. This change occurs when a user activates another frame through mouse selection or the use of keyboard interface. This event can be used, for example, to remove visual effects that are used for active frames. The frame being deactivated can be a normal one or a frame minimized to an icon.
This event has the following syntax:
on framedeactivate [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 FrameDeactivate event block:
ReasonCode
Specifies the type of operation that caused an event
Usage: In this example, the frame hides its data entry area when it is deactivated in a normal state:
On FrameDeactivate =
    if CurFrame.ReasonCode = RC_NORMAL_INACTIVE then
        field(data_entry).CurBias = FB_INVISIBLE;
    endif;
end
The ReasonCode attribute of the FrameExec object identifies the conditions of the deactivation as follows:
RC_NORMAL_INACTIVE
Specifies that a normal frame is being deactivated
RC_ICONIZED_INACTIVE
Specifies that a frame minimized to an icon is being deactivated
Note:  An indirect FrameDeactivate 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. A FrameDeactivate event is caused during the execution of a CallFrame statement. However, because the parent frame is disabled, the event is queued and the code is not executed until the block containing the CallFrame statement has completed. The FrameDeactivate block will be executed, however, before the corresponding FrameActivate block.
More information:
ReasonCode Attribute