lego/src/BooleanVBT.i3


Copyright (C) 1994, Digital Equipment Corp.
<* PRAGMA LL *>
<* PRAGMA SUBTYPE *>
A BooleanVBT is a multi-filter that maintains a Boolean state for its VBT-child.

When the action procedure of the button would normally be invoked, the value of the state of the BooleanVBT is toggled and the callback method on the BooleanVBT is invoked.

The multi-child of a BooleanVBT is defined to be the multi-child of the ButtonVBT.

INTERFACE BooleanVBT;

IMPORT ButtonVBT, HighlightVBT, VBT;

TYPE
  <* SUBTYPE T <: MultiFilter.T *>
  T <: Public;
  Public = HighlightVBT.T OBJECT
           METHODS
             <* LL <= VBT.mu *>
             init (button: ButtonVBT.T): T;
             <* LL = VBT.mu *>
             callback (READONLY cd: VBT.MouseRec);
           END;
The call v.init(...) initializes v as a BooleanVBT with an initial state of FALSE. The default callback method is a no-op.

Warning: This call modifies the action field of button.

PROCEDURE Put (v: T; state: BOOLEAN);
<* LL.sup = VBT.mu *>
Set v's state.

PROCEDURE Get (v: T): BOOLEAN;
<* LL.sup = VBT.mu *>
Returns v's current state.

END BooleanVBT.