<*PRAGMA LL*>A
PixmapVBT.T
is a VBT that displays a pixmap.
The minimum size of a PixmapVBT
is just large enough to display
its pixmap (surrounded by any margins that were supplied when the
PixmapVBT
was created). Its preferred size is the same as its
minimum size, and its maximum size is very large.
INTERFACEThe callPixmapVBT ; IMPORT VBT, PaintOp, Pixmap; TYPE T <: Public; Public = VBT.Leaf OBJECT METHODS <* LL.sup <= VBT.mu *> init (pm: Pixmap.T; halign, valign: REAL := 0.5; hmargin, vmargin: REAL := 0.0; op: PaintOp.T := PaintOp.BgFg; bg: PaintOp.T := PaintOp.Bg): T END;
v.init(...)
initializes v
as a PixmapVBT
displaying
pixmap pm
using the paint op op
, and returns v
.
If halign = 0.0
, the west boundary of the pixmap will be indented
by the given hmargin
(in millimeters) from the west boundary of
the VBT
; if halign = 1.0
, the east boundary of the pixmap will
be inside the east boundary of the VBT
by the given hmargin
;
for other values of halign
, the horizontal position of the text
is computed by linear interpolation. In particular, halign = 0.5
centers the pixmap horizontally. The vertical position is determined
by vmargin
and valign
in a similar way.
If the domain of v
is larger than the pixmap, the background is
painted using the tint bg
.
When the pixmap has depth 1, op
should be a pair of tints.
Otherwise, a good choice for op
is PaintOp.Copy
.
PROCEDURE Put (v: T; pm: Pixmap.T); <* LL.sup = VBT.mu *>
Change the pixmap displayed byv
topm
, and markv
for redisplay.
PROCEDURE SetColors (v : T; op: PaintOp.T; bg: PaintOp.T := PaintOp.Bg); <* LL.sup = VBT.mu *>
Change theop
andbg
ofv
, and markv
for redisplay.
END PixmapVBT.