Listing: 1 (******************************************************************************) 2 (* SAMPLE20.MOD *) 3 (* *) 4 (* PopUps Example *) 5 (* Taken from SAMPLE20.PAS - Metagraphics Software Corporation (c) 1987-1989 *) 6 (* *) 7 (* PSW 10/31/90 11:39pm *) 8 (******************************************************************************) 9 10 MODULE Sample20; 11 (* 12 * Graphix 13 * Release 3.7 14 * (c) Copyright 1986-1992 PMI 15 * Green Bay, Wisconsin 16 * (414) 468-6040 17 * All rights reserved 18 * 19 *) 20 21 IMPORT GrQry; 22 IMPORT GrConst; 23 IMPORT GrPorts; 24 IMPORT GrFonts; 25 IMPORT Meta; 26 IMPORT IO; 27 IMPORT Lib; 28 29 FROM GrConst IMPORT rect; ***** ^ duplicate identifier 30 FROM GrPorts IMPORT adsPort; ***** ^ duplicate identifier 31 FROM GrFonts IMPORT adsFont; ***** ^ duplicate identifier 32 33 (* standard memory allocation procedures *) 34 FROM Storage IMPORT ALLOCATE, DEALLOCATE, Available; 35 36 VAR 37 GrafixCard, 38 CommPort: INTEGER; 39 ch: CHAR; 40 scrnR,tR: GrConst.rect; ***** ^ not supported yet 41 imagePtr: GrConst.adsImage; ***** ^ not supported yet 42 i,j: INTEGER; 43 imBytes: CARDINAL; 44 memBytes: WORD; ***** ^ undeclared identifier 45 menuTitle: ARRAY [0..128] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 46 47 48 PROCEDURE OpenWindow(VAR R: rect; TITLE: ARRAY OF CHAR); ***** ^ not supported yet 49 VAR 50 tR:rect; 51 tsize: INTEGER; 52 tdescent: INTEGER; 53 scrnPort: adsPort; 54 txftptr: adsFont; 55 BEGIN 56 57 imBytes := VAL(CARDINAL, Meta.ImageSize(R)); ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 58 59 IF NOT(Available(imBytes)) THEN ***** ^ not supported yet ***** ^ not supported yet 60 GrQry.GrQuit('Insufficient memory', 1); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 61 END; 62 63 ALLOCATE(ADDRESS(imagePtr), imBytes ); ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 64 65 Meta.ReadImage(R,imagePtr); (* Save the window area *) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 66 Meta.FillRect(R,1); (* Clear the window *) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 67 Meta.PenMode(GrConst.zXORz); (* Outline the window *) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 68 Meta.FrameRect(R); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 69 70 Meta.GetPort( scrnPort ); (* get address of current port *) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 71 72 (* assign address of the current port's font record *) 73 txftptr := scrnPort^.txFont; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 74 75 (* get values of some font fields *) 76 tdescent := txftptr^.descent; ***** ^ not supported yet ***** ^ not supported yet 77 tsize := txftptr^.lnSpacing; ***** ^ not supported yet ***** ^ not supported yet 78 79 (* Display title block *) 80 Meta.SetRect(tR, R.Xmin,R.Ymin,R.Xmax,R.Ymin+tsize); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 81 Meta.FillRect(tR,0); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 82 Meta.MoveTo (tR.Xmin+5, tR.Ymax - tdescent ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 83 Meta.DrawString(TITLE) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 84 END OpenWindow; ***** ^ not supported yet 85 86 PROCEDURE CloseWindow(VAR R:rect); 87 BEGIN 88 Meta.RasterOp (GrConst.zREPz); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 89 Meta.WriteImage (R, imagePtr); (* Restore the window area *) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 90 DEALLOCATE(imagePtr, imBytes); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 91 END CloseWindow; ***** ^ not supported yet 92 93 BEGIN 94 (* init the system *) 95 96 GrQry.GrInit(GrafixCard, CommPort); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 97 98 i := Meta.InitGrafix(-GrafixCard); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 99 IF (i # 0) THEN 100 GrQry.GrInitErr(GrafixCard, CommPort, i) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 101 END; 102 103 Meta.SetDisplay(GrConst.GrafPg0); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 104 Meta.ScreenRect(scrnR); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 105 Meta.FillRect(scrnR, 3); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 106 Meta.SetRect(tR, 75, 75, 250, 150); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 107 108 FOR j := 1 TO 3 DO 109 Meta.MoveTo(10,20); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 110 Meta.DrawString('Press a key to show menu '); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 111 ch := IO.RdKey(); (* Wait for a keypress *) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 112 menuTitle := 'Menu Title'; ***** ^ not supported yet ***** ^ not supported yet 113 OpenWindow (tR, menuTitle); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 114 115 Meta.MoveTo(10,20); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 116 Meta.DrawString('Press a key to remove menu'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 117 ch := IO.RdKey(); (* Wait for a keypress *) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 118 CloseWindow(tR); ***** ^ not supported yet ***** ^ not supported yet 119 Meta.OffsetRect(tR, 150,20) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 120 END; 121 122 Meta.MoveTo(10,20); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 123 Meta.DrawString('Press Return to terminate '); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 124 ch := IO.RdKey(); (* Wait for a keypress *) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 125 126 GrQry.GrQuit('', 0); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 127 END Sample20. 152 errors