Window.Dispatch Method (Typed) |
Namespace: XSharp.VO.SDK
Tip |
---|
If you want to set a specific return value for the underlying window procedure, you have to change the EventReturnValue variable for the window object.
If you want to handle other events (for example, timer events), you need to write your own Dispatch() method.
The following guidelines should be followed when writing a customized Dispatch() method:
1. Subclass an event type appropriate to the type of operation for which it is being used.
2. Add an event handler function to your derived object. (This event handler should be called with the event when the event is received.)
3. In general, the implementation of this event handler should call Default(). This keeps the same behavior as the base class, but it also
allows other classes to provide useful event handlers for your new type of event, allowing you to provide a framework for other classes to use.
The base class Dispatch() method should be called in those cases where the received event is not handled by the customized dispatcher.
For example:
X# 1RETURN SUPER:Dispatch(<oEvent>) |
1METHOD DispatchUnknown(oEvent) CLASS MyCustomWindow 2// Your code 3// If you need the default window 4// procedure call SELF:Default(oEvent) 5// Assign the event return value to SELF:EventReturnValue, 6// the default value is 0l. 7SELF:EventReturnValue := 1l