Mouse events

A mouse event is a packet of data that the mouse device creates. You can't examine the internal structure of a mouse event. Instead, the Input System and the View System work together to turn a mouse event into a call on one of your view's member functions.

Figure 23 illustrates how the input system converts a mouse-down event into a request for your task's event receiver.


In Figure 24, the request handler dispatches the request to the event receiver. The event receiver calls DistributePositionalEvent to let the view hierarchy determine the appropriate target view for the event.


Figure 25 illustrates how DistributePositionalEvent recursively descends the view hierarchy giving each view a chance to handle the mouse event. The default implementation of DistributePositionalEvent determines which child view (if any) contains the point where the mouse event occurred, then recursively calls that child's DistributePositionalEvent. This recursive process carries the input event down the view hierarchy until it reaches a view with no children. If no child view contains the point where the mouse event occurred, DistributePositionalEvent calls DispatchEvent, which converts the event into a TMouseEvent object and calls the view's MouseDown function.


In most view classes, this default behavior of DistributePositionalEvent is correct: if you click the mouse, the event makes its way to the front-most visible view that contains the point where the event occurred, and that view's MouseDown member function gets called automatically.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker