IMPORTS MonitorToolTemp, MessageWindow, Graphics, UserExec, ViewerOps, WindowManager
Start:
PROC [type:
INTEGER ← 525] = {
SELECT type
FROM
525 => MonitorToolTemp.StartMonitor[640,480,30,1,100,1200];
768 => MonitorToolTemp.StartMonitor[1024,768,35,1,60,850];
ENDCASE => MessageWindow.Append[message: "Unknown Monitor Type", clearFirst: TRUE];
ViewerOps.PaintViewer[viewer: grid, hint: all];
};
PaintPattern: ViewerClasses.PaintProc =
TRUSTED {
PaintProc: TYPE = PROC [self: Viewer, context: Graphics.Context, whatChanged: REF ANY, clear: BOOL]
DrawPattern:
PROC [context: Graphics.Context, hMin, hStep, hMax, hThick, vMin, vStep, vMax, vThick:
REAL] = {
Graphics.SetColor[context, GraphicsColor.black];
Graphics.DrawBox[context, Graphics.GetBounds[context]];
Graphics.SetColor[context, GraphicsColor.white];
FOR h:
REAL ← hMin, h+hStep
UNTIL h > hMax
DO
Graphics.DrawBox[self: context, box: [h, vMin, h+hThick, vMax]];
ENDLOOP;
FOR v:
REAL ← vMin, v+vStep
UNTIL v > vMax
DO
Graphics.DrawBox[self: context, box: [hMin, v, hMax, v+vThick]];
ENDLOOP;
};
bbox: Graphics.Box ← context.GetBounds[];
DrawPattern[context: context, hMin: bbox.xmin, hStep: 25, hMax: bbox.xmax, hThick: 2, vMin: bbox.ymin, vStep: 25, vMax: bbox.ymax, vThick: 2];
};