Language Reference Guide : System Classes : MouseData Class
 
Share this page          
MouseData Class
The MouseData class contains information about the mouse that caused a MouseDown, ChildMouseDown, MouseUp, or ChildMouseUp event.
At the heart of most event-driven systems is an event queue to which the system posts events as they occur. This event stream can be a mixture of abstract software- or hardware-related events. For example, moving a window results in a WM_MOVE message appearing in the system queue is an abstract software message, whereas moving a physical mouse posts a stream of WM_MOUSEMOVE messages to it, which are hardware-related messages. Applications accept messages from this queue to take action upon them in an event-driven system.
OpenROAD abstracts some of these system events, such as WM_LBUTTONDOWN, WM_LBUTTONUP, and WM_* into OpenROAD 4GL events. For example, the Click event can occur only as result of OpenROAD seeing a WM_LBUTTONUP system event over a window that represents a FieldObject.
The MouseData class interacts with the OpenROAD events MouseDown Event, ChildMouseDown Event, MouseUp Event, and ChildMouseUp Event. These events are not queued; instead, the OpenROAD runtime generates them immediately. Therefore, they fire before any future OpenROAD events occur from the same system event such as Click events, which can occur only after some WM_LBUTTONUP system events. OpenROAD events such as KeyDown Event and SliderMove Event behave similarly.
You may discard further processing of a WM_LBUTTONDOWN, WM_MBUTTONDDOWN, or WM_RBUTTONDOWN message. OpenROAD will then ignore the corresponding WM_LBUTTONUP, WM_MBUTTONUP, or WM_RBUTTONUP event that generates an abstract OpenROAD 4GL event, such as a Click event; however, the corresponding MouseUp OpenROAD 4GL event will occur for you to catch. You can signal that the event should be terminated by setting the CancelEvent Attribute to a non-zero value.
Reason code system constant settings enable you to identify which mouse button—MS_LEFT, MS_RIGHT, or MS_MIDDLE—triggers the event. For more information, see For the ChildMouseDown, MouseDown, ChildMouseUp, and MouseUp Events.
Other information regarding this event is available in a MouseData object delivered through the MessageObject attribute of the GhostExec class (see MessageObject Attribute). For each of these events, the following information is available when the event occurs:
Time
Coordinate of mouse position, in pixels, relative to the screen
Coordinate of mouse position, in pixels, relative to the FieldObject it is over
State of any modifier keys such as Left-Ctrl, Right-Ctrl, Alt, and Shift keys
WidgetID that represents the system handle of the window associated with this system event, usually the window that represents the FieldObject it is over
Inherits From
Object Class
Inherited By
None
Attributes
CancelEvent
KeyModifiers
TimeStamp
WidgetID
XPixel
XPixelScreen
YPixel
YPixelScreen
Methods
None