MEventDistributor

MEventDistributor is a mixin class that distributes events to appropriate TEventTarget or MEventTarget objects. You will normally use a TSimpleEventDistributor object (discussed in the next section) unless you are creating a new input device.

In the event that you are creating a new input device, you must derive a subclass of MEventDistributor to specify a particular event distribution policy. For example, the View system may implement a TViewEventDistributor that knows how to distribute an event through the view hierarchy given a TGPoint as data.

The MEventDistributor class implements two methods: HandleDistributeEvent and DistributeEvent. When the MEventDistributor class is instantiated, it has only basic distribution semantics. Objects of this class will try to send the event to a TInteractor object bound to the TInputDevice.

DistributeEvent is a non virtual function called by clients. It, in turn, calls HandleDistributeEvent--a virtual function which implements specific event distribution policy.


NOTE In order to implement a specific event distribution policy you should override the MEventDistributor::HandleDistributeEvent method.

MSimpleEventTarget and TSimpleEventDistributor

The MSimpleEventTarget and TSimpleEventDistributor classes are a matched pair. Together, they provide a basic targeting service.

Implementations of the MSimpleEventTarget mixin class allow TEventTarget objects to add and delete themselves to the event-handling sequence of a particular TStandardEventReceiver in a last-come, first-served manner.

When you want an object to be part of the simple target sequence, add the MSimpleEventTarget class as a mixin. The TSimpleEventDistributor class is typically used by input device subclasses whose events are to be distributed by a simple chain (for example, keyboard events).

MEventReceiver

Most application developers will probably use the TStandardEventReceiver class in their applications. However, in the event that you want to create application-specific, event-handling behavior, you should derive from the MEventReceiver class.

The MEventReceiver object has methods that allow it to:


[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