PrintTiogaSelection:
PUBLIC
PROC [
x, y: NAT, color: Color, context: Context ← NIL, screenStyle: BOOL ← FALSE]
RETURNS [error: ROPE] ~ {
c: Context ~
IF context =
NIL
THEN ColorTrixBasics.InitCd[smooth, TRUE, FALSE, FALSE] ELSE context;
bounds: Imager.Rectangle ← ImagerBackdoor.GetBounds[c];
formattedNode: TiogaImager.FormattedNodes;
reader: TiogaAccess.Reader ~ TiogaAccess.FromSelection[];
location: TextNode.Location ~ [NARROW[TiogaAccess.GetNodeRefs[reader].current], 0];
IF location.node = NIL THEN RETURN["Bad Text"];
IF color = NIL THEN color ← ImagerBackdoor.GetColor[context];
formattedNode ← TiogaImager.FormatNodes[location, [bounds.w, bounds.h], screenStyle];
Imager.SetColor[c, color];
TiogaImager.Render[formattedNode.box, c, [x, bounds.h-y]];
};
PrintRope:
PUBLIC
PROC [rope:
ROPE, x, y:
NAT, color: Color, context: Context ←
NIL] ~ {
IF context = NIL THEN context ← ColorTrixBasics.InitCd[smooth, TRUE, FALSE, FALSE];
IF color # NIL THEN Imager.SetColor[context, color];
Draw2d.Label[context, [x, Real.RoundI[ImagerBackdoor.GetBounds[context].h]-y], rope];
};