GRFXDEMO.LST 62 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632
  1. Listing:
  2. 1 MODULE GrfxDemo;
  3. 2 (*
  4. 3 * Graphix
  5. 4 * Release 3.7
  6. 5 * (c) Copyright 1986-1992 PMI
  7. 6 * Green Bay, Wisconsin
  8. 7 * (414) 468-6040
  9. 8 * All rights reserved
  10. 9 *
  11. 10 *)
  12. 11
  13. 12 FROM Storage IMPORT ALLOCATE,DEALLOCATE;
  14. 13 IMPORT GrConst;
  15. 14 IMPORT Meta;
  16. 15 IMPORT GrFonts;
  17. 16 IMPORT GrPorts;
  18. 17 IMPORT GrQry;
  19. 18 IMPORT Terminal;
  20. 19 IMPORT Strings;
  21. 20 IMPORT Storage;
  22. ***** ^ duplicate identifier
  23. 21 IMPORT SYSTEM;
  24. 22
  25. 23
  26. 24 VAR
  27. 25 FontPtr: SYSTEM.ADDRESS;
  28. ***** ^ not supported yet
  29. 26 CommPort,GrafixCard:INTEGER;
  30. 27 BufSize: CARDINAL;
  31. 28
  32. 29 PROCEDURE Conclude(); FORWARD;
  33. 30
  34. 31
  35. 32 PROCEDURE WaitForKey();
  36. 33 VAR
  37. 34 LastKey : CHAR;
  38. 35 BEGIN
  39. 36 Terminal.Read(LastKey) ;
  40. ***** ^ not supported yet
  41. ***** ^ not supported yet
  42. ***** ^ not supported yet
  43. 37 IF CAP(LastKey) = 'Q' THEN
  44. ***** ^ undeclared identifier
  45. ***** ^ not supported yet
  46. 38 Conclude();
  47. ***** ^ not supported yet
  48. ***** ^ not supported yet
  49. 39 END;
  50. 40 END WaitForKey;
  51. ***** ^ not supported yet
  52. 41
  53. 42 PROCEDURE ClearGraphicsScreen();
  54. 43 VAR
  55. 44 scrnR : GrConst.rect;
  56. ***** ^ not supported yet
  57. 45 BEGIN
  58. 46 Meta.ScreenRect(scrnR);
  59. ***** ^ not supported yet
  60. ***** ^ not supported yet
  61. ***** ^ not supported yet
  62. 47 (* Get the screen limits *)
  63. 48 Meta.EraseRect(scrnR);
  64. ***** ^ not supported yet
  65. ***** ^ not supported yet
  66. ***** ^ not supported yet
  67. 49 (* Erase the screen *)
  68. 50 END ClearGraphicsScreen;
  69. ***** ^ not supported yet
  70. 51
  71. 52 (*
  72. 53 PROCEDURE FileLoad( FileName: ARRAY OF CHAR;
  73. 54 VAR DataAreaAdr: SYSTEM.ADDRESS; VAR BufSize:
  74. 55 CARDINAL ): Terminal.ErrorMessage;
  75. 56 VAR
  76. 57 Handle: CARDINAL;
  77. 58 name:ARRAY[0..79] OF CHAR;
  78. 59 Err: Terminal.ErrorMessage;
  79. 60 BEGIN
  80. 61 M2Strings.Assign(FileName,name);
  81. 62 Err:=HandleIO.FindFile(Handle,name, 'PATH');
  82. 63 IF Err= Terminal.NoError THEN
  83. 64 BufSize:=VAL(CARDINAL,HandleIO.FileLength(Handle));
  84. 65 Storage.ALLOCATE( DataAreaAdr, BufSize );
  85. 66 Err:=HandleIO.BlockRead(Handle, DataAreaAdr, BufSize);
  86. 67 IF Err # Terminal.NoError THEN
  87. 68 Err:=HandleIO.CloseHandle(Handle);
  88. 69 RETURN Err;
  89. 70 END;
  90. 71 ELSE
  91. 72 Conclude();
  92. 73 END;
  93. 74 RETURN Terminal.NoError;
  94. 75 END FileLoad;
  95. 76 *)
  96. 77
  97. 78 PROCEDURE Explain( msg: ARRAY OF CHAR );
  98. ***** ^ not supported yet
  99. 79 BEGIN
  100. 80 ClearGraphicsScreen;
  101. ***** ^ not supported yet
  102. 81 Meta.MoveTo( 20, 170 );
  103. ***** ^ not supported yet
  104. ***** ^ not supported yet
  105. ***** ^ not supported yet
  106. 82 Meta.DrawString( msg );
  107. ***** ^ not supported yet
  108. ***** ^ not supported yet
  109. ***** ^ not supported yet
  110. 83 Meta.MoveTo( 20, 190 );
  111. ***** ^ not supported yet
  112. ***** ^ not supported yet
  113. ***** ^ not supported yet
  114. 84 Meta.DrawString( 'Press any key to continue.');
  115. ***** ^ not supported yet
  116. ***** ^ not supported yet
  117. ***** ^ not supported yet
  118. 85 WaitForKey();
  119. ***** ^ not supported yet
  120. ***** ^ not supported yet
  121. 86 END Explain;
  122. ***** ^ not supported yet
  123. 87
  124. 88
  125. 89 PROCEDURE Sample01();
  126. 90 (* MoveTo/LineTo Example *)
  127. 91 BEGIN
  128. 92 Explain( 'First we draw a simple line.' );
  129. ***** ^ not supported yet
  130. ***** ^ not supported yet
  131. 93 Meta.MoveTo(50,50);
  132. ***** ^ not supported yet
  133. ***** ^ not supported yet
  134. ***** ^ not supported yet
  135. 94 (* draw a line from *)
  136. 95 Meta.LineTo(200,200);
  137. ***** ^ not supported yet
  138. ***** ^ not supported yet
  139. ***** ^ not supported yet
  140. 96 (* (50,50) to (200,200). *)
  141. 97 WaitForKey();
  142. ***** ^ not supported yet
  143. ***** ^ not supported yet
  144. 98 END Sample01;
  145. ***** ^ not supported yet
  146. 99
  147. 100
  148. 101 PROCEDURE Sample02();
  149. 102 (* MoveTo/LineTo Example *)
  150. 103 VAR
  151. 104 tR : GrConst.rect;
  152. ***** ^ not supported yet
  153. 105 tmpImage: ADDRESS;
  154. ***** ^ undeclared identifier
  155. 106 imPara, imBytes : CARDINAL;
  156. 107 BEGIN
  157. 108 Explain(
  158. ***** ^ not supported yet
  159. 109 'MetaWINDOW can read an image from the screen and display it elsewhere.');
  160. ***** ^ not supported yet
  161. 110 ClearGraphicsScreen();
  162. ***** ^ not supported yet
  163. ***** ^ not supported yet
  164. 111
  165. 112 Meta.MoveTo(50,50);
  166. ***** ^ not supported yet
  167. ***** ^ not supported yet
  168. ***** ^ not supported yet
  169. 113 Meta.DrawString('*Image*');
  170. ***** ^ not supported yet
  171. ***** ^ not supported yet
  172. ***** ^ not supported yet
  173. 114 Meta.SetRect(tR, 45,40,115,55);
  174. ***** ^ not supported yet
  175. ***** ^ not supported yet
  176. ***** ^ not supported yet
  177. ***** ^ not supported yet
  178. 115 Meta.FrameRect(tR);
  179. ***** ^ not supported yet
  180. ***** ^ not supported yet
  181. ***** ^ not supported yet
  182. 116 imPara := Meta.ImagePara(tR);
  183. ***** ^ not supported yet
  184. ***** ^ not supported yet
  185. ***** ^ not supported yet
  186. 117 IF (imPara > 2047) THEN
  187. 118 Terminal.WriteString('Image too large');
  188. ***** ^ not supported yet
  189. ***** ^ not supported yet
  190. ***** ^ not supported yet
  191. 119 RETURN;
  192. 120 END;
  193. 121 imBytes := imPara*16;
  194. 122 ALLOCATE(tmpImage,imBytes);
  195. ***** ^ not supported yet
  196. ***** ^ not supported yet
  197. ***** ^ not supported yet
  198. 123 Meta.ReadImage (tR, tmpImage);
  199. ***** ^ not supported yet
  200. ***** ^ not supported yet
  201. ***** ^ not supported yet
  202. ***** ^ not supported yet
  203. 124 (* Read the image *)
  204. 125 Meta.OffsetRect(tR,48,50);
  205. ***** ^ not supported yet
  206. ***** ^ not supported yet
  207. ***** ^ not supported yet
  208. ***** ^ not supported yet
  209. 126 (* Write it back at *)
  210. 127 Meta.WriteImage(tR, tmpImage);
  211. ***** ^ not supported yet
  212. ***** ^ not supported yet
  213. ***** ^ not supported yet
  214. ***** ^ not supported yet
  215. 128 (* a different location. *)
  216. 129 Meta.MoveTo( 20, 190);
  217. ***** ^ not supported yet
  218. ***** ^ not supported yet
  219. ***** ^ not supported yet
  220. 130 Meta.DrawString( 'Press any key to continue');
  221. ***** ^ not supported yet
  222. ***** ^ not supported yet
  223. ***** ^ not supported yet
  224. 131 DEALLOCATE(tmpImage,imBytes);
  225. ***** ^ not supported yet
  226. ***** ^ not supported yet
  227. ***** ^ not supported yet
  228. 132 WaitForKey();
  229. ***** ^ not supported yet
  230. ***** ^ not supported yet
  231. 133 END Sample02;
  232. ***** ^ not supported yet
  233. 134
  234. 135
  235. 136 PROCEDURE Sample03();
  236. 137
  237. 138 PROCEDURE LoadAndWrite( FileName: ARRAY OF CHAR; x, y: CARDINAL;
  238. ***** ^ not supported yet
  239. 139 message: ARRAY OF CHAR );
  240. ***** ^ not supported yet
  241. 140 VAR
  242. 141 BufSize: CARDINAL;
  243. 142 BEGIN
  244. 143 (* pfontrec := NIL;
  245. 144 Terminal.PrintMessage( FileLoad( FileName,
  246. 145 pfontrec,
  247. 146 BufSize ) );
  248. 147 Meta.SetFont( pfontrec ); *)
  249. 148 BufSize:=Meta.LoadFont(FileName);
  250. ***** ^ not supported yet
  251. ***** ^ not supported yet
  252. ***** ^ not supported yet
  253. 149 Meta.MoveTo( x, y );
  254. ***** ^ not supported yet
  255. ***** ^ not supported yet
  256. ***** ^ not supported yet
  257. 150 Meta.DrawString(message);
  258. ***** ^ not supported yet
  259. ***** ^ not supported yet
  260. ***** ^ not supported yet
  261. 151 END LoadAndWrite;
  262. ***** ^ not supported yet
  263. 152
  264. 153 BEGIN
  265. 154 Explain( 'MetaWINDOW supports a wide variety of fonts.' );
  266. ***** ^ not supported yet
  267. ***** ^ not supported yet
  268. 155
  269. 156 ClearGraphicsScreen();
  270. ***** ^ not supported yet
  271. ***** ^ not supported yet
  272. 157
  273. 158 Meta.TextSize(14,14);
  274. ***** ^ not supported yet
  275. ***** ^ not supported yet
  276. ***** ^ not supported yet
  277. 159 (* Set text size for stroked font, ROMANSIM.FNT *)
  278. 160 Meta.TextFace(GrConst.cProportional);
  279. ***** ^ not supported yet
  280. ***** ^ not supported yet
  281. ***** ^ not supported yet
  282. ***** ^ not supported yet
  283. 161
  284. 162 LoadAndWrite( 'SYSTEM01.FNT', 10, 50, 'Text output using SYSTEM01.FNT' );
  285. ***** ^ not supported yet
  286. ***** ^ not supported yet
  287. ***** ^ not supported yet
  288. 163 LoadAndWrite( 'SYSTEM08.FNT', 10, 60, 'Text output using SYSTEM08.FNT' );
  289. ***** ^ not supported yet
  290. ***** ^ not supported yet
  291. ***** ^ not supported yet
  292. 164 LoadAndWrite( 'SYSTEM11.FNT', 10, 80, 'SYSTEM11.FNT' );
  293. ***** ^ not supported yet
  294. ***** ^ not supported yet
  295. ***** ^ not supported yet
  296. 165 LoadAndWrite( 'SYSTEM16.FNT', 10,100, 'Text output using SYSTEM16.FNT' );
  297. ***** ^ not supported yet
  298. ***** ^ not supported yet
  299. ***** ^ not supported yet
  300. 166 LoadAndWrite( 'SYSTEM24.FNT', 10,130, 'Text output using SYSTEM24.FNT' );
  301. ***** ^ not supported yet
  302. ***** ^ not supported yet
  303. ***** ^ not supported yet
  304. 167 LoadAndWrite( 'SYSTEM32.FNT', 10,170, 'Text output using SYSTEM32.FNT' );
  305. ***** ^ not supported yet
  306. ***** ^ not supported yet
  307. ***** ^ not supported yet
  308. 168 LoadAndWrite( 'SYSTEM35.FNT', 10,210, 'SYSTEM35.FNT' );
  309. ***** ^ not supported yet
  310. ***** ^ not supported yet
  311. ***** ^ not supported yet
  312. 169 LoadAndWrite( 'SYSTEM48.FNT', 10,260, 'System48.Fnt' );
  313. ***** ^ not supported yet
  314. ***** ^ not supported yet
  315. ***** ^ not supported yet
  316. 170 LoadAndWrite( 'SYSTEM72.FNT', 10,320, 'System72.Fnt' );
  317. ***** ^ not supported yet
  318. ***** ^ not supported yet
  319. ***** ^ not supported yet
  320. 171 LoadAndWrite( 'ROMANSIM.FNT', 300,100, 'Text output using ROMANSIM.FNT' );
  321. ***** ^ not supported yet
  322. ***** ^ not supported yet
  323. ***** ^ not supported yet
  324. 172 LoadAndWrite( 'SYSTEM16.FNT', 300,320, 'Press any key to continue.' );
  325. ***** ^ not supported yet
  326. ***** ^ not supported yet
  327. ***** ^ not supported yet
  328. 173
  329. 174 WaitForKey();
  330. ***** ^ not supported yet
  331. ***** ^ not supported yet
  332. 175 END Sample03;
  333. ***** ^ not supported yet
  334. 176
  335. 177
  336. 178 PROCEDURE Sample05();
  337. 179 VAR
  338. 180 SrcBitMap(*, DstBitMap*): GrPorts.adsBMap;
  339. ***** ^ not supported yet
  340. 181 (* pointer to default bitmap *)
  341. 182 thePort: GrPorts.adsPort;
  342. ***** ^ not supported yet
  343. 183 (* pointer to default port *)
  344. 184 dstR, srcR : GrConst.rect;
  345. ***** ^ not supported yet
  346. 185 BEGIN
  347. 186 Explain( 'MetaWINDOW can even enlarge a graphic image.' );
  348. ***** ^ not supported yet
  349. ***** ^ not supported yet
  350. 187 ClearGraphicsScreen();
  351. ***** ^ not supported yet
  352. ***** ^ not supported yet
  353. 188
  354. 189 Meta.GetPort(thePort);
  355. ***** ^ not supported yet
  356. ***** ^ not supported yet
  357. ***** ^ not supported yet
  358. 190 (* Get default port address *)
  359. 191 SrcBitMap := thePort^.portBMap;
  360. ***** ^ not supported yet
  361. ***** ^ not supported yet
  362. ***** ^ not supported yet
  363. 192 (* Get default bmap address *)
  364. 193 Meta.MoveTo(50,50);
  365. ***** ^ not supported yet
  366. ***** ^ not supported yet
  367. ***** ^ not supported yet
  368. 194 Meta.DrawString('ZoomBits');
  369. ***** ^ not supported yet
  370. ***** ^ not supported yet
  371. ***** ^ not supported yet
  372. 195 Meta.SetRect(srcR, 45,40,115,55);
  373. ***** ^ not supported yet
  374. ***** ^ not supported yet
  375. ***** ^ not supported yet
  376. ***** ^ not supported yet
  377. 196 Meta.FrameRect(srcR);
  378. ***** ^ not supported yet
  379. ***** ^ not supported yet
  380. ***** ^ not supported yet
  381. 197 Meta.SetRect(dstR,50,100,595,195);
  382. ***** ^ not supported yet
  383. ***** ^ not supported yet
  384. ***** ^ not supported yet
  385. ***** ^ not supported yet
  386. 198 Meta.FrameRect(dstR);
  387. ***** ^ not supported yet
  388. ***** ^ not supported yet
  389. ***** ^ not supported yet
  390. 199 Meta.ZoomBits( SrcBitMap, SrcBitMap, srcR, dstR, dstR, 0 );
  391. ***** ^ not supported yet
  392. ***** ^ not supported yet
  393. ***** ^ not supported yet
  394. ***** ^ not supported yet
  395. ***** ^ not supported yet
  396. ***** ^ not supported yet
  397. ***** ^ not supported yet
  398. ***** ^ not supported yet
  399. 200
  400. 201 Meta.MoveTo( 20, 220 );
  401. ***** ^ not supported yet
  402. ***** ^ not supported yet
  403. ***** ^ not supported yet
  404. 202 Meta.DrawString( 'Press any key to continue');
  405. ***** ^ not supported yet
  406. ***** ^ not supported yet
  407. ***** ^ not supported yet
  408. 203
  409. 204 WaitForKey();
  410. ***** ^ not supported yet
  411. ***** ^ not supported yet
  412. 205 END Sample05;
  413. ***** ^ not supported yet
  414. 206
  415. 207
  416. 208 PROCEDURE Sample17();
  417. 209 BEGIN
  418. 210 Explain( "MetaWINDOW's fonts allow superscript and subscript." );
  419. ***** ^ not supported yet
  420. ***** ^ not supported yet
  421. 211 Meta.MoveTo (75,50);
  422. ***** ^ not supported yet
  423. ***** ^ not supported yet
  424. ***** ^ not supported yet
  425. 212 Meta.DrawString('MetaWINDOW');
  426. ***** ^ not supported yet
  427. ***** ^ not supported yet
  428. ***** ^ not supported yet
  429. 213 Meta.MoveTo (Meta.QueryX(),Meta.QueryY()-5);
  430. ***** ^ not supported yet
  431. ***** ^ not supported yet
  432. ***** ^ not supported yet
  433. ***** ^ not supported yet
  434. ***** ^ not supported yet
  435. ***** ^ not supported yet
  436. ***** ^ not supported yet
  437. ***** ^ not supported yet
  438. ***** ^ not supported yet
  439. 214 Meta.DrawString('tm');
  440. ***** ^ not supported yet
  441. ***** ^ not supported yet
  442. ***** ^ not supported yet
  443. 215 (* superscript 'tm' *)
  444. 216 WaitForKey();
  445. ***** ^ not supported yet
  446. ***** ^ not supported yet
  447. 217 END Sample17;
  448. ***** ^ not supported yet
  449. 218
  450. 219
  451. 220 PROCEDURE Sample20();
  452. 221
  453. 222 VAR
  454. 223 i,J, ImPara, ImBytes : INTEGER;
  455. 224 ImagePtr : ADDRESS;
  456. ***** ^ undeclared identifier
  457. 225 scrnR, tR : GrConst.rect;
  458. ***** ^ not supported yet
  459. 226
  460. 227 PROCEDURE OpenWindow(VAR R:GrConst.rect; Title:ARRAY OF CHAR);
  461. ***** ^ not supported yet
  462. ***** ^ not supported yet
  463. 228 VAR
  464. 229 LocalRect:GrConst.rect;
  465. ***** ^ not supported yet
  466. 230 BEGIN
  467. 231 ImPara := Meta.ImagePara(R);
  468. ***** ^ not supported yet
  469. ***** ^ not supported yet
  470. ***** ^ not supported yet
  471. 232 IF (ImPara > 2047) THEN
  472. 233 Meta.SetDisplay(GrConst.TextPg0);
  473. ***** ^ not supported yet
  474. ***** ^ not supported yet
  475. ***** ^ not supported yet
  476. ***** ^ not supported yet
  477. 234 Terminal.WriteString('Image too large');
  478. ***** ^ not supported yet
  479. ***** ^ not supported yet
  480. ***** ^ not supported yet
  481. 235 Terminal.WriteLn;
  482. ***** ^ not supported yet
  483. ***** ^ not supported yet
  484. 236 HALT;
  485. ***** ^ undeclared identifier
  486. 237 END;
  487. 238 ImBytes := ImPara*16;
  488. 239 IF NOT Storage.Available(ImBytes) THEN
  489. ***** ^ not supported yet
  490. ***** ^ not supported yet
  491. ***** ^ not supported yet
  492. 240 Meta.SetDisplay(GrConst.TextPg0);
  493. ***** ^ not supported yet
  494. ***** ^ not supported yet
  495. ***** ^ not supported yet
  496. ***** ^ not supported yet
  497. 241 Terminal.WriteString('Insufficient memory');
  498. ***** ^ not supported yet
  499. ***** ^ not supported yet
  500. ***** ^ not supported yet
  501. 242 Terminal.WriteLn;
  502. ***** ^ not supported yet
  503. ***** ^ not supported yet
  504. 243 HALT;
  505. ***** ^ undeclared identifier
  506. 244 END;
  507. 245 Storage.ALLOCATE(ImagePtr,ImBytes);
  508. ***** ^ not supported yet
  509. ***** ^ not supported yet
  510. ***** ^ not supported yet
  511. ***** ^ not supported yet
  512. 246 Meta.ReadImage(R,ImagePtr);
  513. ***** ^ not supported yet
  514. ***** ^ not supported yet
  515. ***** ^ not supported yet
  516. ***** ^ not supported yet
  517. 247 (* Save the window area *)
  518. 248 Meta.FillRect(R,1);
  519. ***** ^ not supported yet
  520. ***** ^ not supported yet
  521. ***** ^ not supported yet
  522. ***** ^ not supported yet
  523. 249 (* Clear the window *)
  524. 250 Meta.PenMode(GrConst.zNANDz);
  525. ***** ^ not supported yet
  526. ***** ^ not supported yet
  527. ***** ^ not supported yet
  528. ***** ^ not supported yet
  529. 251 (* Outline the window *)
  530. 252 Meta.FrameRect(R);
  531. ***** ^ not supported yet
  532. ***** ^ not supported yet
  533. ***** ^ not supported yet
  534. 253 Meta.SetRect(LocalRect, R.Xmin,R.Ymin,R.Xmax,R.Ymin+14);
  535. ***** ^ not supported yet
  536. ***** ^ not supported yet
  537. ***** ^ not supported yet
  538. ***** ^ not supported yet
  539. ***** ^ not supported yet
  540. ***** ^ not supported yet
  541. ***** ^ not supported yet
  542. ***** ^ not supported yet
  543. ***** ^ not supported yet
  544. ***** ^ not supported yet
  545. ***** ^ not supported yet
  546. ***** ^ not supported yet
  547. 254 Meta.FillRect(LocalRect,0);
  548. ***** ^ not supported yet
  549. ***** ^ not supported yet
  550. ***** ^ not supported yet
  551. ***** ^ not supported yet
  552. 255 (* Display title block *)
  553. 256 Meta.MoveTo(LocalRect.Xmin+5,LocalRect.Ymin+10);
  554. ***** ^ not supported yet
  555. ***** ^ not supported yet
  556. ***** ^ not supported yet
  557. ***** ^ not supported yet
  558. ***** ^ not supported yet
  559. ***** ^ not supported yet
  560. ***** ^ not supported yet
  561. 257 Meta.DrawString(Title);
  562. ***** ^ not supported yet
  563. ***** ^ not supported yet
  564. ***** ^ not supported yet
  565. 258 END OpenWindow;
  566. ***** ^ not supported yet
  567. 259
  568. 260 PROCEDURE CloseWindow(VAR R:GrConst.rect);
  569. ***** ^ not supported yet
  570. 261 BEGIN
  571. 262 Meta.RasterOp(GrConst.zREPz);
  572. ***** ^ not supported yet
  573. ***** ^ not supported yet
  574. ***** ^ not supported yet
  575. ***** ^ not supported yet
  576. 263 Meta.WriteImage(R,ImagePtr);
  577. ***** ^ not supported yet
  578. ***** ^ not supported yet
  579. ***** ^ not supported yet
  580. ***** ^ not supported yet
  581. 264 (* Restore the window area *)
  582. 265 Storage.DEALLOCATE(ImagePtr,ImBytes);
  583. ***** ^ not supported yet
  584. ***** ^ not supported yet
  585. ***** ^ not supported yet
  586. ***** ^ not supported yet
  587. 266 END CloseWindow;
  588. ***** ^ not supported yet
  589. 267
  590. 268 BEGIN
  591. 269 Explain(
  592. ***** ^ not supported yet
  593. 270 'MetaWINDOW makes it easy to create desktop-style applications.');
  594. ***** ^ not supported yet
  595. 271 Meta.ScreenRect(scrnR);
  596. ***** ^ not supported yet
  597. ***** ^ not supported yet
  598. ***** ^ not supported yet
  599. 272 (* Get the screen limits *)
  600. 273 Meta.FillRect(scrnR,3);
  601. ***** ^ not supported yet
  602. ***** ^ not supported yet
  603. ***** ^ not supported yet
  604. ***** ^ not supported yet
  605. 274 Meta.SetRect(tR, 75,75,250,150);
  606. ***** ^ not supported yet
  607. ***** ^ not supported yet
  608. ***** ^ not supported yet
  609. ***** ^ not supported yet
  610. 275 i:=( Meta.FileLoad( 'SYSTEM08.FNT', FontPtr, BufSize ) );
  611. ***** ^ not supported yet
  612. ***** ^ not supported yet
  613. ***** ^ not supported yet
  614. ***** ^ not supported yet
  615. ***** ^ not supported yet
  616. 276 IF i#0 THEN Conclude(); RETURN
  617. ***** ^ not supported yet
  618. ***** ^ not supported yet
  619. 277 END;
  620. 278 Meta.SetFont( FontPtr );
  621. ***** ^ not supported yet
  622. ***** ^ not supported yet
  623. ***** ^ not supported yet
  624. 279 FOR J:=1 TO 3 DO
  625. 280 Meta.MoveTo( 20, 190);
  626. ***** ^ not supported yet
  627. ***** ^ not supported yet
  628. ***** ^ not supported yet
  629. 281 Meta.DrawString( 'Press any key to show menu ');
  630. ***** ^ not supported yet
  631. ***** ^ not supported yet
  632. ***** ^ not supported yet
  633. 282 WaitForKey();
  634. ***** ^ not supported yet
  635. ***** ^ not supported yet
  636. 283 OpenWindow (tR,'Menu Title');
  637. ***** ^ not supported yet
  638. ***** ^ not supported yet
  639. ***** ^ not supported yet
  640. 284 Meta.MoveTo( 20, 190);
  641. ***** ^ not supported yet
  642. ***** ^ not supported yet
  643. ***** ^ not supported yet
  644. 285 Meta.DrawString( 'Press any key to remove menu');
  645. ***** ^ not supported yet
  646. ***** ^ not supported yet
  647. ***** ^ not supported yet
  648. 286 WaitForKey();
  649. ***** ^ not supported yet
  650. ***** ^ not supported yet
  651. 287 CloseWindow(tR);
  652. ***** ^ not supported yet
  653. ***** ^ not supported yet
  654. 288 Meta.OffsetRect(tR, 150,20)
  655. ***** ^ not supported yet
  656. ***** ^ not supported yet
  657. ***** ^ not supported yet
  658. ***** ^ not supported yet
  659. 289 END;
  660. 290 Meta.MoveTo( 20, 190);
  661. ***** ^ not supported yet
  662. ***** ^ not supported yet
  663. ***** ^ not supported yet
  664. 291 Meta.DrawString( 'Press any key to continue ');
  665. ***** ^ not supported yet
  666. ***** ^ not supported yet
  667. ***** ^ not supported yet
  668. 292 WaitForKey();
  669. ***** ^ not supported yet
  670. ***** ^ not supported yet
  671. 293 END Sample20;
  672. ***** ^ not supported yet
  673. 294
  674. 295
  675. 296 PROCEDURE Sample11();
  676. 297 VAR
  677. 298 X, Y, Button : INTEGER;
  678. 299 scrnR : GrConst.rect;
  679. ***** ^ not supported yet
  680. 300 BEGIN
  681. 301 ClearGraphicsScreen();
  682. ***** ^ not supported yet
  683. ***** ^ not supported yet
  684. 302 Terminal.WriteString(' Mouse-A-Sketch without tracking: ');
  685. ***** ^ not supported yet
  686. ***** ^ not supported yet
  687. ***** ^ not supported yet
  688. 303 Terminal.WriteLn;
  689. ***** ^ not supported yet
  690. ***** ^ not supported yet
  691. 304 Terminal.WriteString('- left mouse button draws lines,');
  692. ***** ^ not supported yet
  693. ***** ^ not supported yet
  694. ***** ^ not supported yet
  695. 305 Terminal.WriteLn;
  696. ***** ^ not supported yet
  697. ***** ^ not supported yet
  698. 306 Terminal.WriteString('- right mouse button erases screen,');
  699. ***** ^ not supported yet
  700. ***** ^ not supported yet
  701. ***** ^ not supported yet
  702. 307 Terminal.WriteLn;
  703. ***** ^ not supported yet
  704. ***** ^ not supported yet
  705. 308 Terminal.WriteString('- left & right together ends program.');
  706. ***** ^ not supported yet
  707. ***** ^ not supported yet
  708. ***** ^ not supported yet
  709. 309 Terminal.WriteLn;
  710. ***** ^ not supported yet
  711. ***** ^ not supported yet
  712. 310 Terminal.WriteString(' (Press any key to start) ');
  713. ***** ^ not supported yet
  714. ***** ^ not supported yet
  715. ***** ^ not supported yet
  716. 311 Terminal.WriteLn;
  717. ***** ^ not supported yet
  718. ***** ^ not supported yet
  719. 312 WaitForKey();
  720. ***** ^ not supported yet
  721. ***** ^ not supported yet
  722. 313 Meta.InitMouse(CommPort);
  723. ***** ^ not supported yet
  724. ***** ^ not supported yet
  725. ***** ^ not supported yet
  726. 314 Meta.ScaleMouse(24,16);
  727. ***** ^ not supported yet
  728. ***** ^ not supported yet
  729. ***** ^ not supported yet
  730. 315 Meta.ScreenRect(scrnR);
  731. ***** ^ not supported yet
  732. ***** ^ not supported yet
  733. ***** ^ not supported yet
  734. 316 (* Get the screen limits *)
  735. 317 Meta.EraseRect(scrnR);
  736. ***** ^ not supported yet
  737. ***** ^ not supported yet
  738. ***** ^ not supported yet
  739. 318 (* Erase the screen *)
  740. 319 Meta.FrameRect(scrnR);
  741. ***** ^ not supported yet
  742. ***** ^ not supported yet
  743. ***** ^ not supported yet
  744. 320 X:=100;
  745. 321 Y:=100;
  746. 322 Button:=0;
  747. 323
  748. 324 REPEAT
  749. 325 REPEAT
  750. 326 Meta.ReadMouse(X,Y,Button)
  751. ***** ^ not supported yet
  752. ***** ^ not supported yet
  753. ***** ^ not supported yet
  754. 327 UNTIL Button>=0;
  755. 328 IF Button=GrConst.swLeft THEN Meta.LineTo(X,Y)
  756. ***** ^ not supported yet
  757. ***** ^ not supported yet
  758. ***** ^ not supported yet
  759. ***** ^ not supported yet
  760. ***** ^ not supported yet
  761. 329 (* Draw line *)
  762. 330 ELSIF Button=GrConst.swRight THEN
  763. ***** ^ not supported yet
  764. ***** ^ not supported yet
  765. 331 Meta.EraseRect(scrnR);
  766. ***** ^ not supported yet
  767. ***** ^ not supported yet
  768. ***** ^ not supported yet
  769. 332 Meta.FrameRect(scrnR)
  770. ***** ^ not supported yet
  771. ***** ^ not supported yet
  772. ***** ^ not supported yet
  773. 333 ELSE Meta.MoveTo (X,Y) END;
  774. ***** ^ not supported yet
  775. ***** ^ not supported yet
  776. ***** ^ not supported yet
  777. 334 UNTIL Button=(GrConst.swLeft+GrConst.swRight);
  778. ***** ^ not supported yet
  779. ***** ^ not supported yet
  780. ***** ^ not supported yet
  781. ***** ^ not supported yet
  782. 335 Meta.StopMouse;
  783. ***** ^ not supported yet
  784. ***** ^ not supported yet
  785. 336
  786. 337 END Sample11;
  787. ***** ^ not supported yet
  788. 338
  789. 339
  790. 340 PROCEDURE Sample19();
  791. 341
  792. 342 VAR
  793. 343 X, Y, XOld, YOld, Switch : INTEGER;
  794. 344 scrnR : GrConst.rect;
  795. ***** ^ not supported yet
  796. 345
  797. 346 PROCEDURE DrawCursor (CX,CY:INTEGER);
  798. 347 BEGIN
  799. 348 Meta.RasterOp(GrConst.zXORz);
  800. ***** ^ not supported yet
  801. ***** ^ not supported yet
  802. ***** ^ not supported yet
  803. ***** ^ not supported yet
  804. 349 Meta.MoveTo (scrnR.Xmin,CY);
  805. ***** ^ not supported yet
  806. ***** ^ not supported yet
  807. ***** ^ not supported yet
  808. ***** ^ not supported yet
  809. ***** ^ not supported yet
  810. 350 Meta.LineTo (scrnR.Xmax,CY);
  811. ***** ^ not supported yet
  812. ***** ^ not supported yet
  813. ***** ^ not supported yet
  814. ***** ^ not supported yet
  815. ***** ^ not supported yet
  816. 351 Meta.MoveTo (CX,scrnR.Ymin);
  817. ***** ^ not supported yet
  818. ***** ^ not supported yet
  819. ***** ^ not supported yet
  820. ***** ^ not supported yet
  821. 352 Meta.LineTo (CX,scrnR.Ymax);
  822. ***** ^ not supported yet
  823. ***** ^ not supported yet
  824. ***** ^ not supported yet
  825. ***** ^ not supported yet
  826. 353 END DrawCursor;
  827. ***** ^ not supported yet
  828. 354
  829. 355 BEGIN
  830. 356 Meta.ScreenRect(scrnR);
  831. ***** ^ not supported yet
  832. ***** ^ not supported yet
  833. ***** ^ not supported yet
  834. 357 (* Get the screen limits *)
  835. 358 Meta.EraseRect(scrnR);
  836. ***** ^ not supported yet
  837. ***** ^ not supported yet
  838. ***** ^ not supported yet
  839. 359 (* Erase the screen *)
  840. 360 Meta.InitMouse(CommPort);
  841. ***** ^ not supported yet
  842. ***** ^ not supported yet
  843. ***** ^ not supported yet
  844. 361 X:=100; Y:=100; XOld:=100; YOld:=100;
  845. 362 DrawCursor(X,Y);
  846. ***** ^ not supported yet
  847. ***** ^ not supported yet
  848. 363 (* Put the cursor on the screen *)
  849. 364 REPEAT
  850. 365 REPEAT
  851. 366 Meta.ReadMouse(X,Y,Switch);
  852. ***** ^ not supported yet
  853. ***** ^ not supported yet
  854. ***** ^ not supported yet
  855. 367 UNTIL Switch>=0;
  856. 368 DrawCursor(XOld,YOld);
  857. ***** ^ not supported yet
  858. ***** ^ not supported yet
  859. 369 (* erase old cursor *)
  860. 370 DrawCursor(X,Y);
  861. ***** ^ not supported yet
  862. ***** ^ not supported yet
  863. 371 (* draw cursor in new position*)
  864. 372 XOld:=X;
  865. 373 YOld:=Y;
  866. 374 UNTIL Switch>0;
  867. 375 (* until switch is pressed *)
  868. 376 Meta.StopMouse;
  869. ***** ^ not supported yet
  870. ***** ^ not supported yet
  871. 377 END Sample19;
  872. ***** ^ not supported yet
  873. 378
  874. 379
  875. 380 PROCEDURE Sample21();
  876. 381 VAR
  877. 382 X, Y, Level, Button : INTEGER;
  878. 383 scrnR : GrConst.rect;
  879. ***** ^ not supported yet
  880. 384 BEGIN
  881. 385 Meta.ScreenRect(scrnR);
  882. ***** ^ not supported yet
  883. ***** ^ not supported yet
  884. ***** ^ not supported yet
  885. 386 (* Get the screen limits *)
  886. 387 Meta.EraseRect(scrnR);
  887. ***** ^ not supported yet
  888. ***** ^ not supported yet
  889. ***** ^ not supported yet
  890. 388 (* Erase the screen *)
  891. 389 Terminal.WriteString(' Mouse-A-Sketch with Auto-Tracking');
  892. ***** ^ not supported yet
  893. ***** ^ not supported yet
  894. ***** ^ not supported yet
  895. 390 Terminal.WriteLn;
  896. ***** ^ not supported yet
  897. ***** ^ not supported yet
  898. 391 Terminal.WriteString('- left mouse button draws lines,');
  899. ***** ^ not supported yet
  900. ***** ^ not supported yet
  901. ***** ^ not supported yet
  902. 392 Terminal.WriteLn;
  903. ***** ^ not supported yet
  904. ***** ^ not supported yet
  905. 393 Terminal.WriteString('- right mouse button erases screen,');
  906. ***** ^ not supported yet
  907. ***** ^ not supported yet
  908. ***** ^ not supported yet
  909. 394 Terminal.WriteLn;
  910. ***** ^ not supported yet
  911. ***** ^ not supported yet
  912. 395 Terminal.WriteString('- left & right together ends program.');
  913. ***** ^ not supported yet
  914. ***** ^ not supported yet
  915. ***** ^ not supported yet
  916. 396 Terminal.WriteLn;
  917. ***** ^ not supported yet
  918. ***** ^ not supported yet
  919. 397 Terminal.WriteString(' (Press any key to start) ');
  920. ***** ^ not supported yet
  921. ***** ^ not supported yet
  922. ***** ^ not supported yet
  923. 398 Terminal.WriteLn;
  924. ***** ^ not supported yet
  925. ***** ^ not supported yet
  926. 399 WaitForKey();
  927. ***** ^ not supported yet
  928. ***** ^ not supported yet
  929. 400 Meta.InitMouse(CommPort);
  930. ***** ^ not supported yet
  931. ***** ^ not supported yet
  932. ***** ^ not supported yet
  933. 401 Meta.ScaleMouse(24,16);
  934. ***** ^ not supported yet
  935. ***** ^ not supported yet
  936. ***** ^ not supported yet
  937. 402 Meta.EraseRect(scrnR);
  938. ***** ^ not supported yet
  939. ***** ^ not supported yet
  940. ***** ^ not supported yet
  941. 403 (* Erase the screen *)
  942. 404 Meta.FrameRect(scrnR);
  943. ***** ^ not supported yet
  944. ***** ^ not supported yet
  945. ***** ^ not supported yet
  946. 405 X:=100;
  947. 406 Y:=100;
  948. 407 Button:=0;
  949. 408 Meta.TrackCursor(TRUE);
  950. ***** ^ not supported yet
  951. ***** ^ not supported yet
  952. ***** ^ not supported yet
  953. 409 Meta.ShowCursor;
  954. ***** ^ not supported yet
  955. ***** ^ not supported yet
  956. 410 Meta.LimitMouse(scrnR.Xmin,scrnR.Ymin,scrnR.Xmax,scrnR.Ymax);
  957. ***** ^ not supported yet
  958. ***** ^ not supported yet
  959. ***** ^ not supported yet
  960. ***** ^ not supported yet
  961. ***** ^ not supported yet
  962. ***** ^ not supported yet
  963. ***** ^ not supported yet
  964. ***** ^ not supported yet
  965. ***** ^ not supported yet
  966. ***** ^ not supported yet
  967. 411 (* Keep mouse on screen *)
  968. 412 REPEAT
  969. 413 REPEAT
  970. 414 Meta.QueryCursor(X,Y,Level,Button);
  971. ***** ^ not supported yet
  972. ***** ^ not supported yet
  973. ***** ^ not supported yet
  974. 415 UNTIL Button>=0;
  975. 416 IF Button=GrConst.swLeft THEN
  976. ***** ^ not supported yet
  977. ***** ^ not supported yet
  978. 417 Meta.HideCursor;
  979. ***** ^ not supported yet
  980. ***** ^ not supported yet
  981. 418 Meta.LineTo(X,Y);
  982. ***** ^ not supported yet
  983. ***** ^ not supported yet
  984. ***** ^ not supported yet
  985. 419 Meta.ShowCursor;
  986. ***** ^ not supported yet
  987. ***** ^ not supported yet
  988. 420 ELSIF Button=GrConst.swRight THEN
  989. ***** ^ not supported yet
  990. ***** ^ not supported yet
  991. 421 Meta.HideCursor;
  992. ***** ^ not supported yet
  993. ***** ^ not supported yet
  994. 422 Meta.EraseRect(scrnR);
  995. ***** ^ not supported yet
  996. ***** ^ not supported yet
  997. ***** ^ not supported yet
  998. 423 Meta.FrameRect(scrnR);
  999. ***** ^ not supported yet
  1000. ***** ^ not supported yet
  1001. ***** ^ not supported yet
  1002. 424 Meta.ShowCursor;
  1003. ***** ^ not supported yet
  1004. ***** ^ not supported yet
  1005. 425 ELSE Meta.MoveTo(X,Y); END;
  1006. ***** ^ not supported yet
  1007. ***** ^ not supported yet
  1008. ***** ^ not supported yet
  1009. 426 UNTIL Button=(GrConst.swLeft+GrConst.swRight);
  1010. ***** ^ not supported yet
  1011. ***** ^ not supported yet
  1012. ***** ^ not supported yet
  1013. ***** ^ not supported yet
  1014. 427 Meta.ProtectRect(scrnR);
  1015. ***** ^ not supported yet
  1016. ***** ^ not supported yet
  1017. ***** ^ not supported yet
  1018. 428 Meta.MoveTo(10,20);
  1019. ***** ^ not supported yet
  1020. ***** ^ not supported yet
  1021. ***** ^ not supported yet
  1022. 429 Meta.DrawString( ' AUTO-CURSOR TRACKING');
  1023. ***** ^ not supported yet
  1024. ***** ^ not supported yet
  1025. ***** ^ not supported yet
  1026. 430 Meta.MoveTo(10,35);
  1027. ***** ^ not supported yet
  1028. ***** ^ not supported yet
  1029. ***** ^ not supported yet
  1030. 431 Meta.DrawString( 'Notice how the cursor continues to track');
  1031. ***** ^ not supported yet
  1032. ***** ^ not supported yet
  1033. ***** ^ not supported yet
  1034. 432 Meta.MoveTo(10,50);
  1035. ***** ^ not supported yet
  1036. ***** ^ not supported yet
  1037. ***** ^ not supported yet
  1038. 433 Meta.DrawString( 'even while off computing or awaiting input.');
  1039. ***** ^ not supported yet
  1040. ***** ^ not supported yet
  1041. ***** ^ not supported yet
  1042. 434 Meta.MoveTo(10,65);
  1043. ***** ^ not supported yet
  1044. ***** ^ not supported yet
  1045. ***** ^ not supported yet
  1046. 435 Meta.DrawString( ' (Press any key to continue)');
  1047. ***** ^ not supported yet
  1048. ***** ^ not supported yet
  1049. ***** ^ not supported yet
  1050. 436 Meta.ProtectOff;
  1051. ***** ^ not supported yet
  1052. ***** ^ not supported yet
  1053. 437 WaitForKey();
  1054. ***** ^ not supported yet
  1055. ***** ^ not supported yet
  1056. 438 Meta.StopMouse;
  1057. ***** ^ not supported yet
  1058. ***** ^ not supported yet
  1059. 439 END Sample21;
  1060. ***** ^ not supported yet
  1061. 440
  1062. 441 PROCEDURE Sample22;
  1063. 442 VAR
  1064. 443 X, XOld, Y, YOld, Button : INTEGER;
  1065. 444 scrnR : GrConst.rect;
  1066. ***** ^ not supported yet
  1067. 445 BEGIN
  1068. 446 Meta.InitMouse(CommPort);
  1069. ***** ^ not supported yet
  1070. ***** ^ not supported yet
  1071. ***** ^ not supported yet
  1072. 447 Meta.ScaleMouse(24,16);
  1073. ***** ^ not supported yet
  1074. ***** ^ not supported yet
  1075. ***** ^ not supported yet
  1076. 448 Meta.ScreenRect(scrnR);
  1077. ***** ^ not supported yet
  1078. ***** ^ not supported yet
  1079. ***** ^ not supported yet
  1080. 449 (* Get the screen limits *)
  1081. 450 Meta.EraseRect(scrnR);
  1082. ***** ^ not supported yet
  1083. ***** ^ not supported yet
  1084. ***** ^ not supported yet
  1085. 451 (* Erase the screen *)
  1086. 452 Meta.FrameRect(scrnR);
  1087. ***** ^ not supported yet
  1088. ***** ^ not supported yet
  1089. ***** ^ not supported yet
  1090. 453 Meta.PenMode(GrConst.zXORz);
  1091. ***** ^ not supported yet
  1092. ***** ^ not supported yet
  1093. ***** ^ not supported yet
  1094. ***** ^ not supported yet
  1095. 454 X:=100;
  1096. 455 Y:=100;
  1097. 456 XOld:=100;
  1098. 457 YOld:=100;
  1099. 458 Meta.MoveTo(100,100);
  1100. ***** ^ not supported yet
  1101. ***** ^ not supported yet
  1102. ***** ^ not supported yet
  1103. 459 Meta.LineTo(X,Y);
  1104. ***** ^ not supported yet
  1105. ***** ^ not supported yet
  1106. ***** ^ not supported yet
  1107. 460 Meta.LineTo(500,100);
  1108. ***** ^ not supported yet
  1109. ***** ^ not supported yet
  1110. ***** ^ not supported yet
  1111. 461 Meta.MoveCursor(X,Y);
  1112. ***** ^ not supported yet
  1113. ***** ^ not supported yet
  1114. ***** ^ not supported yet
  1115. 462 Meta.ShowCursor;
  1116. ***** ^ not supported yet
  1117. ***** ^ not supported yet
  1118. 463 REPEAT
  1119. 464 REPEAT
  1120. 465 Meta.ReadMouse(X,Y,Button);
  1121. ***** ^ not supported yet
  1122. ***** ^ not supported yet
  1123. ***** ^ not supported yet
  1124. 466 UNTIL Button>=0;
  1125. 467 Meta.HideCursor;
  1126. ***** ^ not supported yet
  1127. ***** ^ not supported yet
  1128. 468 Meta.MoveTo(100,100);
  1129. ***** ^ not supported yet
  1130. ***** ^ not supported yet
  1131. ***** ^ not supported yet
  1132. 469 Meta.LineTo(XOld,YOld);
  1133. ***** ^ not supported yet
  1134. ***** ^ not supported yet
  1135. ***** ^ not supported yet
  1136. 470 Meta.LineTo(500,100);
  1137. ***** ^ not supported yet
  1138. ***** ^ not supported yet
  1139. ***** ^ not supported yet
  1140. 471 Meta.MoveTo(100,100);
  1141. ***** ^ not supported yet
  1142. ***** ^ not supported yet
  1143. ***** ^ not supported yet
  1144. 472 Meta.LineTo(X,Y);
  1145. ***** ^ not supported yet
  1146. ***** ^ not supported yet
  1147. ***** ^ not supported yet
  1148. 473 Meta.LineTo(500,100);
  1149. ***** ^ not supported yet
  1150. ***** ^ not supported yet
  1151. ***** ^ not supported yet
  1152. 474 Meta.MoveCursor(X,Y);
  1153. ***** ^ not supported yet
  1154. ***** ^ not supported yet
  1155. ***** ^ not supported yet
  1156. 475 Meta.ShowCursor;
  1157. ***** ^ not supported yet
  1158. ***** ^ not supported yet
  1159. 476 XOld:=X; YOld:=Y;
  1160. 477 UNTIL Button=GrConst.swLeft;
  1161. ***** ^ not supported yet
  1162. ***** ^ not supported yet
  1163. 478 WaitForKey();
  1164. ***** ^ not supported yet
  1165. ***** ^ not supported yet
  1166. 479 Meta.StopMouse;
  1167. ***** ^ not supported yet
  1168. ***** ^ not supported yet
  1169. 480 END Sample22;
  1170. ***** ^ not supported yet
  1171. 481
  1172. 482
  1173. 483 PROCEDURE Hilbert();
  1174. 484
  1175. 485 VAR
  1176. 486 penColr : CARDINAL;
  1177. 487 vR: GrConst.rect;
  1178. ***** ^ not supported yet
  1179. 488 x, y, x0, y0, h, h0, ox, oy, i : INTEGER;
  1180. 489 ch : CHAR;
  1181. 490
  1182. 491 PROCEDURE Plt();
  1183. 492 BEGIN
  1184. 493 Meta.MoveTo(ox, oy);
  1185. ***** ^ not supported yet
  1186. ***** ^ not supported yet
  1187. ***** ^ not supported yet
  1188. 494 Meta.LineTo(x, y);
  1189. ***** ^ not supported yet
  1190. ***** ^ not supported yet
  1191. ***** ^ not supported yet
  1192. 495 penColr := (penColr+1) MOD 15;
  1193. 496 Meta.PenColor(penColr);
  1194. ***** ^ not supported yet
  1195. ***** ^ not supported yet
  1196. ***** ^ not supported yet
  1197. 497 ox := x;
  1198. 498 oy := y;
  1199. 499 END Plt;
  1200. ***** ^ not supported yet
  1201. 500
  1202. 501
  1203. 502 PROCEDURE b(i : INTEGER); FORWARD;
  1204. 503 PROCEDURE c(i : INTEGER); FORWARD;
  1205. 504 PROCEDURE d(i : INTEGER); FORWARD;
  1206. 505
  1207. 506
  1208. 507
  1209. 508 PROCEDURE a(i : INTEGER);
  1210. 509 BEGIN
  1211. 510 IF i>0 THEN
  1212. 511 d(i-1);
  1213. ***** ^ not supported yet
  1214. ***** ^ not supported yet
  1215. 512 DEC(x, CARDINAL(h));
  1216. ***** ^ undeclared identifier
  1217. ***** ^ not supported yet
  1218. 513 Plt();
  1219. ***** ^ not supported yet
  1220. ***** ^ not supported yet
  1221. 514 a(i-1);
  1222. ***** ^ not supported yet
  1223. ***** ^ not supported yet
  1224. 515 DEC(y, CARDINAL(h));
  1225. ***** ^ undeclared identifier
  1226. ***** ^ not supported yet
  1227. 516 Plt();
  1228. ***** ^ not supported yet
  1229. ***** ^ not supported yet
  1230. 517 a(i-1);
  1231. ***** ^ not supported yet
  1232. ***** ^ not supported yet
  1233. 518 INC(x, CARDINAL(h));
  1234. ***** ^ undeclared identifier
  1235. ***** ^ not supported yet
  1236. 519 Plt();
  1237. ***** ^ not supported yet
  1238. ***** ^ not supported yet
  1239. 520 b(i-1);
  1240. ***** ^ not supported yet
  1241. ***** ^ not supported yet
  1242. 521 END;
  1243. 522 END a;
  1244. ***** ^ not supported yet
  1245. 523
  1246. 524 PROCEDURE b(i : INTEGER);
  1247. 525 BEGIN
  1248. 526 IF i>0 THEN
  1249. 527 c(i-1);
  1250. ***** ^ not supported yet
  1251. ***** ^ not supported yet
  1252. 528 INC(y, CARDINAL(h));
  1253. ***** ^ undeclared identifier
  1254. ***** ^ not supported yet
  1255. 529 Plt();
  1256. ***** ^ not supported yet
  1257. ***** ^ not supported yet
  1258. 530 b(i-1);
  1259. ***** ^ not supported yet
  1260. ***** ^ not supported yet
  1261. 531 INC(x, CARDINAL(h));
  1262. ***** ^ undeclared identifier
  1263. ***** ^ not supported yet
  1264. 532 Plt();
  1265. ***** ^ not supported yet
  1266. ***** ^ not supported yet
  1267. 533 b(i-1);
  1268. ***** ^ not supported yet
  1269. ***** ^ not supported yet
  1270. 534 DEC(y, CARDINAL(h));
  1271. ***** ^ undeclared identifier
  1272. ***** ^ not supported yet
  1273. 535 Plt();
  1274. ***** ^ not supported yet
  1275. ***** ^ not supported yet
  1276. 536 a(i-1);
  1277. ***** ^ not supported yet
  1278. ***** ^ not supported yet
  1279. 537 END;
  1280. 538 END b;
  1281. ***** ^ not supported yet
  1282. 539
  1283. 540 PROCEDURE c(i : INTEGER);
  1284. 541 BEGIN
  1285. 542 IF i>0 THEN
  1286. 543 b(i-1);
  1287. ***** ^ not supported yet
  1288. ***** ^ not supported yet
  1289. 544 INC(x, CARDINAL(h));
  1290. ***** ^ undeclared identifier
  1291. ***** ^ not supported yet
  1292. 545 Plt();
  1293. ***** ^ not supported yet
  1294. ***** ^ not supported yet
  1295. 546 c(i-1);
  1296. ***** ^ not supported yet
  1297. ***** ^ not supported yet
  1298. 547 INC(y, CARDINAL(h));
  1299. ***** ^ undeclared identifier
  1300. ***** ^ not supported yet
  1301. 548 Plt();
  1302. ***** ^ not supported yet
  1303. ***** ^ not supported yet
  1304. 549 c(i-1);
  1305. ***** ^ not supported yet
  1306. ***** ^ not supported yet
  1307. 550 DEC(x, CARDINAL(h));
  1308. ***** ^ undeclared identifier
  1309. ***** ^ not supported yet
  1310. 551 Plt();
  1311. ***** ^ not supported yet
  1312. ***** ^ not supported yet
  1313. 552 d(i-1);
  1314. ***** ^ not supported yet
  1315. ***** ^ not supported yet
  1316. 553 END;
  1317. 554 END c;
  1318. ***** ^ not supported yet
  1319. 555
  1320. 556 PROCEDURE d(i : INTEGER);
  1321. 557 BEGIN
  1322. 558 IF i>0 THEN
  1323. 559 a(i-1);
  1324. ***** ^ not supported yet
  1325. ***** ^ not supported yet
  1326. 560 DEC(y, CARDINAL(h));
  1327. ***** ^ undeclared identifier
  1328. ***** ^ not supported yet
  1329. 561 Plt();
  1330. ***** ^ not supported yet
  1331. ***** ^ not supported yet
  1332. 562 d(i-1);
  1333. ***** ^ not supported yet
  1334. ***** ^ not supported yet
  1335. 563 DEC(x, CARDINAL(h));
  1336. ***** ^ undeclared identifier
  1337. ***** ^ not supported yet
  1338. 564 Plt();
  1339. ***** ^ not supported yet
  1340. ***** ^ not supported yet
  1341. 565 d(i-1);
  1342. ***** ^ not supported yet
  1343. ***** ^ not supported yet
  1344. 566 INC(y, CARDINAL(h));
  1345. ***** ^ undeclared identifier
  1346. ***** ^ not supported yet
  1347. 567 Plt();
  1348. ***** ^ not supported yet
  1349. ***** ^ not supported yet
  1350. 568 c(i-1);
  1351. ***** ^ not supported yet
  1352. ***** ^ not supported yet
  1353. 569 END;
  1354. 570 END d;
  1355. ***** ^ not supported yet
  1356. 571
  1357. 572 BEGIN
  1358. 573 ClearGraphicsScreen();
  1359. ***** ^ not supported yet
  1360. ***** ^ not supported yet
  1361. 574 Meta.SetRect(vR, 0, 0, 256, 256);
  1362. ***** ^ not supported yet
  1363. ***** ^ not supported yet
  1364. ***** ^ not supported yet
  1365. ***** ^ not supported yet
  1366. 575 Meta.VirtualRect(vR);
  1367. ***** ^ not supported yet
  1368. ***** ^ not supported yet
  1369. ***** ^ not supported yet
  1370. 576 h0 := 256;
  1371. 577 i := 0;
  1372. 578 h := h0;
  1373. 579 x0 := h DIV 2;
  1374. 580 y0 := x0;
  1375. 581 REPEAT
  1376. 582 INC(i);
  1377. ***** ^ undeclared identifier
  1378. ***** ^ not supported yet
  1379. 583 h := h DIV 2;
  1380. 584 INC(x0, CARDINAL(h DIV 2));
  1381. ***** ^ undeclared identifier
  1382. ***** ^ not supported yet
  1383. 585 INC(y0, CARDINAL(h DIV 2));
  1384. ***** ^ undeclared identifier
  1385. ***** ^ not supported yet
  1386. 586 x := x0;
  1387. 587 y := y0;
  1388. 588 ox := x0;
  1389. 589 oy := y0;
  1390. 590 a(i);
  1391. ***** ^ not supported yet
  1392. ***** ^ not supported yet
  1393. 591 UNTIL (h<8);
  1394. 592 WaitForKey();
  1395. ***** ^ not supported yet
  1396. ***** ^ not supported yet
  1397. 593 END Hilbert;
  1398. ***** ^ not supported yet
  1399. 594
  1400. 595
  1401. 596 PROCEDURE Conclude();
  1402. 597 BEGIN
  1403. 598 Hilbert();
  1404. ***** ^ not supported yet
  1405. ***** ^ not supported yet
  1406. 599 Meta.SetDisplay(GrConst.TextPg0);
  1407. ***** ^ not supported yet
  1408. ***** ^ not supported yet
  1409. ***** ^ not supported yet
  1410. ***** ^ not supported yet
  1411. 600 (* Switch to alpha mode *)
  1412. 601 Meta.ClearText();
  1413. ***** ^ not supported yet
  1414. ***** ^ not supported yet
  1415. ***** ^ not supported yet
  1416. 602 (* Clear the text screen *)
  1417. 603 (*
  1418. 604 MetaErrStatus.WriteErrorStatus();
  1419. 605 *)
  1420. 606 Terminal.WriteLn;
  1421. ***** ^ not supported yet
  1422. ***** ^ not supported yet
  1423. 607 Terminal.WriteLn;
  1424. ***** ^ not supported yet
  1425. ***** ^ not supported yet
  1426. 608 Terminal.WriteString(
  1427. ***** ^ not supported yet
  1428. ***** ^ not supported yet
  1429. 609 'The Modula-2 interface to MetaWINDOW is available exclusively from' );
  1430. ***** ^ not supported yet
  1431. 610 Terminal.WriteLn;
  1432. ***** ^ not supported yet
  1433. ***** ^ not supported yet
  1434. 611 Terminal.WriteLn;
  1435. ***** ^ not supported yet
  1436. ***** ^ not supported yet
  1437. 612 Terminal.WriteLn;
  1438. ***** ^ not supported yet
  1439. ***** ^ not supported yet
  1440. 613 Terminal.WriteString(' PMI');
  1441. ***** ^ not supported yet
  1442. ***** ^ not supported yet
  1443. ***** ^ not supported yet
  1444. 614 Terminal.WriteLn;
  1445. ***** ^ not supported yet
  1446. ***** ^ not supported yet
  1447. 615 Terminal.WriteString( ' 3279 North Nicolet Drive' );
  1448. ***** ^ not supported yet
  1449. ***** ^ not supported yet
  1450. ***** ^ not supported yet
  1451. 616 Terminal.WriteLn;
  1452. ***** ^ not supported yet
  1453. ***** ^ not supported yet
  1454. 617 Terminal.WriteString( ' Green Bay WI 54311' );
  1455. ***** ^ not supported yet
  1456. ***** ^ not supported yet
  1457. ***** ^ not supported yet
  1458. 618 Terminal.WriteLn;
  1459. ***** ^ not supported yet
  1460. ***** ^ not supported yet
  1461. 619 Terminal.WriteLn;
  1462. ***** ^ not supported yet
  1463. ***** ^ not supported yet
  1464. 620 Terminal.WriteLn;
  1465. ***** ^ not supported yet
  1466. ***** ^ not supported yet
  1467. 621 Terminal.WriteString( ' P.O. Box 8402' );
  1468. ***** ^ not supported yet
  1469. ***** ^ not supported yet
  1470. ***** ^ not supported yet
  1471. 622 Terminal.WriteLn;
  1472. ***** ^ not supported yet
  1473. ***** ^ not supported yet
  1474. 623 Terminal.WriteString( ' Green Bay WI 54308' );
  1475. ***** ^ not supported yet
  1476. ***** ^ not supported yet
  1477. ***** ^ not supported yet
  1478. 624 Terminal.WriteLn;
  1479. ***** ^ not supported yet
  1480. ***** ^ not supported yet
  1481. 625 Terminal.WriteLn;
  1482. ***** ^ not supported yet
  1483. ***** ^ not supported yet
  1484. 626 Terminal.WriteLn;
  1485. ***** ^ not supported yet
  1486. ***** ^ not supported yet
  1487. 627 Terminal.WriteString( ' tel: (414) 468-6040' );
  1488. ***** ^ not supported yet
  1489. ***** ^ not supported yet
  1490. ***** ^ not supported yet
  1491. 628 Terminal.WriteLn;
  1492. ***** ^ not supported yet
  1493. ***** ^ not supported yet
  1494. 629 Terminal.WriteString( ' fax: (414) 465-0464' );
  1495. ***** ^ not supported yet
  1496. ***** ^ not supported yet
  1497. ***** ^ not supported yet
  1498. 630 Terminal.WriteLn;
  1499. ***** ^ not supported yet
  1500. ***** ^ not supported yet
  1501. 631 Terminal.WriteLn;
  1502. ***** ^ not supported yet
  1503. ***** ^ not supported yet
  1504. 632 Terminal.WriteLn;
  1505. ***** ^ not supported yet
  1506. ***** ^ not supported yet
  1507. 633 WaitForKey();
  1508. ***** ^ not supported yet
  1509. ***** ^ not supported yet
  1510. 634 Meta.ClearText();
  1511. ***** ^ not supported yet
  1512. ***** ^ not supported yet
  1513. ***** ^ not supported yet
  1514. 635 HALT;
  1515. ***** ^ undeclared identifier
  1516. 636 END Conclude;
  1517. ***** ^ not supported yet
  1518. 637
  1519. 638
  1520. 639 VAR
  1521. 640 MouseFound: BOOLEAN;
  1522. 641 tmpc: INTEGER;
  1523. 642 i,argc: CARDINAL;
  1524. 643
  1525. 644
  1526. 645 BEGIN
  1527. 646 GrQry.GrQuery(GrafixCard, CommPort);
  1528. ***** ^ not supported yet
  1529. ***** ^ not supported yet
  1530. ***** ^ not supported yet
  1531. 647
  1532. 648 i := Meta.InitGrafix(-GrafixCard);
  1533. ***** ^ not supported yet
  1534. ***** ^ not supported yet
  1535. ***** ^ not supported yet
  1536. 649
  1537. 650 IF (i # 0) THEN
  1538. 651 (* Display reason for no go *)
  1539. 652 GrQry.GrInitErr(GrafixCard, CommPort, i);
  1540. ***** ^ not supported yet
  1541. ***** ^ not supported yet
  1542. ***** ^ not supported yet
  1543. 653 END;
  1544. 654
  1545. 655 MouseFound := CommPort = GrConst.MsDriver;
  1546. ***** ^ not supported yet
  1547. ***** ^ not supported yet
  1548. 656
  1549. 657 (* Have MetaWINDOW figure out what the Grphics card and mouse
  1550. 658 * driver are. Global GrQry.GrafixCard and GrQry.CommPort variables will
  1551. 659 * be updated as side-effects.
  1552. 660 *)
  1553. 661 IF GrafixCard=0 THEN
  1554. 662 (* MetaWINDOW not installed *)
  1555. 663 RETURN;
  1556. ***** ^ bad RETURN
  1557. 664 END;
  1558. 665
  1559. 666 Meta.SetDisplay(GrConst.GrafPg0);
  1560. ***** ^ not supported yet
  1561. ***** ^ not supported yet
  1562. ***** ^ not supported yet
  1563. ***** ^ not supported yet
  1564. 667 (* Switch to graphics page 0 *)
  1565. 668 tmpc:=Meta.LoadFont('SYSTEM16.FNT');
  1566. ***** ^ not supported yet
  1567. ***** ^ not supported yet
  1568. ***** ^ not supported yet
  1569. 669 (* Terminal.PrintMessage( FileLoad( 'SYSTEM16.FNT', FontPtr, BufSize ) );
  1570. 670 (* MetaWINDOW tries to load this font file by default, but it's
  1571. 671 not very smart about where to look for it. FileLoad is smarter,
  1572. 672 so we open it explicitly. *)
  1573. 673 Meta.SetFont( FontPtr );
  1574. 674 *)
  1575. 675 Explain(
  1576. ***** ^ not supported yet
  1577. 676 "A brief demonstration of MetaWINDOW graphics for JPI's TopSpeed Modula-2." );
  1578. ***** ^ not supported yet
  1579. 677
  1580. 678 Sample01();
  1581. ***** ^ not supported yet
  1582. ***** ^ not supported yet
  1583. 679
  1584. 680 Sample02();
  1585. ***** ^ not supported yet
  1586. ***** ^ not supported yet
  1587. 681 Sample03();
  1588. ***** ^ not supported yet
  1589. ***** ^ not supported yet
  1590. 682 Sample17();
  1591. ***** ^ not supported yet
  1592. ***** ^ not supported yet
  1593. 683 Sample05();
  1594. ***** ^ not supported yet
  1595. ***** ^ not supported yet
  1596. 684 Sample20();
  1597. ***** ^ not supported yet
  1598. ***** ^ not supported yet
  1599. 685
  1600. 686 (*Rest of GrfxDemo requires a mouse.*)
  1601. 687
  1602. 688 IF MouseFound THEN
  1603. 689 Explain(
  1604. ***** ^ not supported yet
  1605. 690 'Remainder of demo requires a mouse. Press Q if mouse not installed.' );
  1606. ***** ^ not supported yet
  1607. 691 Sample11();
  1608. ***** ^ not supported yet
  1609. ***** ^ not supported yet
  1610. 692 Sample19();
  1611. ***** ^ not supported yet
  1612. ***** ^ not supported yet
  1613. 693 Sample21();
  1614. ***** ^ not supported yet
  1615. ***** ^ not supported yet
  1616. 694 Sample22();
  1617. ***** ^ not supported yet
  1618. ***** ^ not supported yet
  1619. 695 ELSE
  1620. 696 Explain( 'Remainder of demo requires a mouse. No mouse located.' );
  1621. ***** ^ not supported yet
  1622. ***** ^ not supported yet
  1623. 697 END;
  1624. 698 Conclude();
  1625. ***** ^ not supported yet
  1626. ***** ^ not supported yet
  1627. 699 END GrfxDemo.
  1628. 927 errors