lego/src/DragSwitchVBT.i3


Copyright (C) 1994, Digital Equipment Corp.
<* PRAGMA LL *>
<* PRAGMA SUBTYPE *>
A DragSwitchVBT is a switch version of Trestle's DragBtnVBT.

Actually, DragBtnVBT does not exist. If it existed, it would be a ButtonVBT subclass that generates events while a mouse button is down and has moved since the last time an event was generated. Events are generated even when the mouse is outside the VBT's domain, as long as it remains on the screen.

The pre method is invoked on the first click in the VBT; the post method is called on an uncanceled upclick; the cancel method is called whenever the mouse is ``chorded''; the during method is called whenever the mouse has moved since the last call to during or pre. A new cage containing the current cursor position will be set before calls to pre and during. The callback method is invoked on an uncancelled upclick. The default during and callback methods are no-ops.

INTERFACE DragSwitchVBT;

IMPORT ButtonVBT, FeedbackVBT, VBT;

TYPE
  <* SUBTYPE T <: MulitFilter.T *>
  T <: Public;
  Public = ButtonVBT.T OBJECT
           METHODS
             <* LL.sup <= VBT.mu *>
             init (f: FeedbackVBT.T): T;
             <* LL.sup = VBT.mu *>
             during   (READONLY cd: VBT.PositionRec);
             callback (READONLY cd: VBT.MouseRec);
           END;

END DragSwitchVBT.