Language Reference Guide : 5. Events : MouseDown Event
 
Share this page                  
MouseDown Event
The MouseDown 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 delivered to the 4GL program in the MessageObject of the FrameExec, which it 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 MouseData.CancelEvent to TRUE.
In the following example, generation of any 4GL event that would happen because of this particular MouseDown event will not occur:
On MouseDown =
Declare
    MouseInfo = MouseData default NULL;
Enddeclare
Begin
    MouseInfo = MouseData( CurFrame.MessageObject );
    /* Do no further processing as a result of this MouseDown event */
    MouseInfo.CancelEvent = TRUE;
End;
This event has the following syntax:
on MouseDown [activefield]
The following attributes of the FrameExec or GhostExec class are available in the MouseDown event block:
MessageObject
Specifies a MouseData object that contains information about the state of the mouse at the time of the MouseDown event
OriginatorField
Specifies the field specified in the on MouseDown statement
TriggerField
Specifies the FieldObject field that the mouse button was pressed down on
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 with in the system defined doubleclick 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.
More information:
ChildMouseDown Event
MessageObject Attribute (GhostExec class)
OriginatorField Attribute (FrameExec class)
TriggerField Attribute