lego/src/OffsetVBT.i3


Copyright (C) 1994, Digital Equipment Corp.
<*PRAGMA LL*>
An OffsetVBT.T is a filter that maintains a translation between the coordinate systems of the child and parent. The parent's domain has its northwest corner at an arbitrary offset from the child's. The child's domain width and height correspond to the child's preferred size.

The parent's domain may be a different size than the child's. Any portion of the child's domain that isn't visible is clipped and any portion of the parent's domain that doesn't show a portion of the child, displays in a background color.

For Simple, there is no restriction on the coordinates of the northwest corner. For T, the child's domain has its northwest corner at (0, 0); this is used when a child is connected to several JoinParent which are viewing the same child at several locations on the scree.

The child can be NIL, in which case the OffsetVBT ignores all events.

INTERFACE OffsetVBT;

IMPORT VBT, Filter, PaintOp;

TYPE
  T <: TPublic;

  Simple <: TPublic;

  TPublic =
    Filter.T OBJECT
    METHODS
      init (ch: VBT.T; north, west: REAL := 0.0; bg: PaintOp.T := PaintOp.Bg):
          TPublic;
      move (north, west: REAL);  <* LL = VBT.mu *>
    END;
The call v.init(ch) initializes v as an OffsetVBT with child ch. And the northwest corner of the parent is aligned at co-ordinate (north, west) mm in the child domain.

The call v.move(north, west) adjusts the co-ordinate system so that the vs northwest corner is positioned at co-ordinate (north, west) millimeters in the child domain. This offset will be maintained as v is reshaped or rescreened.

END OffsetVBT.

OffsetVBT's implementation is in:


opaque type OffsetVBT.T is in: