SAMPLE20.LST 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. Listing:
  2. 1 (******************************************************************************)
  3. 2 (* SAMPLE20.MOD *)
  4. 3 (* *)
  5. 4 (* PopUps Example *)
  6. 5 (* Taken from SAMPLE20.PAS - Metagraphics Software Corporation (c) 1987-1989 *)
  7. 6 (* *)
  8. 7 (* PSW 10/31/90 11:39pm *)
  9. 8 (******************************************************************************)
  10. 9
  11. 10 MODULE Sample20;
  12. 11 (*
  13. 12 * Graphix
  14. 13 * Release 3.7
  15. 14 * (c) Copyright 1986-1992 PMI
  16. 15 * Green Bay, Wisconsin
  17. 16 * (414) 468-6040
  18. 17 * All rights reserved
  19. 18 *
  20. 19 *)
  21. 20
  22. 21 IMPORT GrQry;
  23. 22 IMPORT GrConst;
  24. 23 IMPORT GrPorts;
  25. 24 IMPORT GrFonts;
  26. 25 IMPORT Meta;
  27. 26 IMPORT IO;
  28. 27 IMPORT Lib;
  29. 28
  30. 29 FROM GrConst IMPORT rect;
  31. ***** ^ duplicate identifier
  32. 30 FROM GrPorts IMPORT adsPort;
  33. ***** ^ duplicate identifier
  34. 31 FROM GrFonts IMPORT adsFont;
  35. ***** ^ duplicate identifier
  36. 32
  37. 33 (* standard memory allocation procedures *)
  38. 34 FROM Storage IMPORT ALLOCATE, DEALLOCATE, Available;
  39. 35
  40. 36 VAR
  41. 37 GrafixCard,
  42. 38 CommPort: INTEGER;
  43. 39 ch: CHAR;
  44. 40 scrnR,tR: GrConst.rect;
  45. ***** ^ not supported yet
  46. 41 imagePtr: GrConst.adsImage;
  47. ***** ^ not supported yet
  48. 42 i,j: INTEGER;
  49. 43 imBytes: CARDINAL;
  50. 44 memBytes: WORD;
  51. ***** ^ undeclared identifier
  52. 45 menuTitle: ARRAY [0..128] OF CHAR;
  53. ***** ^ not supported yet
  54. ***** ^ not supported yet
  55. 46
  56. 47
  57. 48 PROCEDURE OpenWindow(VAR R: rect; TITLE: ARRAY OF CHAR);
  58. ***** ^ not supported yet
  59. 49 VAR
  60. 50 tR:rect;
  61. 51 tsize: INTEGER;
  62. 52 tdescent: INTEGER;
  63. 53 scrnPort: adsPort;
  64. 54 txftptr: adsFont;
  65. 55 BEGIN
  66. 56
  67. 57 imBytes := VAL(CARDINAL, Meta.ImageSize(R));
  68. ***** ^ undeclared identifier
  69. ***** ^ not supported yet
  70. ***** ^ not supported yet
  71. ***** ^ not supported yet
  72. 58
  73. 59 IF NOT(Available(imBytes)) THEN
  74. ***** ^ not supported yet
  75. ***** ^ not supported yet
  76. 60 GrQry.GrQuit('Insufficient memory', 1);
  77. ***** ^ not supported yet
  78. ***** ^ not supported yet
  79. ***** ^ not supported yet
  80. ***** ^ not supported yet
  81. 61 END;
  82. 62
  83. 63 ALLOCATE(ADDRESS(imagePtr), imBytes );
  84. ***** ^ not supported yet
  85. ***** ^ undeclared identifier
  86. ***** ^ not supported yet
  87. ***** ^ not supported yet
  88. 64
  89. 65 Meta.ReadImage(R,imagePtr); (* Save the window area *)
  90. ***** ^ not supported yet
  91. ***** ^ not supported yet
  92. ***** ^ not supported yet
  93. ***** ^ not supported yet
  94. 66 Meta.FillRect(R,1); (* Clear the window *)
  95. ***** ^ not supported yet
  96. ***** ^ not supported yet
  97. ***** ^ not supported yet
  98. ***** ^ not supported yet
  99. 67 Meta.PenMode(GrConst.zXORz); (* Outline the window *)
  100. ***** ^ not supported yet
  101. ***** ^ not supported yet
  102. ***** ^ not supported yet
  103. ***** ^ not supported yet
  104. 68 Meta.FrameRect(R);
  105. ***** ^ not supported yet
  106. ***** ^ not supported yet
  107. ***** ^ not supported yet
  108. 69
  109. 70 Meta.GetPort( scrnPort ); (* get address of current port *)
  110. ***** ^ not supported yet
  111. ***** ^ not supported yet
  112. ***** ^ not supported yet
  113. 71
  114. 72 (* assign address of the current port's font record *)
  115. 73 txftptr := scrnPort^.txFont;
  116. ***** ^ not supported yet
  117. ***** ^ not supported yet
  118. ***** ^ not supported yet
  119. 74
  120. 75 (* get values of some font fields *)
  121. 76 tdescent := txftptr^.descent;
  122. ***** ^ not supported yet
  123. ***** ^ not supported yet
  124. 77 tsize := txftptr^.lnSpacing;
  125. ***** ^ not supported yet
  126. ***** ^ not supported yet
  127. 78
  128. 79 (* Display title block *)
  129. 80 Meta.SetRect(tR, R.Xmin,R.Ymin,R.Xmax,R.Ymin+tsize);
  130. ***** ^ not supported yet
  131. ***** ^ not supported yet
  132. ***** ^ not supported yet
  133. ***** ^ not supported yet
  134. ***** ^ not supported yet
  135. ***** ^ not supported yet
  136. ***** ^ not supported yet
  137. ***** ^ not supported yet
  138. ***** ^ not supported yet
  139. ***** ^ not supported yet
  140. ***** ^ not supported yet
  141. ***** ^ not supported yet
  142. 81 Meta.FillRect(tR,0);
  143. ***** ^ not supported yet
  144. ***** ^ not supported yet
  145. ***** ^ not supported yet
  146. ***** ^ not supported yet
  147. 82 Meta.MoveTo (tR.Xmin+5, tR.Ymax - tdescent );
  148. ***** ^ not supported yet
  149. ***** ^ not supported yet
  150. ***** ^ not supported yet
  151. ***** ^ not supported yet
  152. ***** ^ not supported yet
  153. ***** ^ not supported yet
  154. ***** ^ not supported yet
  155. 83 Meta.DrawString(TITLE)
  156. ***** ^ not supported yet
  157. ***** ^ not supported yet
  158. ***** ^ not supported yet
  159. 84 END OpenWindow;
  160. ***** ^ not supported yet
  161. 85
  162. 86 PROCEDURE CloseWindow(VAR R:rect);
  163. 87 BEGIN
  164. 88 Meta.RasterOp (GrConst.zREPz);
  165. ***** ^ not supported yet
  166. ***** ^ not supported yet
  167. ***** ^ not supported yet
  168. ***** ^ not supported yet
  169. 89 Meta.WriteImage (R, imagePtr); (* Restore the window area *)
  170. ***** ^ not supported yet
  171. ***** ^ not supported yet
  172. ***** ^ not supported yet
  173. ***** ^ not supported yet
  174. 90 DEALLOCATE(imagePtr, imBytes);
  175. ***** ^ not supported yet
  176. ***** ^ not supported yet
  177. ***** ^ not supported yet
  178. 91 END CloseWindow;
  179. ***** ^ not supported yet
  180. 92
  181. 93 BEGIN
  182. 94 (* init the system *)
  183. 95
  184. 96 GrQry.GrInit(GrafixCard, CommPort);
  185. ***** ^ not supported yet
  186. ***** ^ not supported yet
  187. ***** ^ not supported yet
  188. 97
  189. 98 i := Meta.InitGrafix(-GrafixCard);
  190. ***** ^ not supported yet
  191. ***** ^ not supported yet
  192. ***** ^ not supported yet
  193. 99 IF (i # 0) THEN
  194. 100 GrQry.GrInitErr(GrafixCard, CommPort, i)
  195. ***** ^ not supported yet
  196. ***** ^ not supported yet
  197. ***** ^ not supported yet
  198. 101 END;
  199. 102
  200. 103 Meta.SetDisplay(GrConst.GrafPg0);
  201. ***** ^ not supported yet
  202. ***** ^ not supported yet
  203. ***** ^ not supported yet
  204. ***** ^ not supported yet
  205. 104 Meta.ScreenRect(scrnR);
  206. ***** ^ not supported yet
  207. ***** ^ not supported yet
  208. ***** ^ not supported yet
  209. 105 Meta.FillRect(scrnR, 3);
  210. ***** ^ not supported yet
  211. ***** ^ not supported yet
  212. ***** ^ not supported yet
  213. ***** ^ not supported yet
  214. 106 Meta.SetRect(tR, 75, 75, 250, 150);
  215. ***** ^ not supported yet
  216. ***** ^ not supported yet
  217. ***** ^ not supported yet
  218. ***** ^ not supported yet
  219. 107
  220. 108 FOR j := 1 TO 3 DO
  221. 109 Meta.MoveTo(10,20);
  222. ***** ^ not supported yet
  223. ***** ^ not supported yet
  224. ***** ^ not supported yet
  225. 110 Meta.DrawString('Press a key to show menu ');
  226. ***** ^ not supported yet
  227. ***** ^ not supported yet
  228. ***** ^ not supported yet
  229. 111 ch := IO.RdKey(); (* Wait for a keypress *)
  230. ***** ^ not supported yet
  231. ***** ^ not supported yet
  232. ***** ^ not supported yet
  233. 112 menuTitle := 'Menu Title';
  234. ***** ^ not supported yet
  235. ***** ^ not supported yet
  236. 113 OpenWindow (tR, menuTitle);
  237. ***** ^ not supported yet
  238. ***** ^ not supported yet
  239. ***** ^ not supported yet
  240. 114
  241. 115 Meta.MoveTo(10,20);
  242. ***** ^ not supported yet
  243. ***** ^ not supported yet
  244. ***** ^ not supported yet
  245. 116 Meta.DrawString('Press a key to remove menu');
  246. ***** ^ not supported yet
  247. ***** ^ not supported yet
  248. ***** ^ not supported yet
  249. 117 ch := IO.RdKey(); (* Wait for a keypress *)
  250. ***** ^ not supported yet
  251. ***** ^ not supported yet
  252. ***** ^ not supported yet
  253. 118 CloseWindow(tR);
  254. ***** ^ not supported yet
  255. ***** ^ not supported yet
  256. 119 Meta.OffsetRect(tR, 150,20)
  257. ***** ^ not supported yet
  258. ***** ^ not supported yet
  259. ***** ^ not supported yet
  260. ***** ^ not supported yet
  261. 120 END;
  262. 121
  263. 122 Meta.MoveTo(10,20);
  264. ***** ^ not supported yet
  265. ***** ^ not supported yet
  266. ***** ^ not supported yet
  267. 123 Meta.DrawString('Press Return to terminate ');
  268. ***** ^ not supported yet
  269. ***** ^ not supported yet
  270. ***** ^ not supported yet
  271. 124 ch := IO.RdKey(); (* Wait for a keypress *)
  272. ***** ^ not supported yet
  273. ***** ^ not supported yet
  274. ***** ^ not supported yet
  275. 125
  276. 126 GrQry.GrQuit('', 0);
  277. ***** ^ not supported yet
  278. ***** ^ not supported yet
  279. ***** ^ not supported yet
  280. 127 END Sample20.
  281. 152 errors