File: ObjectEditJaM.mesa
Written by: John Warnock
Last Updated by Michael Plass: March 28, 1983 2:13 pm
Last Updated by Maureen Stone March 28, 1983 2:54 pm
DIRECTORY
Graphics USING [Context, Save, Restore, WorldToUser, UserToWorld, SetPaintMode, SetColor, DrawBox, black, white],
JaMFnsDefs USING [GetReal, Register],
TJaMGraphics USING [Painter];
ObjectEditJaM: PROGRAM IMPORTS Graphics, JaMFnsDefs, TJaMGraphics =
{OPEN Graphics;
DotToken: PUBLIC PROC= {
x, y, xd, yd, xl1, yl1, xl2, yl2, xu1, yu1, xu2, yu2: REAL;
Paint: PROC [dc: Context] = {
[xd, yd] ← UserToWorld[dc, x, y];
[xl1, yl1] ← WorldToUser[dc, xd-3, yd-3];
[xl2, yl2] ← WorldToUser[dc, xd-2, yd-2];
[xu1, yu1] ← WorldToUser[dc, xd+3, yd+3];
[xu2, yu2] ← WorldToUser[dc, xd+2, yd+2];
[] ← Save[dc];
[] ← SetPaintMode[dc, opaque];
SetColor[dc, black];
DrawBox[dc, [xmax: xu1, ymax: yu1, xmin: xl1, ymin: yl1]];
SetColor[dc, white];
DrawBox[dc, [xmax: xu2, ymax: yu2, xmin: xl2, ymin: yl2]];
Restore[dc];
};
y ← JaMFnsDefs.GetReal[];
x ← JaMFnsDefs.GetReal[];
TJaMGraphics.Painter[Paint];
};
JaMFnsDefs.Register[".dottoken", DotToken];
}.