MENULIB.LST 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905
  1. Listing:
  2. 1 (* Release 3.10 *)
  3. 2 (*-------------------------------------------------------------------------*
  4. 3 * *
  5. 4 * MENULIB.MOD - COMMS Toolkit menu support *
  6. 5 * *
  7. 6 * COPYRIGHT (C) 1988..1992 Clarion Software Corporation. *
  8. 7 * All Rights Reserved *
  9. 8 * *
  10. 9 *--------------------------------------------------------------------------*)
  11. 10
  12. 11 IMPLEMENTATION MODULE MenuLib;
  13. 12 IMPORT IO,Lib,Window;
  14. 13 FROM Window IMPORT Color;
  15. ***** ^ duplicate identifier
  16. 14
  17. 15 CONST
  18. 16 MenuFrame = Window.FrameStr('Õ͸³³Ô;');
  19. ***** ^ not supported yet
  20. ***** ^ not supported yet
  21. ***** ^ not supported yet
  22. 17 MenuTemplate = Window.WinDef(0,0,0,0,White,Black,FALSE,FALSE,FALSE,TRUE,MenuFrame,LightGray,Black);
  23. ***** ^ not supported yet
  24. ***** ^ not supported yet
  25. ***** ^ undeclared identifier
  26. ***** ^ undeclared identifier
  27. ***** ^ undeclared identifier
  28. ***** ^ undeclared identifier
  29. 18
  30. 19 TYPE
  31. 20 switch = (on,off);
  32. 21 FuncKeys = (NotRecognised,Escape,Cup,Cdown,Cleft,Cright,PageUp,PageDown,FKey1,AltKey);
  33. 22
  34. 23 VAR
  35. 24 gotcha : BOOLEAN;
  36. 25 FuncKeyTyped : FuncKeys;
  37. ***** ^ not supported yet
  38. 26
  39. 27 (*......................................*)
  40. 28
  41. 29 PROCEDURE SetColor(NewColor:SHORTCARD);
  42. 30 BEGIN
  43. 31 Window.TextColor(VAL(Window.Color,NewColor MOD 16));
  44. ***** ^ not supported yet
  45. ***** ^ not supported yet
  46. ***** ^ undeclared identifier
  47. ***** ^ not supported yet
  48. ***** ^ not supported yet
  49. ***** ^ not supported yet
  50. 32 Window.TextBackground(VAL(Window.Color,NewColor DIV 16));
  51. ***** ^ not supported yet
  52. ***** ^ not supported yet
  53. ***** ^ undeclared identifier
  54. ***** ^ not supported yet
  55. ***** ^ not supported yet
  56. ***** ^ not supported yet
  57. 33 END SetColor;
  58. ***** ^ not supported yet
  59. 34
  60. 35 (*.............................................*)
  61. 36
  62. 37 PROCEDURE Read(VAR c:CHAR);
  63. 38 BEGIN
  64. 39 FuncKeyTyped := NotRecognised;
  65. ***** ^ not supported yet
  66. ***** ^ not supported yet
  67. 40 c := IO.RdKey();
  68. ***** ^ not supported yet
  69. ***** ^ not supported yet
  70. ***** ^ not supported yet
  71. 41 IF (c=CHR(27)) OR (c=0C) THEN
  72. ***** ^ undeclared identifier
  73. ***** ^ not supported yet
  74. 42 IF c=0C THEN
  75. 43 c := IO.RdKey();
  76. ***** ^ not supported yet
  77. ***** ^ not supported yet
  78. ***** ^ not supported yet
  79. 44 CASE ORD(c) OF
  80. ***** ^ undeclared identifier
  81. ***** ^ not supported yet
  82. 45 72 : FuncKeyTyped:=Cup; |
  83. ***** ^ not supported yet
  84. ***** ^ not supported yet
  85. 46 80 : FuncKeyTyped:=Cdown; |
  86. ***** ^ not supported yet
  87. ***** ^ not supported yet
  88. 47 75 : FuncKeyTyped:=Cleft; |
  89. ***** ^ not supported yet
  90. ***** ^ not supported yet
  91. 48 77 : FuncKeyTyped:=Cright; |
  92. ***** ^ not supported yet
  93. ***** ^ not supported yet
  94. 49 73 : FuncKeyTyped:=PageUp; |
  95. ***** ^ not supported yet
  96. ***** ^ not supported yet
  97. 50 81 : FuncKeyTyped:=PageDown;|
  98. ***** ^ not supported yet
  99. ***** ^ not supported yet
  100. 51 59 : FuncKeyTyped:=FKey1; |
  101. ***** ^ not supported yet
  102. ***** ^ not supported yet
  103. 52 ELSE
  104. 53 FuncKeyTyped := AltKey;
  105. ***** ^ not supported yet
  106. ***** ^ not supported yet
  107. 54 END
  108. 55 ELSE
  109. 56 FuncKeyTyped := Escape
  110. ***** ^ not supported yet
  111. ***** ^ not supported yet
  112. 57 END;
  113. 58 END;
  114. 59 END Read;
  115. ***** ^ not supported yet
  116. 60
  117. 61 (*........................................*)
  118. 62
  119. 63 PROCEDURE DeAltify(VAR Ch:CHAR);
  120. 64 VAR
  121. 65 c : CARDINAL;
  122. 66 Numrow,Qrow,Arow,
  123. 67 Zrow : ARRAY[0..11] OF CHAR;
  124. ***** ^ not supported yet
  125. ***** ^ not supported yet
  126. 68 BEGIN
  127. 69 Numrow:='1234567890-=';
  128. ***** ^ not supported yet
  129. ***** ^ not supported yet
  130. 70 Qrow:='QWERTYUIOP';
  131. ***** ^ not supported yet
  132. ***** ^ not supported yet
  133. 71 Arow:='ASDFGHJKL';
  134. ***** ^ not supported yet
  135. ***** ^ not supported yet
  136. 72 Zrow:='ZXCVBNM';
  137. ***** ^ not supported yet
  138. ***** ^ not supported yet
  139. 73 IF FuncKeyTyped=AltKey THEN
  140. ***** ^ not supported yet
  141. ***** ^ not supported yet
  142. 74 c := ORD(Ch);
  143. ***** ^ undeclared identifier
  144. ***** ^ not supported yet
  145. 75 IF (c>=120) AND (c<=131) THEN
  146. 76 Ch := Numrow[c-120]
  147. ***** ^ not supported yet
  148. ***** ^ not supported yet
  149. 77 ELSIF (c>=16) AND (c<=25) THEN
  150. 78 Ch := Qrow[c-16]
  151. ***** ^ not supported yet
  152. ***** ^ not supported yet
  153. 79 ELSIF (c>=30) AND (c<=38) THEN
  154. 80 Ch := Arow[c-30]
  155. ***** ^ not supported yet
  156. ***** ^ not supported yet
  157. 81 ELSIF (c>=44) AND (c<=50) THEN
  158. 82 Ch := Zrow[c-44]
  159. ***** ^ not supported yet
  160. ***** ^ not supported yet
  161. 83 END;
  162. 84 FuncKeyTyped := NotRecognised;
  163. ***** ^ not supported yet
  164. ***** ^ not supported yet
  165. 85 ELSE
  166. 86 Ch := CAP(Ch)
  167. ***** ^ undeclared identifier
  168. ***** ^ not supported yet
  169. 87 END;
  170. 88 END DeAltify;
  171. ***** ^ not supported yet
  172. 89
  173. 90 (*..................................................*)
  174. 91
  175. 92 PROCEDURE InitMenu(VAR menu:MenuRec;menutitle:ARRAY OF CHAR;MenuX,MenuY,menuwidth:CARDINAL);
  176. ***** ^ undeclared identifier
  177. ***** ^ not supported yet
  178. 93 VAR
  179. 94 i,Lnth : CARDINAL;
  180. 95 BEGIN
  181. 96 menu.MenuX:=MenuX;
  182. ***** ^ not supported yet
  183. ***** ^ not supported yet
  184. 97 menu.MenuY:=MenuY;
  185. ***** ^ not supported yet
  186. ***** ^ not supported yet
  187. 98 WITH menu DO
  188. ***** ^ not supported yet
  189. 99 Lnth := Lib.ScanR(ADR(menutitle),HIGH(menutitle)+1,0C);
  190. ***** ^ not supported yet
  191. ***** ^ not supported yet
  192. ***** ^ undeclared identifier
  193. ***** ^ not supported yet
  194. ***** ^ undeclared identifier
  195. ***** ^ not supported yet
  196. ***** ^ not supported yet
  197. 100 IF Lnth>menuwidth THEN
  198. 101 Lnth:=menuwidth;
  199. 102 END;
  200. 103 Lib.Move(ADR(menutitle),ADR(Title),Lnth+1);
  201. ***** ^ not supported yet
  202. ***** ^ not supported yet
  203. ***** ^ undeclared identifier
  204. ***** ^ not supported yet
  205. ***** ^ undeclared identifier
  206. ***** ^ undeclared identifier
  207. ***** ^ not supported yet
  208. 104 Width:=menuwidth;
  209. ***** ^ undeclared identifier
  210. 105 Normal := SHORTCARD(MenuColors.NormFore)+SHORTCARD(MenuColors.NormBack)*16;
  211. ***** ^ undeclared identifier
  212. ***** ^ undeclared identifier
  213. ***** ^ not supported yet
  214. ***** ^ undeclared identifier
  215. ***** ^ not supported yet
  216. 106 Selected := SHORTCARD(MenuColors.SelFore)+SHORTCARD(MenuColors.SelBack)*16;
  217. ***** ^ undeclared identifier
  218. ***** ^ undeclared identifier
  219. ***** ^ not supported yet
  220. ***** ^ undeclared identifier
  221. ***** ^ not supported yet
  222. 107 Highlite := SHORTCARD(MenuColors.HighFore)+SHORTCARD(MenuColors.HighBack)*16;
  223. ***** ^ undeclared identifier
  224. ***** ^ undeclared identifier
  225. ***** ^ not supported yet
  226. ***** ^ undeclared identifier
  227. ***** ^ not supported yet
  228. 108 SHighlite := SHORTCARD(MenuColors.HSelFore)+SHORTCARD(MenuColors.HSelBack)*16;
  229. ***** ^ undeclared identifier
  230. ***** ^ undeclared identifier
  231. ***** ^ not supported yet
  232. ***** ^ undeclared identifier
  233. ***** ^ not supported yet
  234. 109 EscapeOK := FALSE;
  235. ***** ^ undeclared identifier
  236. 110 ExitOnChar := FALSE;
  237. ***** ^ undeclared identifier
  238. 111 HelpOK := FALSE;
  239. ***** ^ undeclared identifier
  240. 112 PageKeysOK := FALSE;
  241. ***** ^ undeclared identifier
  242. 113 ExitSideWays := FALSE;
  243. ***** ^ undeclared identifier
  244. 114 IF Width>30 THEN
  245. ***** ^ undeclared identifier
  246. 115 Width:=30;
  247. ***** ^ undeclared identifier
  248. 116 END;
  249. 117 Selection:=0;
  250. ***** ^ undeclared identifier
  251. 118 NumUsed:=0;
  252. ***** ^ undeclared identifier
  253. 119 winptr:=NIL;
  254. ***** ^ undeclared identifier
  255. 120 END;
  256. ***** ^ not supported yet
  257. 121 END InitMenu;
  258. ***** ^ not supported yet
  259. 122
  260. 123 (*......................................*)
  261. 124
  262. 125 PROCEDURE AddOption(VAR menu:MenuRec; menutext:ARRAY OF CHAR);
  263. ***** ^ undeclared identifier
  264. ***** ^ not supported yet
  265. 126 VAR
  266. 127 curlen : CARDINAL;
  267. 128 BEGIN
  268. 129 WITH menu DO
  269. ***** ^ not supported yet
  270. 130 IF NumUsed<=MaxOption THEN
  271. ***** ^ undeclared identifier
  272. ***** ^ undeclared identifier
  273. 131 WITH Option[NumUsed] DO
  274. ***** ^ undeclared identifier
  275. ***** ^ undeclared identifier
  276. 132 curlen := Lib.ScanR(ADR(menutext),HIGH(menutext)+1,0C);
  277. ***** ^ not supported yet
  278. ***** ^ not supported yet
  279. ***** ^ undeclared identifier
  280. ***** ^ not supported yet
  281. ***** ^ undeclared identifier
  282. ***** ^ not supported yet
  283. ***** ^ not supported yet
  284. 133 IF curlen>Width THEN
  285. ***** ^ undeclared identifier
  286. 134 curlen:=Width;
  287. ***** ^ undeclared identifier
  288. 135 END;
  289. 136 Lib.Move(ADR(menutext),ADR(Name),curlen+1);
  290. ***** ^ not supported yet
  291. ***** ^ not supported yet
  292. ***** ^ undeclared identifier
  293. ***** ^ not supported yet
  294. ***** ^ undeclared identifier
  295. ***** ^ undeclared identifier
  296. ***** ^ not supported yet
  297. 137 Lib.Fill(ADR(Name[curlen]),Width-curlen,' ');
  298. ***** ^ not supported yet
  299. ***** ^ not supported yet
  300. ***** ^ undeclared identifier
  301. ***** ^ undeclared identifier
  302. ***** ^ not supported yet
  303. ***** ^ undeclared identifier
  304. ***** ^ not supported yet
  305. 138 FirstNonSpace := Lib.ScanNeR(ADR(Name),Width,' ');
  306. ***** ^ undeclared identifier
  307. ***** ^ not supported yet
  308. ***** ^ not supported yet
  309. ***** ^ undeclared identifier
  310. ***** ^ undeclared identifier
  311. ***** ^ undeclared identifier
  312. ***** ^ not supported yet
  313. 139 IF FirstNonSpace # Width THEN
  314. ***** ^ undeclared identifier
  315. ***** ^ undeclared identifier
  316. 140 Name[FirstNonSpace] := CAP(Name[FirstNonSpace]);
  317. ***** ^ undeclared identifier
  318. ***** ^ undeclared identifier
  319. ***** ^ undeclared identifier
  320. ***** ^ undeclared identifier
  321. ***** ^ undeclared identifier
  322. 141 END;
  323. 142 END;
  324. ***** ^ not supported yet
  325. 143 INC(NumUsed);
  326. ***** ^ undeclared identifier
  327. ***** ^ undeclared identifier
  328. 144 END
  329. 145 END;
  330. ***** ^ not supported yet
  331. 146 END AddOption;
  332. ***** ^ not supported yet
  333. 147
  334. 148 (*......................................*)
  335. 149
  336. 150 PROCEDURE KillMenu(VAR menu:MenuRec);
  337. ***** ^ undeclared identifier
  338. 151 BEGIN
  339. 152 IF menu.winptr <> NIL THEN
  340. ***** ^ not supported yet
  341. ***** ^ not supported yet
  342. 153 Window.Close(menu.winptr);
  343. ***** ^ not supported yet
  344. ***** ^ not supported yet
  345. ***** ^ not supported yet
  346. ***** ^ not supported yet
  347. 154 menu.winptr:=NIL;
  348. ***** ^ not supported yet
  349. ***** ^ not supported yet
  350. 155 END;
  351. 156 END KillMenu;
  352. ***** ^ not supported yet
  353. 157
  354. 158 (*......................................*)
  355. 159
  356. 160 PROCEDURE ShowSelectChars(VAR menu:MenuRec; onoff:switch);
  357. ***** ^ undeclared identifier
  358. 161 VAR
  359. 162 i : CARDINAL;
  360. 163 c : CHAR;
  361. 164 BEGIN
  362. 165 IF NOT menu.ExitOnChar THEN
  363. ***** ^ not supported yet
  364. ***** ^ not supported yet
  365. 166 RETURN;
  366. 167 END;
  367. 168 i:=0;
  368. 169 WHILE i<menu.NumUsed DO
  369. ***** ^ not supported yet
  370. ***** ^ not supported yet
  371. 170 WITH menu.Option[i] DO
  372. ***** ^ not supported yet
  373. ***** ^ not supported yet
  374. ***** ^ not supported yet
  375. 171 c := Name[FirstNonSpace];
  376. ***** ^ undeclared identifier
  377. ***** ^ undeclared identifier
  378. 172 IF onoff=on THEN
  379. ***** ^ not supported yet
  380. ***** ^ not supported yet
  381. 173 IF i=menu.Selection THEN
  382. ***** ^ not supported yet
  383. ***** ^ not supported yet
  384. 174 SetColor(menu.SHighlite)
  385. ***** ^ not supported yet
  386. ***** ^ not supported yet
  387. ***** ^ not supported yet
  388. 175 ELSE
  389. 176 SetColor(menu.Highlite)
  390. ***** ^ not supported yet
  391. ***** ^ not supported yet
  392. ***** ^ not supported yet
  393. 177 END
  394. 178 ELSE
  395. 179 IF i=menu.Selection THEN
  396. ***** ^ not supported yet
  397. ***** ^ not supported yet
  398. 180 SetColor(menu.Selected)
  399. ***** ^ not supported yet
  400. ***** ^ not supported yet
  401. ***** ^ not supported yet
  402. 181 ELSE
  403. 182 SetColor(menu.Normal)
  404. ***** ^ not supported yet
  405. ***** ^ not supported yet
  406. ***** ^ not supported yet
  407. 183 END;
  408. 184 END;
  409. 185 Window.DirectWrite(XPos+FirstNonSpace+1,YPos+1,ADR(c),1);
  410. ***** ^ not supported yet
  411. ***** ^ not supported yet
  412. ***** ^ undeclared identifier
  413. ***** ^ undeclared identifier
  414. ***** ^ undeclared identifier
  415. ***** ^ undeclared identifier
  416. ***** ^ not supported yet
  417. ***** ^ not supported yet
  418. 186 END;
  419. ***** ^ not supported yet
  420. 187 INC(i);
  421. ***** ^ undeclared identifier
  422. ***** ^ undeclared identifier
  423. 188 END;
  424. 189 END ShowSelectChars;
  425. ***** ^ not supported yet
  426. 190
  427. 191 (*......................................*)
  428. 192
  429. 193 PROCEDURE HighLight(VAR menu:MenuRec; onoff:switch; opno:CARDINAL);
  430. ***** ^ undeclared identifier
  431. 194 VAR
  432. 195 c : CHAR;
  433. 196 BEGIN
  434. 197 WITH menu.Option[opno] DO
  435. ***** ^ not supported yet
  436. ***** ^ not supported yet
  437. ***** ^ not supported yet
  438. 198 IF onoff=on THEN
  439. ***** ^ not supported yet
  440. ***** ^ not supported yet
  441. 199 SetColor(menu.Selected)
  442. ***** ^ not supported yet
  443. ***** ^ not supported yet
  444. ***** ^ not supported yet
  445. 200 ELSE
  446. 201 SetColor(menu.Normal)
  447. ***** ^ not supported yet
  448. ***** ^ not supported yet
  449. ***** ^ not supported yet
  450. 202 END;
  451. 203 Window.DirectWrite(XPos+1,YPos+1,ADR(Name),menu.Width);
  452. ***** ^ not supported yet
  453. ***** ^ not supported yet
  454. ***** ^ undeclared identifier
  455. ***** ^ undeclared identifier
  456. ***** ^ undeclared identifier
  457. ***** ^ undeclared identifier
  458. ***** ^ not supported yet
  459. ***** ^ not supported yet
  460. 204 c := Name[FirstNonSpace];
  461. ***** ^ undeclared identifier
  462. ***** ^ undeclared identifier
  463. 205 IF menu.ExitOnChar THEN
  464. ***** ^ not supported yet
  465. ***** ^ not supported yet
  466. 206 IF onoff=on THEN
  467. ***** ^ not supported yet
  468. ***** ^ not supported yet
  469. 207 SetColor(menu.SHighlite)
  470. ***** ^ not supported yet
  471. ***** ^ not supported yet
  472. ***** ^ not supported yet
  473. 208 ELSE
  474. 209 SetColor(menu.Highlite)
  475. ***** ^ not supported yet
  476. ***** ^ not supported yet
  477. ***** ^ not supported yet
  478. 210 END;
  479. 211 Window.DirectWrite(XPos+FirstNonSpace+1,YPos+1,ADR(c),1);
  480. ***** ^ not supported yet
  481. ***** ^ not supported yet
  482. ***** ^ undeclared identifier
  483. ***** ^ undeclared identifier
  484. ***** ^ undeclared identifier
  485. ***** ^ undeclared identifier
  486. ***** ^ not supported yet
  487. ***** ^ not supported yet
  488. 212 END;
  489. 213 END;
  490. ***** ^ not supported yet
  491. 214 END HighLight;
  492. ***** ^ not supported yet
  493. 215
  494. 216 (*......................................*)
  495. 217
  496. 218 PROCEDURE ChCheck(VAR menu:MenuRec; ch:CHAR);
  497. ***** ^ undeclared identifier
  498. 219 VAR
  499. 220 start : CARDINAL;
  500. 221 found : BOOLEAN;
  501. 222
  502. 223 (*. . . . . . . . . . . . . . . . . . . . .*)
  503. 224
  504. 225 PROCEDURE CharPresent():BOOLEAN;
  505. 226 BEGIN
  506. 227 WITH menu DO
  507. ***** ^ not supported yet
  508. 228 WITH Option[Selection] DO
  509. ***** ^ undeclared identifier
  510. ***** ^ undeclared identifier
  511. 229 RETURN Name[FirstNonSpace] = ch;
  512. ***** ^ undeclared identifier
  513. ***** ^ undeclared identifier
  514. 230 END;
  515. ***** ^ not supported yet
  516. 231 END;
  517. ***** ^ not supported yet
  518. 232 END CharPresent;
  519. ***** ^ not supported yet
  520. 233
  521. 234 (*. . . . . . . . . . . . . . . . . . . . .*)
  522. 235
  523. 236 BEGIN (* ChCheck *)
  524. 237 IF (ORD(ch)=32) OR (ORD(ch)=13) THEN
  525. ***** ^ undeclared identifier
  526. ***** ^ undeclared identifier
  527. ***** ^ undeclared identifier
  528. ***** ^ undeclared identifier
  529. 238 RETURN;
  530. 239 END;
  531. 240 WITH menu DO
  532. ***** ^ undeclared identifier
  533. 241 found:=FALSE;
  534. ***** ^ undeclared identifier
  535. 242 start:=Selection;
  536. ***** ^ undeclared identifier
  537. ***** ^ undeclared identifier
  538. 243 REPEAT
  539. 244 Selection := (Selection+1) MOD NumUsed;
  540. ***** ^ undeclared identifier
  541. ***** ^ undeclared identifier
  542. ***** ^ undeclared identifier
  543. 245 found := CharPresent();
  544. ***** ^ undeclared identifier
  545. ***** ^ undeclared identifier
  546. ***** ^ not supported yet
  547. 246 UNTIL (Selection=start) OR (found);
  548. ***** ^ undeclared identifier
  549. ***** ^ undeclared identifier
  550. ***** ^ undeclared identifier
  551. 247 IF Selection<>start THEN
  552. ***** ^ undeclared identifier
  553. ***** ^ undeclared identifier
  554. 248 HighLight(menu,off,start);
  555. ***** ^ not supported yet
  556. ***** ^ undeclared identifier
  557. ***** ^ not supported yet
  558. ***** ^ undeclared identifier
  559. 249 HighLight(menu,on,Selection);
  560. ***** ^ not supported yet
  561. ***** ^ undeclared identifier
  562. ***** ^ not supported yet
  563. ***** ^ undeclared identifier
  564. 250 END;
  565. 251 gotcha := ExitOnChar AND found;
  566. ***** ^ undeclared identifier
  567. ***** ^ undeclared identifier
  568. 252 END;
  569. ***** ^ not supported yet
  570. 253 END ChCheck;
  571. ***** ^ not supported yet
  572. 254
  573. 255 (*......................................*)
  574. 256
  575. 257 PROCEDURE DisplayPopUp(VAR menu:MenuRec; MenuX,MenuY:CARDINAL);
  576. ***** ^ undeclared identifier
  577. 258 VAR
  578. 259 i : CARDINAL;
  579. 260 Def : Window.WinDef;
  580. ***** ^ not supported yet
  581. 261 BEGIN
  582. 262 WITH menu DO
  583. ***** ^ not supported yet
  584. 263 IF winptr=NIL THEN
  585. ***** ^ undeclared identifier
  586. 264 Def := MenuTemplate;
  587. ***** ^ not supported yet
  588. 265 WITH Def DO
  589. ***** ^ not supported yet
  590. 266 X1:=MenuX;
  591. ***** ^ undeclared identifier
  592. 267 Y1:=MenuY;
  593. ***** ^ undeclared identifier
  594. 268 X2:=X1+Width+1;
  595. ***** ^ undeclared identifier
  596. ***** ^ undeclared identifier
  597. ***** ^ undeclared identifier
  598. 269 Y2:=Y1+NumUsed+1;
  599. ***** ^ undeclared identifier
  600. ***** ^ undeclared identifier
  601. ***** ^ undeclared identifier
  602. 270 Foreground := MenuColors.NormFore;
  603. ***** ^ undeclared identifier
  604. ***** ^ undeclared identifier
  605. ***** ^ not supported yet
  606. 271 Background := MenuColors.NormBack;
  607. ***** ^ undeclared identifier
  608. ***** ^ undeclared identifier
  609. ***** ^ not supported yet
  610. 272 FrameFore := MenuColors.FrameFore;
  611. ***** ^ undeclared identifier
  612. ***** ^ undeclared identifier
  613. ***** ^ not supported yet
  614. 273 FrameBack := MenuColors.FrameBack;
  615. ***** ^ undeclared identifier
  616. ***** ^ undeclared identifier
  617. ***** ^ not supported yet
  618. 274 END;
  619. ***** ^ not supported yet
  620. 275 winptr := Window.Open(Def);
  621. ***** ^ undeclared identifier
  622. ***** ^ not supported yet
  623. ***** ^ not supported yet
  624. ***** ^ undeclared identifier
  625. 276 IF Title[0]<>0C THEN
  626. ***** ^ undeclared identifier
  627. ***** ^ not supported yet
  628. 277 Window.SetTitle(winptr,Title,Window.LeftUpperTitle);
  629. ***** ^ not supported yet
  630. ***** ^ not supported yet
  631. ***** ^ undeclared identifier
  632. ***** ^ undeclared identifier
  633. ***** ^ not supported yet
  634. ***** ^ not supported yet
  635. 278 END
  636. 279 END;
  637. 280 SetColor(Normal);
  638. ***** ^ not supported yet
  639. ***** ^ undeclared identifier
  640. 281 FOR i:=0 TO NumUsed-1 DO
  641. ***** ^ undeclared identifier
  642. ***** ^ undeclared identifier
  643. ***** ^ FOR needs integer variable and bounds
  644. 282 WITH menu.Option[i] DO
  645. ***** ^ undeclared identifier
  646. ***** ^ not supported yet
  647. ***** ^ undeclared identifier
  648. 283 XPos:=0;
  649. ***** ^ undeclared identifier
  650. 284 YPos:=i;
  651. ***** ^ undeclared identifier
  652. ***** ^ undeclared identifier
  653. 285 Window.DirectWrite(XPos+1,YPos+1,ADR(Name),Width);
  654. ***** ^ not supported yet
  655. ***** ^ not supported yet
  656. ***** ^ undeclared identifier
  657. ***** ^ undeclared identifier
  658. ***** ^ undeclared identifier
  659. ***** ^ undeclared identifier
  660. ***** ^ undeclared identifier
  661. 286 END;
  662. ***** ^ not supported yet
  663. 287 END;
  664. 288 Window.PutOnTop(winptr);
  665. ***** ^ not supported yet
  666. ***** ^ not supported yet
  667. ***** ^ undeclared identifier
  668. 289 END;
  669. ***** ^ not supported yet
  670. 290 END DisplayPopUp;
  671. ***** ^ not supported yet
  672. 291
  673. 292 (*......................................*)
  674. 293
  675. 294 PROCEDURE PopUpMenu(VAR menu:MenuRec):INTEGER;
  676. ***** ^ undeclared identifier
  677. 295 VAR
  678. 296 ch : CHAR;
  679. 297 BEGIN
  680. 298 WITH menu DO
  681. ***** ^ not supported yet
  682. 299 Window.Use(winptr);
  683. ***** ^ not supported yet
  684. ***** ^ not supported yet
  685. ***** ^ undeclared identifier
  686. 300 ShowSelectChars(menu,on);
  687. ***** ^ not supported yet
  688. ***** ^ not supported yet
  689. ***** ^ not supported yet
  690. 301 HighLight(menu,on,Selection);
  691. ***** ^ not supported yet
  692. ***** ^ not supported yet
  693. ***** ^ not supported yet
  694. ***** ^ undeclared identifier
  695. 302 REPEAT
  696. 303 Read(ch);
  697. ***** ^ not supported yet
  698. ***** ^ not supported yet
  699. 304 DeAltify(ch);
  700. ***** ^ not supported yet
  701. ***** ^ not supported yet
  702. 305 CASE FuncKeyTyped OF
  703. ***** ^ not supported yet
  704. 306 Escape : IF EscapeOK THEN
  705. ***** ^ not supported yet
  706. ***** ^ undeclared identifier
  707. 307 RETURN(-1);
  708. 308 END; |
  709. 309 PageUp : IF PageKeysOK THEN
  710. ***** ^ not supported yet
  711. ***** ^ undeclared identifier
  712. 310 RETURN(-2);
  713. 311 END; |
  714. 312 PageDown : IF PageKeysOK THEN
  715. ***** ^ not supported yet
  716. ***** ^ undeclared identifier
  717. 313 RETURN(-3);
  718. 314 END; |
  719. 315 FKey1 : IF HelpOK THEN
  720. ***** ^ not supported yet
  721. ***** ^ undeclared identifier
  722. 316 RETURN(-4);
  723. 317 END; |
  724. 318 Cright,Cdown: IF (FuncKeyTyped=Cright) AND (ExitSideWays) THEN
  725. ***** ^ not supported yet
  726. ***** ^ not supported yet
  727. ***** ^ not supported yet
  728. ***** ^ not supported yet
  729. ***** ^ undeclared identifier
  730. 319 RETURN(-5);
  731. 320 ELSE
  732. 321 HighLight(menu,off,Selection);
  733. ***** ^ not supported yet
  734. ***** ^ not supported yet
  735. ***** ^ not supported yet
  736. ***** ^ undeclared identifier
  737. 322 Selection:=(Selection+1) MOD NumUsed;
  738. ***** ^ undeclared identifier
  739. ***** ^ undeclared identifier
  740. ***** ^ undeclared identifier
  741. 323 HighLight(menu,on,Selection);
  742. ***** ^ not supported yet
  743. ***** ^ not supported yet
  744. ***** ^ not supported yet
  745. ***** ^ undeclared identifier
  746. 324 END; |
  747. 325 Cleft,Cup : IF (FuncKeyTyped=Cleft) AND (ExitSideWays) THEN
  748. ***** ^ not supported yet
  749. ***** ^ not supported yet
  750. ***** ^ not supported yet
  751. ***** ^ not supported yet
  752. ***** ^ undeclared identifier
  753. 326 RETURN(-6);
  754. 327 ELSE
  755. 328 HighLight(menu,off,Selection);
  756. ***** ^ not supported yet
  757. ***** ^ not supported yet
  758. ***** ^ not supported yet
  759. ***** ^ undeclared identifier
  760. 329 IF Selection=0 THEN
  761. ***** ^ undeclared identifier
  762. 330 Selection:=NumUsed;
  763. ***** ^ undeclared identifier
  764. ***** ^ undeclared identifier
  765. 331 END;
  766. 332 DEC(Selection);
  767. ***** ^ undeclared identifier
  768. ***** ^ undeclared identifier
  769. 333 HighLight(menu,on,Selection);
  770. ***** ^ not supported yet
  771. ***** ^ not supported yet
  772. ***** ^ not supported yet
  773. ***** ^ undeclared identifier
  774. 334 END; |
  775. 335 ELSE
  776. 336 ChCheck(menu,ch)
  777. ***** ^ not supported yet
  778. ***** ^ not supported yet
  779. ***** ^ not supported yet
  780. 337 END;
  781. 338 UNTIL (ch=CHR(13)) OR (gotcha);
  782. ***** ^ undeclared identifier
  783. ***** ^ not supported yet
  784. 339 ShowSelectChars(menu,off);
  785. ***** ^ not supported yet
  786. ***** ^ not supported yet
  787. ***** ^ not supported yet
  788. 340 RETURN Selection;
  789. ***** ^ undeclared identifier
  790. 341 END;
  791. ***** ^ not supported yet
  792. 342 END PopUpMenu;
  793. ***** ^ not supported yet
  794. 343
  795. 344 (*......................................*)
  796. 345
  797. 346 PROCEDURE DispMenu(VAR menu:MenuRec);
  798. ***** ^ undeclared identifier
  799. 347 BEGIN
  800. 348 WITH menu DO
  801. ***** ^ not supported yet
  802. 349 DisplayPopUp(menu,MenuX,MenuY)
  803. ***** ^ not supported yet
  804. ***** ^ not supported yet
  805. ***** ^ undeclared identifier
  806. ***** ^ undeclared identifier
  807. 350 END;
  808. 351 END DispMenu;
  809. ***** ^ not supported yet
  810. 352
  811. 353 (*......................................*)
  812. 354
  813. 355 PROCEDURE RepaintMenu(VAR menu:MenuRec);
  814. ***** ^ undeclared identifier
  815. 356 VAR
  816. 357 i : CARDINAL;
  817. 358 onoff : switch;
  818. ***** ^ not supported yet
  819. 359 BEGIN
  820. 360 menu.Selection := 0;
  821. ***** ^ not supported yet
  822. ***** ^ not supported yet
  823. 361 i:=0;
  824. 362 WHILE i<menu.NumUsed DO
  825. ***** ^ not supported yet
  826. ***** ^ not supported yet
  827. 363 IF i=menu.Selection THEN
  828. ***** ^ not supported yet
  829. ***** ^ not supported yet
  830. 364 onoff := on;
  831. ***** ^ not supported yet
  832. ***** ^ not supported yet
  833. 365 ELSE
  834. 366 onoff := off;
  835. ***** ^ not supported yet
  836. ***** ^ not supported yet
  837. 367 END ;
  838. 368 HighLight(menu,onoff,i);
  839. ***** ^ not supported yet
  840. ***** ^ not supported yet
  841. ***** ^ not supported yet
  842. ***** ^ not supported yet
  843. 369 INC(i);
  844. ***** ^ undeclared identifier
  845. ***** ^ not supported yet
  846. 370 END;
  847. 371 END RepaintMenu;
  848. ***** ^ not supported yet
  849. 372
  850. 373 (*......................................*)
  851. 374
  852. 375 PROCEDURE MenuDrive(VAR menu:MenuRec):INTEGER;
  853. ***** ^ undeclared identifier
  854. 376 BEGIN
  855. 377 gotcha:=FALSE;
  856. 378 RETURN PopUpMenu(menu);
  857. ***** ^ not supported yet
  858. ***** ^ not supported yet
  859. 379 END MenuDrive;
  860. ***** ^ not supported yet
  861. 380
  862. 381 (*......................................*)
  863. 382 BEGIN
  864. 383 WITH MenuColors DO (* default for color *)
  865. ***** ^ undeclared identifier
  866. 384 NormFore := LightCyan;
  867. ***** ^ undeclared identifier
  868. ***** ^ undeclared identifier
  869. 385 NormBack := Black;
  870. ***** ^ undeclared identifier
  871. ***** ^ undeclared identifier
  872. 386 FrameFore := LightGray;
  873. ***** ^ undeclared identifier
  874. ***** ^ undeclared identifier
  875. 387 FrameBack := Black;
  876. ***** ^ undeclared identifier
  877. ***** ^ undeclared identifier
  878. 388 HighFore := Yellow;
  879. ***** ^ undeclared identifier
  880. ***** ^ undeclared identifier
  881. 389 HighBack := Black;
  882. ***** ^ undeclared identifier
  883. ***** ^ undeclared identifier
  884. 390 SelFore := White;
  885. ***** ^ undeclared identifier
  886. ***** ^ undeclared identifier
  887. 391 SelBack := Blue;
  888. ***** ^ undeclared identifier
  889. ***** ^ undeclared identifier
  890. 392 HSelFore := Yellow;
  891. ***** ^ undeclared identifier
  892. ***** ^ undeclared identifier
  893. 393 HSelBack := Blue;
  894. ***** ^ undeclared identifier
  895. ***** ^ undeclared identifier
  896. 394 END;
  897. ***** ^ not supported yet
  898. 395 END MenuLib.
  899. ***** ^ not supported yet
  900. 396
  901. 503 errors