Language Reference Guide : 5. Events : ChildMouseDown Event
 
Share this page                  
ChildMouseDown Event
The ChildMouseDown event triggers whenever OpenROAD receives a WM_LBUTTONDOWN, WM_MBUTTONDDOWN, or WM_RBUTTONDOWN message. The event is not queued but generates and fires immediately. Information about the state of the mouse is stored in a MouseData object (see MouseData Class) delivered to the 4GL program in the MessageObject of the FrameExec, which inherits from the GhostExec Class. The 4GL event code has the opportunity to stop further processing of a WM_LBUTTONDOWN, WM_MBUTTONDDOWN, or WM_RBUTTONDOWN message by modifying the MouseData object. To discard the message, set the MouseDown.CancelEvent to TRUE.
In the following example, generation of any 4GL event that would happen because of this particular ChildMouseDown event will not occur:
On ChildMouseDown =
Declare
    MouseInfo = MouseData default NULL;
Enddeclare
Begin
    MouseInfo = MouseData( CurFrame.MessageObject );
    /* Do no further processing as a result of this ChildMouseDown event */
    MouseInfo.CancelEvent = TRUE;
End;
This event has the following syntax:
on ChildMouseDown [compositefieldname]
The following attributes of the FrameExec or GhostExec class are available in the ChildMouseDown event block:
MessageObject
Specifies a MouseData object that contains information about the state of the mouse at the time of the ChildMouseDown event
OriginatorField
Specifies the field specified in the on ChildMouseDown statement
ReasonCode
Specifies a reason code:
RC_MOUSELEFT – The user pressed the left mouse button down.
RC_MOUSELEFTDOUBLECLICK – The user pressed the left mouse button down, released the left mouse button, and then pressed the left button down again within the system-defined double-click interval.
RC_MOUSEMIDDLE – The user pressed the middle mouse button down.
RC_MOUSEMIDDLEDOUBLECLICK – The user pressed the middle mouse button down, released the middle mouse button, and then pressed the middle button down again within the system-defined double-click interval.
RC_MOUSERIGHT – The user pressed the right mouse button down.
RC_MOUSERIGHTDOUBLECLICK – The user pressed the right mouse button down, released the right mouse button, and then pressed the right button down again within the system-defined double-click interval.
For numeric equivalents of these system constants, see For the ChildMouseDown, MouseDown, ChildMouseUp, and MouseUp Events.
TriggerField
Specifies the FieldObject that the mouse button was pressed down on
More information:
MouseDown Event
MessageObject Attribute (GhostExec class)
OriginatorField Attribute (FrameExec class)
TriggerField Attribute (FrameExec class)