WINDOWPR.LST 61 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406
  1. Listing:
  2. 1 IMPLEMENTATION MODULE WindowPrims;
  3. 2 (*
  4. 3 * REPERTOIRE
  5. 4 * Release 1.6
  6. 5 * By Charles Bradford and Cole Brecheen
  7. 6 * (c) Copyright 1985-1992 PMI
  8. 7 * Green Bay, Wisconsin
  9. 8 * All rights reserved
  10. 9 * (414) 468-6040
  11. 10 *
  12. 11 * $Header: D:/logfiles/mods/windowpr.mov 1.9 17 Mar 1991 18:01:28 coleb $
  13. 12 *
  14. 13 *)
  15. 14
  16. 15 (*EntryDiag:
  17. 16 IMPORT Diagnostics;
  18. 17 :EntryDiag*)
  19. 18
  20. 19 IMPORT ErrorManager;
  21. 20 IMPORT KbdInput;
  22. 21 IMPORT LowLevel;
  23. 22 IMPORT M2Strings;
  24. 23 IMPORT Numbers;
  25. 24 IMPORT PosUtils;
  26. 25 IMPORT SmartScreen;
  27. 26 IMPORT StrConv;
  28. 27 IMPORT StrEdit;
  29. 28 IMPORT StringIO;
  30. 29 IMPORT VStorage;
  31. 30 IMPORT VWindows;
  32. 31
  33. 32 IMPORT SYSTEM;
  34. 33 IMPORT FAPI;
  35. 34
  36. 35 VAR
  37. 36 Initialized : BOOLEAN;
  38. 37
  39. 38
  40. 39 CONST
  41. 40 blank = ' ';
  42. 41 null = '';
  43. 42 InsufficientMemory = 'WindowPr -- Too little memory';
  44. ***** ^ not supported yet
  45. 43 StackError = 'Misuse of Push/Pop routines in WindowPrims';
  46. ***** ^ not supported yet
  47. 44 OS2Error =' os/2 returned error from Video subsystem';
  48. ***** ^ not supported yet
  49. 45 backspace = 10C;
  50. 46 CarriageReturn = 15C;
  51. 47
  52. 48 lftcol = 4;
  53. 49 toprow = 3;
  54. 50 rtcol = 44;
  55. 51 btmrow = 14;
  56. 52 midcol = 24;
  57. 53 midrow = 9;
  58. 54 (* These define the starting points for the 4 msg box areas *)
  59. 55
  60. 56 TYPE
  61. 57 Cell =
  62. 58 RECORD
  63. 59 Char, Attribute: CHAR;
  64. 60 END;
  65. ***** ^ not supported yet
  66. 61
  67. 62 VAR
  68. 63 StartingCursorHt : CARDINAL;
  69. 64 NilValue : VStorage.MemHandle;
  70. ***** ^ not supported yet
  71. 65
  72. 66
  73. 67 PROCEDURE GetCursorCoords(VAR column, row : CARDINAL);
  74. 68 BEGIN
  75. 69 IF FAPI.VIOGETCURPOS(SYSTEM.ADR(row), SYSTEM.ADR(column), 0) # 0 THEN
  76. ***** ^ not supported yet
  77. ***** ^ not supported yet
  78. ***** ^ not supported yet
  79. ***** ^ not supported yet
  80. ***** ^ not supported yet
  81. ***** ^ not supported yet
  82. ***** ^ not supported yet
  83. ***** ^ not supported yet
  84. ***** ^ not supported yet
  85. 70 ErrorManager.WARN("VioGetCurPos");
  86. ***** ^ not supported yet
  87. ***** ^ not supported yet
  88. ***** ^ not supported yet
  89. 71 END;
  90. 72 (* Remember that the Repertoire convention is to number
  91. 73 the top left corner 1,1; OS/2 numbers it 0,0. We ought
  92. 74 to follow the OS/2 convention, probably, but changing
  93. 75 now would be difficult. *)
  94. 76 INC(column);
  95. ***** ^ undeclared identifier
  96. ***** ^ not supported yet
  97. 77 INC(row);
  98. ***** ^ undeclared identifier
  99. ***** ^ not supported yet
  100. 78 END GetCursorCoords;
  101. ***** ^ not supported yet
  102. 79
  103. 80
  104. 81 PROCEDURE left();
  105. 82 (*Moves the cursor one space left.*)
  106. 83 VAR
  107. 84 col, row : CARDINAL;
  108. 85 BEGIN
  109. 86 GetCursorCoords(col, row);
  110. ***** ^ not supported yet
  111. ***** ^ not supported yet
  112. 87 col := col-1;
  113. 88 SmartScreen.GotoXY(col, row);
  114. ***** ^ not supported yet
  115. ***** ^ not supported yet
  116. ***** ^ not supported yet
  117. 89 END left;
  118. ***** ^ not supported yet
  119. 90
  120. 91 PROCEDURE right();
  121. 92 (*Moves the cursor one space right.*)
  122. 93 VAR
  123. 94 col, row : CARDINAL;
  124. 95 BEGIN
  125. 96 GetCursorCoords(col, row);
  126. ***** ^ not supported yet
  127. ***** ^ not supported yet
  128. 97 col := col+1;
  129. 98 SmartScreen.GotoXY(col, row);
  130. ***** ^ not supported yet
  131. ***** ^ not supported yet
  132. ***** ^ not supported yet
  133. 99 END right;
  134. ***** ^ not supported yet
  135. 100
  136. 101 PROCEDURE up();
  137. 102 (*Moves the cursor one row up.*)
  138. 103 VAR
  139. 104 col, row : CARDINAL;
  140. 105 BEGIN
  141. 106 GetCursorCoords(col, row);
  142. ***** ^ not supported yet
  143. ***** ^ not supported yet
  144. 107 row := row-1;
  145. 108 SmartScreen.GotoXY(col, row);
  146. ***** ^ not supported yet
  147. ***** ^ not supported yet
  148. ***** ^ not supported yet
  149. 109 END up;
  150. ***** ^ not supported yet
  151. 110
  152. 111 PROCEDURE down();
  153. 112 (*Moves the cursor one row down.*)
  154. 113 VAR
  155. 114 col, row : CARDINAL;
  156. 115 BEGIN
  157. 116 GetCursorCoords(col, row);
  158. ***** ^ not supported yet
  159. ***** ^ not supported yet
  160. 117 row := row+1;
  161. 118 SmartScreen.GotoXY(col, row);
  162. ***** ^ not supported yet
  163. ***** ^ not supported yet
  164. ***** ^ not supported yet
  165. 119 END down;
  166. ***** ^ not supported yet
  167. 120
  168. 121 PROCEDURE coord(ColNum, RowNum : CARDINAL) : CARDINAL;
  169. 122 (*Makes it easier to work WITH the routines below, which
  170. 123 treat the screen as a linear sequence OF 4000 bytes.*)
  171. 124 BEGIN
  172. 125 RETURN (Numbers.Between(0,RowNum-1,SmartScreen.MaxRow-1) *
  173. ***** ^ not supported yet
  174. ***** ^ not supported yet
  175. ***** ^ not supported yet
  176. ***** ^ not supported yet
  177. ***** ^ not supported yet
  178. 126 SmartScreen.MaxCol+ Numbers.Between(1,ColNum,
  179. ***** ^ not supported yet
  180. ***** ^ not supported yet
  181. ***** ^ not supported yet
  182. ***** ^ not supported yet
  183. 127 SmartScreen.MaxCol));
  184. ***** ^ not supported yet
  185. ***** ^ not supported yet
  186. 128 END coord;
  187. ***** ^ not supported yet
  188. 129
  189. 130 PROCEDURE WriteVidCh(spot : CARDINAL; TheChar : SmartScreen.VideoMemChar);
  190. ***** ^ not supported yet
  191. 131 BEGIN
  192. 132 SmartScreen.NominalCol := spot MOD SmartScreen.MaxCol;
  193. ***** ^ not supported yet
  194. ***** ^ not supported yet
  195. ***** ^ not supported yet
  196. ***** ^ not supported yet
  197. 133 SmartScreen.NominalRow := (spot DIV SmartScreen.MaxCol)+1;
  198. ***** ^ not supported yet
  199. ***** ^ not supported yet
  200. ***** ^ not supported yet
  201. ***** ^ not supported yet
  202. 134 CASE SmartScreen.VideoMethod OF
  203. ***** ^ not supported yet
  204. ***** ^ not supported yet
  205. 135 SmartScreen.DMA, SmartScreen.ROM :
  206. ***** ^ not supported yet
  207. ***** ^ not supported yet
  208. ***** ^ not supported yet
  209. ***** ^ not supported yet
  210. 136 IF FAPI.VIOWRTCELLSTR( SYSTEM.ADR(TheChar), 1,
  211. ***** ^ not supported yet
  212. ***** ^ not supported yet
  213. ***** ^ not supported yet
  214. ***** ^ not supported yet
  215. ***** ^ not supported yet
  216. 137 SmartScreen.NominalRow, SmartScreen.NominalCol, 0) # 0 THEN
  217. ***** ^ not supported yet
  218. ***** ^ not supported yet
  219. ***** ^ not supported yet
  220. ***** ^ not supported yet
  221. ***** ^ not supported yet
  222. 138 ErrorManager.WARN(OS2Error);
  223. ***** ^ not supported yet
  224. ***** ^ not supported yet
  225. ***** ^ not supported yet
  226. 139 END;
  227. 140 ELSE
  228. 141 SmartScreen.GotoXY(SmartScreen.NominalCol, SmartScreen.NominalRow);
  229. ***** ^ not supported yet
  230. ***** ^ not supported yet
  231. ***** ^ not supported yet
  232. ***** ^ not supported yet
  233. ***** ^ not supported yet
  234. ***** ^ not supported yet
  235. 142 StringIO.WriteStr(StringIO.outp, TheChar.ch);
  236. ***** ^ not supported yet
  237. ***** ^ not supported yet
  238. ***** ^ not supported yet
  239. ***** ^ not supported yet
  240. ***** ^ not supported yet
  241. ***** ^ not supported yet
  242. 143 END;
  243. 144 END WriteVidCh;
  244. ***** ^ not supported yet
  245. 145
  246. 146
  247. 147 TYPE
  248. 148 CoordStackPtr = POINTER TO CoordStackElem;
  249. ***** ^ undeclared identifier
  250. 149 CoordStackElem =
  251. 150 RECORD
  252. 151 col, row: CARDINAL;
  253. 152 prv: CoordStackPtr;
  254. 153 END;
  255. ***** ^ not supported yet
  256. 154 VAR
  257. 155 CoordStackTop: CoordStackPtr;
  258. ***** ^ not supported yet
  259. 156
  260. 157 PROCEDURE PushCursorCoords();
  261. 158 (*For temporary storage of a cursor position.*)
  262. 159 VAR
  263. 160 tmp: CoordStackPtr;
  264. ***** ^ not supported yet
  265. 161 BEGIN
  266. 162 VStorage.DosAlloc( tmp, SYSTEM.TSIZE(CoordStackElem) );
  267. ***** ^ not supported yet
  268. ***** ^ not supported yet
  269. ***** ^ not supported yet
  270. ***** ^ not supported yet
  271. ***** ^ not supported yet
  272. ***** ^ not supported yet
  273. 163 tmp^.prv := CoordStackTop;
  274. ***** ^ not supported yet
  275. ***** ^ not supported yet
  276. ***** ^ not supported yet
  277. 164 WITH tmp^ DO
  278. ***** ^ not supported yet
  279. 165 GetCursorCoords( col, row );
  280. ***** ^ not supported yet
  281. ***** ^ undeclared identifier
  282. ***** ^ undeclared identifier
  283. 166 END;
  284. ***** ^ not supported yet
  285. 167 CoordStackTop := tmp;
  286. ***** ^ not supported yet
  287. ***** ^ undeclared identifier
  288. 168 END PushCursorCoords;
  289. ***** ^ not supported yet
  290. 169
  291. 170 PROCEDURE PopCursorCoords();
  292. 171 VAR
  293. 172 tmp: CoordStackPtr;
  294. ***** ^ not supported yet
  295. 173 BEGIN
  296. 174 tmp := CoordStackTop;
  297. ***** ^ not supported yet
  298. ***** ^ not supported yet
  299. 175 IF tmp = NIL THEN
  300. ***** ^ not supported yet
  301. 176 ErrorManager.WARN( StackError );
  302. ***** ^ not supported yet
  303. ***** ^ not supported yet
  304. ***** ^ not supported yet
  305. 177 END;
  306. 178 WITH tmp^ DO
  307. ***** ^ not supported yet
  308. 179 SmartScreen.GotoXY( col, row );
  309. ***** ^ not supported yet
  310. ***** ^ not supported yet
  311. ***** ^ undeclared identifier
  312. ***** ^ undeclared identifier
  313. 180 SmartScreen.NominalCol := col;
  314. ***** ^ not supported yet
  315. ***** ^ not supported yet
  316. ***** ^ undeclared identifier
  317. 181 SmartScreen.NominalRow := row;
  318. ***** ^ not supported yet
  319. ***** ^ not supported yet
  320. ***** ^ undeclared identifier
  321. 182 END;
  322. ***** ^ not supported yet
  323. 183 CoordStackTop := CoordStackTop^.prv;
  324. ***** ^ not supported yet
  325. ***** ^ not supported yet
  326. ***** ^ not supported yet
  327. 184 VStorage.DosDealloc( tmp, SYSTEM.TSIZE(CoordStackElem) );
  328. ***** ^ not supported yet
  329. ***** ^ not supported yet
  330. ***** ^ undeclared identifier
  331. ***** ^ not supported yet
  332. ***** ^ not supported yet
  333. ***** ^ not supported yet
  334. 185 END PopCursorCoords;
  335. ***** ^ not supported yet
  336. 186
  337. 187 PROCEDURE GetCursorHeight(): CARDINAL;
  338. 188 VAR
  339. 189 CursorData: FAPI.VIOCURSORINFO;
  340. ***** ^ not supported yet
  341. 190 ErrorNum, height: CARDINAL;
  342. 191 BEGIN
  343. 192 ErrorNum := FAPI.VIOGETCURTYPE( SYSTEM.ADR(CursorData), 0 );
  344. ***** ^ not supported yet
  345. ***** ^ not supported yet
  346. ***** ^ not supported yet
  347. ***** ^ not supported yet
  348. ***** ^ not supported yet
  349. ***** ^ not supported yet
  350. 193 IF ErrorNum # 0 THEN
  351. 194 ErrorManager.WarnNumber("VIOGETCURTYPE error", ErrorNum);
  352. ***** ^ not supported yet
  353. ***** ^ not supported yet
  354. ***** ^ not supported yet
  355. ***** ^ not supported yet
  356. 195 END;
  357. 196 IF (CursorData.cEnd<CursorData.yStart) OR
  358. ***** ^ not supported yet
  359. ***** ^ not supported yet
  360. ***** ^ not supported yet
  361. ***** ^ not supported yet
  362. 197 (CursorData.attr=CARDINAL(-1)) THEN
  363. ***** ^ not supported yet
  364. ***** ^ not supported yet
  365. ***** ^ not supported yet
  366. 198 height := 0;
  367. 199 ELSE
  368. 200 height := (CursorData.cEnd - CursorData.yStart) + 1;
  369. ***** ^ not supported yet
  370. ***** ^ not supported yet
  371. ***** ^ not supported yet
  372. ***** ^ not supported yet
  373. 201 END;
  374. 202 RETURN height;
  375. 203 END GetCursorHeight;
  376. ***** ^ not supported yet
  377. 204
  378. 205
  379. 206 TYPE
  380. 207 HtStackPtr = POINTER TO HtStackElem;
  381. ***** ^ undeclared identifier
  382. 208 HtStackElem =
  383. 209 RECORD
  384. 210 ht: CARDINAL;
  385. 211 prv: HtStackPtr;
  386. 212 END;
  387. ***** ^ not supported yet
  388. 213 VAR
  389. 214 HtStackTop: HtStackPtr;
  390. ***** ^ not supported yet
  391. 215
  392. 216 PROCEDURE PushCursorHeight();
  393. 217 VAR
  394. 218 tmp: HtStackPtr;
  395. ***** ^ not supported yet
  396. 219 BEGIN
  397. 220 VStorage.DosAlloc( tmp, SYSTEM.TSIZE(HtStackElem) );
  398. ***** ^ not supported yet
  399. ***** ^ not supported yet
  400. ***** ^ not supported yet
  401. ***** ^ not supported yet
  402. ***** ^ not supported yet
  403. ***** ^ not supported yet
  404. 221 tmp^.prv := HtStackTop;
  405. ***** ^ not supported yet
  406. ***** ^ not supported yet
  407. ***** ^ not supported yet
  408. 222 tmp^.ht := GetCursorHeight();
  409. ***** ^ not supported yet
  410. ***** ^ not supported yet
  411. ***** ^ not supported yet
  412. ***** ^ not supported yet
  413. 223 HtStackTop := tmp;
  414. ***** ^ not supported yet
  415. ***** ^ not supported yet
  416. 224 END PushCursorHeight;
  417. ***** ^ not supported yet
  418. 225
  419. 226 PROCEDURE PopCursorHeight();
  420. 227 VAR
  421. 228 tmp: HtStackPtr;
  422. ***** ^ not supported yet
  423. 229 BEGIN
  424. 230 tmp := HtStackTop;
  425. ***** ^ not supported yet
  426. ***** ^ not supported yet
  427. 231 IF tmp = NIL THEN
  428. ***** ^ not supported yet
  429. 232 ErrorManager.WARN( StackError );
  430. ***** ^ not supported yet
  431. ***** ^ not supported yet
  432. ***** ^ not supported yet
  433. 233 END;
  434. 234 SmartScreen.SetCursorHeight( tmp^.ht );
  435. ***** ^ not supported yet
  436. ***** ^ not supported yet
  437. ***** ^ not supported yet
  438. ***** ^ not supported yet
  439. 235 HtStackTop := tmp^.prv;
  440. ***** ^ not supported yet
  441. ***** ^ not supported yet
  442. ***** ^ not supported yet
  443. 236 VStorage.DosDealloc( tmp, SYSTEM.TSIZE(HtStackElem) );
  444. ***** ^ not supported yet
  445. ***** ^ not supported yet
  446. ***** ^ not supported yet
  447. ***** ^ not supported yet
  448. ***** ^ not supported yet
  449. ***** ^ not supported yet
  450. 237 END PopCursorHeight;
  451. ***** ^ not supported yet
  452. 238
  453. 239
  454. 240 TYPE
  455. 241 (* Type used for Global Color Stack *)
  456. 242 CStackP = POINTER TO CStack;
  457. ***** ^ undeclared identifier
  458. 243 CStack =
  459. 244 RECORD
  460. 245 forec, backc: SmartScreen.Colors;
  461. ***** ^ not supported yet
  462. 246 prv: CStackP;
  463. 247 END;
  464. ***** ^ not supported yet
  465. 248 VAR
  466. 249 ColorStack: CStackP; (* Global Color Stack *)
  467. ***** ^ not supported yet
  468. 250
  469. 251 PROCEDURE PushColors();
  470. 252 (* Pushes fore and back ground on color stack *)
  471. 253 VAR
  472. 254 TmpStack: CStackP;
  473. ***** ^ not supported yet
  474. 255 BEGIN
  475. 256 VStorage.DosAlloc( TmpStack, SYSTEM.TSIZE(CStack) );
  476. ***** ^ not supported yet
  477. ***** ^ not supported yet
  478. ***** ^ not supported yet
  479. ***** ^ not supported yet
  480. ***** ^ not supported yet
  481. ***** ^ not supported yet
  482. 257 TmpStack^.prv := ColorStack;
  483. ***** ^ not supported yet
  484. ***** ^ not supported yet
  485. ***** ^ not supported yet
  486. 258 ColorStack := TmpStack;
  487. ***** ^ not supported yet
  488. ***** ^ not supported yet
  489. 259 ColorStack^.forec := SmartScreen.ForeGround;
  490. ***** ^ not supported yet
  491. ***** ^ not supported yet
  492. ***** ^ not supported yet
  493. ***** ^ not supported yet
  494. 260 ColorStack^.backc := SmartScreen.BackGround;
  495. ***** ^ not supported yet
  496. ***** ^ not supported yet
  497. ***** ^ not supported yet
  498. ***** ^ not supported yet
  499. 261 END PushColors;
  500. ***** ^ not supported yet
  501. 262
  502. 263 PROCEDURE PopColors();
  503. 264 (* Pops fore and back ground from color stack *)
  504. 265 VAR
  505. 266 TmpStack: CStackP;
  506. ***** ^ not supported yet
  507. 267 BEGIN
  508. 268 IF ColorStack = NIL THEN
  509. ***** ^ not supported yet
  510. 269 ErrorManager.WARN( StackError );
  511. ***** ^ not supported yet
  512. ***** ^ not supported yet
  513. ***** ^ not supported yet
  514. 270 END;
  515. 271 SmartScreen.TextColor( ColorStack^.forec, ColorStack^.backc);
  516. ***** ^ not supported yet
  517. ***** ^ not supported yet
  518. ***** ^ not supported yet
  519. ***** ^ not supported yet
  520. ***** ^ not supported yet
  521. ***** ^ not supported yet
  522. 272 TmpStack := ColorStack;
  523. ***** ^ not supported yet
  524. ***** ^ not supported yet
  525. 273 ColorStack := ColorStack^.prv;
  526. ***** ^ not supported yet
  527. ***** ^ not supported yet
  528. ***** ^ not supported yet
  529. 274 VStorage.DosDealloc( TmpStack, SYSTEM.TSIZE(CStack) );
  530. ***** ^ not supported yet
  531. ***** ^ not supported yet
  532. ***** ^ not supported yet
  533. ***** ^ not supported yet
  534. ***** ^ not supported yet
  535. ***** ^ not supported yet
  536. 275 END PopColors;
  537. ***** ^ not supported yet
  538. 276
  539. 277
  540. 278 PROCEDURE ScrollWindow(col1, row1, col2, row2, lines : INTEGER);
  541. 279 VAR
  542. 280 BackGroundCell:Cell;
  543. ***** ^ not supported yet
  544. 281 vertdist : INTEGER;
  545. 282 row, backg, StartingSpot, horizdist,
  546. 283 widmem : CARDINAL;
  547. 284 BEGIN
  548. 285 col1 := Numbers.Min( col1, SmartScreen.MaxCol );
  549. ***** ^ not supported yet
  550. ***** ^ not supported yet
  551. ***** ^ not supported yet
  552. ***** ^ not supported yet
  553. 286 col2 := Numbers.Min( col2, SmartScreen.MaxCol );
  554. ***** ^ not supported yet
  555. ***** ^ not supported yet
  556. ***** ^ not supported yet
  557. ***** ^ not supported yet
  558. 287 row1 := Numbers.Min( row1, SmartScreen.MaxRow );
  559. ***** ^ not supported yet
  560. ***** ^ not supported yet
  561. ***** ^ not supported yet
  562. ***** ^ not supported yet
  563. 288 row2 := Numbers.Min( row2, SmartScreen.MaxRow );
  564. ***** ^ not supported yet
  565. ***** ^ not supported yet
  566. ***** ^ not supported yet
  567. ***** ^ not supported yet
  568. 289 vertdist := (row2 - row1) + 1;
  569. 290 IF lines > 0 THEN
  570. 291 lines := Numbers.Min( vertdist, lines );
  571. ***** ^ not supported yet
  572. ***** ^ not supported yet
  573. ***** ^ not supported yet
  574. 292 ELSE
  575. 293 lines := - INTEGER(Numbers.Min( vertdist, ABS(lines) ));
  576. ***** ^ not supported yet
  577. ***** ^ not supported yet
  578. ***** ^ undeclared identifier
  579. ***** ^ not supported yet
  580. 294 END;
  581. 295 IF (lines = 0) OR (ABS(lines) = vertdist) THEN
  582. ***** ^ undeclared identifier
  583. ***** ^ not supported yet
  584. 296 (* clear the entire window *)
  585. 297 SmartScreen.ClearPart( col1, row1, col2, row2);
  586. ***** ^ not supported yet
  587. ***** ^ not supported yet
  588. ***** ^ not supported yet
  589. 298 ELSE
  590. 299 BackGroundCell.Char := ' ';
  591. ***** ^ not supported yet
  592. ***** ^ not supported yet
  593. 300 backg := ORD(SmartScreen.BackGround);
  594. ***** ^ undeclared identifier
  595. ***** ^ not supported yet
  596. ***** ^ not supported yet
  597. 301 LowLevel.ShiftLeft(backg, 4);
  598. ***** ^ not supported yet
  599. ***** ^ not supported yet
  600. ***** ^ not supported yet
  601. 302 BackGroundCell.Attribute := CHR(ORD(SmartScreen.ForeGround)+backg);
  602. ***** ^ not supported yet
  603. ***** ^ not supported yet
  604. ***** ^ undeclared identifier
  605. ***** ^ undeclared identifier
  606. ***** ^ not supported yet
  607. ***** ^ not supported yet
  608. ***** ^ not supported yet
  609. 303 IF lines < 0 THEN
  610. 304 IF FAPI.VIOSCROLLDN(row1-1,col1-1,row2-1,col2-1,ABS(lines),
  611. ***** ^ not supported yet
  612. ***** ^ not supported yet
  613. ***** ^ undeclared identifier
  614. ***** ^ not supported yet
  615. 305 SYSTEM.ADR(BackGroundCell.Char),0) # 0 THEN
  616. ***** ^ not supported yet
  617. ***** ^ not supported yet
  618. ***** ^ not supported yet
  619. ***** ^ not supported yet
  620. ***** ^ not supported yet
  621. 306 ErrorManager.WARN('scrolldn error');
  622. ***** ^ not supported yet
  623. ***** ^ not supported yet
  624. ***** ^ not supported yet
  625. 307 END;
  626. 308 ELSE
  627. 309 IF FAPI.VIOSCROLLUP(row1-1,col1-1,row2-1,col2-1,ABS(lines),
  628. ***** ^ not supported yet
  629. ***** ^ not supported yet
  630. ***** ^ undeclared identifier
  631. ***** ^ not supported yet
  632. 310 SYSTEM.ADR(BackGroundCell.Char),0) #0 THEN
  633. ***** ^ not supported yet
  634. ***** ^ not supported yet
  635. ***** ^ not supported yet
  636. ***** ^ not supported yet
  637. ***** ^ not supported yet
  638. 311 ErrorManager.WARN('scrollup error');
  639. ***** ^ not supported yet
  640. ***** ^ not supported yet
  641. ***** ^ not supported yet
  642. 312 END;
  643. 313 END;
  644. 314 END;
  645. 315 END ScrollWindow;
  646. ***** ^ not supported yet
  647. 316
  648. 317
  649. 318 PROCEDURE ScreenSave(VAR scrn : ScreenType; col1, row1, col2,
  650. ***** ^ undeclared identifier
  651. 319 row2 : CARDINAL);
  652. 320 VAR
  653. 321 row, widmem : CARDINAL;
  654. 322 MemPtr: LowLevel.Address8086;
  655. ***** ^ not supported yet
  656. 323 BEGIN
  657. 324 WITH scrn DO
  658. ***** ^ not supported yet
  659. 325 width := Numbers.Between(1,col2-col1+1,SmartScreen.MaxCol);
  660. ***** ^ undeclared identifier
  661. ***** ^ not supported yet
  662. ***** ^ not supported yet
  663. ***** ^ not supported yet
  664. ***** ^ not supported yet
  665. 326 size := width * Numbers.Between(1,row2-row1+1,SmartScreen.MaxRow)*2;
  666. ***** ^ undeclared identifier
  667. ***** ^ undeclared identifier
  668. ***** ^ not supported yet
  669. ***** ^ not supported yet
  670. ***** ^ not supported yet
  671. ***** ^ not supported yet
  672. 327 (*It's *2 to make room for attribute bytes.*)
  673. 328 IF NOT VStorage.AllocMem( handle, size ) THEN
  674. ***** ^ not supported yet
  675. ***** ^ not supported yet
  676. ***** ^ undeclared identifier
  677. ***** ^ undeclared identifier
  678. 329 StringIO.WriteEol( StringIO.outp, InsufficientMemory );
  679. ***** ^ not supported yet
  680. ***** ^ not supported yet
  681. ***** ^ not supported yet
  682. ***** ^ not supported yet
  683. ***** ^ not supported yet
  684. 330 IF 0 = KbdInput.KeyHit( KbdInput.AnyKeyNum ) THEN END;
  685. ***** ^ not supported yet
  686. ***** ^ not supported yet
  687. ***** ^ not supported yet
  688. ***** ^ not supported yet
  689. 331 HALT;
  690. ***** ^ undeclared identifier
  691. 332 END;
  692. 333 MemPtr.a := VStorage.LockMem( handle );
  693. ***** ^ not supported yet
  694. ***** ^ not supported yet
  695. ***** ^ not supported yet
  696. ***** ^ not supported yet
  697. ***** ^ undeclared identifier
  698. 334 IF (col1 = 1) AND (col2 = SmartScreen.MaxCol) AND
  699. ***** ^ not supported yet
  700. ***** ^ not supported yet
  701. 335 (row1 = 1) AND (row2 = SmartScreen.MaxRow) THEN
  702. ***** ^ not supported yet
  703. ***** ^ not supported yet
  704. 336 (* to save entire screen *)
  705. 337 IF FAPI.VIOREADCELLSTR(
  706. ***** ^ not supported yet
  707. ***** ^ not supported yet
  708. 338 MemPtr.a,
  709. ***** ^ not supported yet
  710. ***** ^ not supported yet
  711. 339 SYSTEM.ADR(size),
  712. ***** ^ not supported yet
  713. ***** ^ not supported yet
  714. ***** ^ undeclared identifier
  715. 340 row1 - 1, col1 - 1, 0 ) # 0 THEN
  716. ***** ^ not supported yet
  717. 341 ErrorManager.WARN( 'VioReadCellStr error' );
  718. ***** ^ not supported yet
  719. ***** ^ not supported yet
  720. ***** ^ not supported yet
  721. 342 END;
  722. 343 ELSE
  723. 344 (* to save only part of screen *)
  724. 345 widmem := 2*width;
  725. ***** ^ undeclared identifier
  726. 346 FOR row := row1 TO row2 DO
  727. 347 IF FAPI.VIOREADCELLSTR(
  728. ***** ^ not supported yet
  729. ***** ^ not supported yet
  730. 348 LowLevel.AddAddr(MemPtr.a, widmem*(row-row1)),
  731. ***** ^ not supported yet
  732. ***** ^ not supported yet
  733. ***** ^ not supported yet
  734. ***** ^ not supported yet
  735. ***** ^ not supported yet
  736. 349 SYSTEM.ADR(widmem),
  737. ***** ^ not supported yet
  738. ***** ^ not supported yet
  739. ***** ^ not supported yet
  740. 350 row - 1, col1 - 1, 0 ) # 0 THEN
  741. ***** ^ not supported yet
  742. 351 ErrorManager.WARN( 'VioReadCellStr error' );
  743. ***** ^ not supported yet
  744. ***** ^ not supported yet
  745. ***** ^ not supported yet
  746. 352 END;
  747. 353 END;
  748. 354 END;
  749. 355 VStorage.UnLockMem( handle );
  750. ***** ^ not supported yet
  751. ***** ^ not supported yet
  752. ***** ^ undeclared identifier
  753. 356 END;
  754. ***** ^ not supported yet
  755. 357 END ScreenSave;
  756. ***** ^ not supported yet
  757. 358
  758. 359
  759. 360 PROCEDURE ScreenRestore(scrn : ScreenType; col, row : CARDINAL);
  760. ***** ^ undeclared identifier
  761. 361 VAR
  762. 362 cnt, offset, widmem: CARDINAL;
  763. 363 MemPtr: LowLevel.Address8086;
  764. ***** ^ not supported yet
  765. 364 RowRestored, NumOfRowsToRestore:CARDINAL;
  766. 365 BEGIN
  767. 366 MemPtr.a := VStorage.LockMem( scrn.handle );
  768. ***** ^ not supported yet
  769. ***** ^ not supported yet
  770. ***** ^ not supported yet
  771. ***** ^ not supported yet
  772. ***** ^ not supported yet
  773. ***** ^ not supported yet
  774. 367 widmem := 2 * scrn.width;
  775. ***** ^ not supported yet
  776. ***** ^ not supported yet
  777. 368 NumOfRowsToRestore := (scrn.size DIV scrn.width) DIV 2;
  778. ***** ^ not supported yet
  779. ***** ^ not supported yet
  780. ***** ^ not supported yet
  781. ***** ^ not supported yet
  782. 369 RowRestored := row-1;
  783. 370 cnt := 0;
  784. 371 REPEAT
  785. 372 offset := cnt * widmem;
  786. 373 IF FAPI.VIOWRTCELLSTR( LowLevel.AddAddr(MemPtr.a, offset),
  787. ***** ^ not supported yet
  788. ***** ^ not supported yet
  789. ***** ^ not supported yet
  790. ***** ^ not supported yet
  791. ***** ^ not supported yet
  792. ***** ^ not supported yet
  793. ***** ^ not supported yet
  794. 374 widmem, RowRestored, col-1, 0 ) # 0 THEN
  795. ***** ^ not supported yet
  796. 375 ErrorManager.WARN("VioWrtCellStr error");
  797. ***** ^ not supported yet
  798. ***** ^ not supported yet
  799. ***** ^ not supported yet
  800. 376 END;
  801. 377 INC(RowRestored);
  802. ***** ^ undeclared identifier
  803. ***** ^ not supported yet
  804. 378 INC(cnt);
  805. ***** ^ undeclared identifier
  806. ***** ^ not supported yet
  807. 379 UNTIL cnt >= NumOfRowsToRestore;
  808. 380 VStorage.UnLockMem( scrn.handle );
  809. ***** ^ not supported yet
  810. ***** ^ not supported yet
  811. ***** ^ not supported yet
  812. ***** ^ not supported yet
  813. 381 VStorage.DeallocMem( scrn.handle, scrn.size );
  814. ***** ^ not supported yet
  815. ***** ^ not supported yet
  816. ***** ^ not supported yet
  817. ***** ^ not supported yet
  818. ***** ^ not supported yet
  819. ***** ^ not supported yet
  820. 382 END ScreenRestore;
  821. ***** ^ not supported yet
  822. 383
  823. 384
  824. 385 PROCEDURE DrawLine( col1, row1, col2, row2: CARDINAL; TheChar:
  825. 386 CHAR );
  826. 387 VAR
  827. 388 row : CARDINAL;
  828. 389 linestr : ARRAY [0..80] OF CHAR;
  829. ***** ^ not supported yet
  830. ***** ^ not supported yet
  831. 390 BEGIN
  832. 391 IF col1 < col2 THEN
  833. 392 (*We're drawing a horizontal line.*)
  834. 393 LowLevel.Fill( SYSTEM.ADR(linestr), 1+HIGH(linestr), TheChar);
  835. ***** ^ not supported yet
  836. ***** ^ not supported yet
  837. ***** ^ not supported yet
  838. ***** ^ not supported yet
  839. ***** ^ not supported yet
  840. ***** ^ undeclared identifier
  841. ***** ^ not supported yet
  842. ***** ^ not supported yet
  843. 394 StrEdit.SetLength( linestr, col2 - col1 +1);
  844. ***** ^ not supported yet
  845. ***** ^ not supported yet
  846. ***** ^ not supported yet
  847. ***** ^ not supported yet
  848. 395 SmartScreen.WriteAt( col1, row1, linestr);
  849. ***** ^ not supported yet
  850. ***** ^ not supported yet
  851. ***** ^ not supported yet
  852. 396 ELSE
  853. 397 (*We're drawing a vertical line.*)
  854. 398 FOR row := row1 TO row2 DO
  855. 399 SmartScreen.WriteAt( col1, row, TheChar );
  856. ***** ^ not supported yet
  857. ***** ^ not supported yet
  858. ***** ^ not supported yet
  859. 400 END;
  860. 401 END;
  861. 402 END DrawLine;
  862. ***** ^ not supported yet
  863. 403
  864. 404 PROCEDURE DrawBox(col1, row1, col2, row2 : CARDINAL);
  865. 405 BEGIN
  866. 406 DrawThisBox( SingleBox, col1, row1, col2, row2 );
  867. ***** ^ undeclared identifier
  868. ***** ^ undeclared identifier
  869. ***** ^ not supported yet
  870. 407 END DrawBox;
  871. ***** ^ not supported yet
  872. 408
  873. 409 PROCEDURE DrawDblBox(col1, row1, col2, row2 : CARDINAL);
  874. 410 BEGIN
  875. 411 DrawThisBox( DoubleBox, col1, row1, col2, row2 );
  876. ***** ^ undeclared identifier
  877. ***** ^ undeclared identifier
  878. ***** ^ not supported yet
  879. 412 END DrawDblBox;
  880. ***** ^ not supported yet
  881. 413
  882. 414
  883. 415 PROCEDURE DrawThisBox( BoxChars: VWindows.BoxStr; col1,
  884. ***** ^ not supported yet
  885. 416 row1, col2, row2 : CARDINAL);
  886. 417 VAR
  887. 418 row, lngth : CARDINAL;
  888. 419 UpperBound, LowerBound: CARDINAL;
  889. 420 linestr : ARRAY [0..127] OF CHAR;
  890. ***** ^ not supported yet
  891. ***** ^ not supported yet
  892. 421 BEGIN
  893. 422 LowLevel.Fill(SYSTEM.ADR(linestr), 1+HIGH(linestr), BoxChars[1] );
  894. ***** ^ not supported yet
  895. ***** ^ not supported yet
  896. ***** ^ not supported yet
  897. ***** ^ not supported yet
  898. ***** ^ not supported yet
  899. ***** ^ undeclared identifier
  900. ***** ^ not supported yet
  901. ***** ^ not supported yet
  902. ***** ^ not supported yet
  903. 423 linestr[0] := BoxChars[0];
  904. ***** ^ not supported yet
  905. ***** ^ not supported yet
  906. ***** ^ not supported yet
  907. ***** ^ not supported yet
  908. 424 lngth := col2-col1+1;
  909. 425 StrEdit.SetLength( linestr, lngth );
  910. ***** ^ not supported yet
  911. ***** ^ not supported yet
  912. ***** ^ not supported yet
  913. ***** ^ not supported yet
  914. 426 linestr[lngth-1] := BoxChars[2];
  915. ***** ^ not supported yet
  916. ***** ^ not supported yet
  917. ***** ^ not supported yet
  918. ***** ^ not supported yet
  919. 427 SmartScreen.AdrWriteAt(col1, row1, SYSTEM.ADR(linestr), lngth);
  920. ***** ^ not supported yet
  921. ***** ^ not supported yet
  922. ***** ^ not supported yet
  923. ***** ^ not supported yet
  924. ***** ^ not supported yet
  925. ***** ^ not supported yet
  926. 428 LowerBound := row1 + 1;
  927. 429 UpperBound := row2 - 1;
  928. 430 FOR row := LowerBound TO UpperBound DO
  929. 431 SmartScreen.AdrWriteAt(col1, row, SYSTEM.ADR(BoxChars[3]), 1);
  930. ***** ^ not supported yet
  931. ***** ^ not supported yet
  932. ***** ^ not supported yet
  933. ***** ^ not supported yet
  934. ***** ^ not supported yet
  935. ***** ^ not supported yet
  936. ***** ^ not supported yet
  937. 432 SmartScreen.AdrWriteAt(col2, row, SYSTEM.ADR(BoxChars[4]), 1);
  938. ***** ^ not supported yet
  939. ***** ^ not supported yet
  940. ***** ^ not supported yet
  941. ***** ^ not supported yet
  942. ***** ^ not supported yet
  943. ***** ^ not supported yet
  944. ***** ^ not supported yet
  945. 433 END;
  946. 434 LowLevel.Fill(SYSTEM.ADR(linestr), 1+HIGH(linestr), BoxChars[6] );
  947. ***** ^ not supported yet
  948. ***** ^ not supported yet
  949. ***** ^ not supported yet
  950. ***** ^ not supported yet
  951. ***** ^ not supported yet
  952. ***** ^ undeclared identifier
  953. ***** ^ not supported yet
  954. ***** ^ not supported yet
  955. ***** ^ not supported yet
  956. 435 linestr[0] := BoxChars[5];
  957. ***** ^ not supported yet
  958. ***** ^ not supported yet
  959. ***** ^ not supported yet
  960. ***** ^ not supported yet
  961. 436 linestr[lngth-1] := BoxChars[7];
  962. ***** ^ not supported yet
  963. ***** ^ not supported yet
  964. ***** ^ not supported yet
  965. ***** ^ not supported yet
  966. 437 SmartScreen.AdrWriteAt(col1, row2, SYSTEM.ADR(linestr), lngth);
  967. ***** ^ not supported yet
  968. ***** ^ not supported yet
  969. ***** ^ not supported yet
  970. ***** ^ not supported yet
  971. ***** ^ not supported yet
  972. ***** ^ not supported yet
  973. 438 END DrawThisBox;
  974. ***** ^ not supported yet
  975. 439
  976. 440
  977. 441 PROCEDURE MsgBox(locatn : VWindows.Compass; TheStr : ARRAY OF
  978. ***** ^ not supported yet
  979. 442 CHAR; LegalKeys: KbdInput.KeyNumSet; VAR KeyPressed : CARDINAL);
  980. ***** ^ not supported yet
  981. ***** ^ not supported yet
  982. 443 CONST
  983. 444 width = 30;
  984. 445 LastRow = 17;
  985. 446 VAR
  986. 447 leng, breakspot, lastbreak : INTEGER;
  987. 448 indx, maxleng, newleng, i, col1, row1, rowspot, colspot : CARDINAL;
  988. 449 screen : ScreenType;
  989. ***** ^ undeclared identifier
  990. 450 msgary : ARRAY [0..LastRow] OF ARRAY [0..width] OF CHAR;
  991. ***** ^ not supported yet
  992. ***** ^ not supported yet
  993. ***** ^ not supported yet
  994. 451 BEGIN
  995. 452 PushColors();
  996. ***** ^ not supported yet
  997. ***** ^ not supported yet
  998. 453 PushCursorCoords();
  999. ***** ^ not supported yet
  1000. ***** ^ not supported yet
  1001. 454 PushCursorHeight();
  1002. ***** ^ not supported yet
  1003. ***** ^ not supported yet
  1004. 455 SmartScreen.SetCursorHeight(0);
  1005. ***** ^ not supported yet
  1006. ***** ^ not supported yet
  1007. ***** ^ not supported yet
  1008. 456 SmartScreen.SetAttribOrColor(MsgForeColor, MsgBackColor, MsgMonoAtrib);
  1009. ***** ^ not supported yet
  1010. ***** ^ not supported yet
  1011. ***** ^ undeclared identifier
  1012. ***** ^ undeclared identifier
  1013. ***** ^ undeclared identifier
  1014. 457 CASE locatn OF
  1015. ***** ^ not supported yet
  1016. 458 VWindows.West, VWindows.NW, VWindows.SW :
  1017. ***** ^ not supported yet
  1018. ***** ^ not supported yet
  1019. ***** ^ not supported yet
  1020. ***** ^ not supported yet
  1021. ***** ^ not supported yet
  1022. ***** ^ not supported yet
  1023. 459 col1 := lftcol;
  1024. 460 | VWindows.North, VWindows.South :
  1025. ***** ^ not supported yet
  1026. ***** ^ not supported yet
  1027. ***** ^ not supported yet
  1028. ***** ^ not supported yet
  1029. 461 col1 := midcol;
  1030. 462 | VWindows.East, VWindows.NE, VWindows.SE :
  1031. ***** ^ not supported yet
  1032. ***** ^ not supported yet
  1033. ***** ^ not supported yet
  1034. ***** ^ not supported yet
  1035. ***** ^ not supported yet
  1036. ***** ^ not supported yet
  1037. 463 col1 := rtcol;
  1038. 464 END;
  1039. 465 CASE locatn OF
  1040. ***** ^ not supported yet
  1041. 466 VWindows.North, VWindows.NW, VWindows.NE :
  1042. ***** ^ not supported yet
  1043. ***** ^ not supported yet
  1044. ***** ^ not supported yet
  1045. ***** ^ not supported yet
  1046. ***** ^ not supported yet
  1047. ***** ^ not supported yet
  1048. 467 row1 := toprow;
  1049. 468 | VWindows.East, VWindows.West :
  1050. ***** ^ not supported yet
  1051. ***** ^ not supported yet
  1052. ***** ^ not supported yet
  1053. ***** ^ not supported yet
  1054. 469 row1 := midrow;
  1055. 470 | VWindows.South, VWindows.SE, VWindows.SW :
  1056. ***** ^ not supported yet
  1057. ***** ^ not supported yet
  1058. ***** ^ not supported yet
  1059. ***** ^ not supported yet
  1060. ***** ^ not supported yet
  1061. ***** ^ not supported yet
  1062. 471 row1 := btmrow;
  1063. 472 END;
  1064. 473 (* now break the text into rows and put it into msgary *)
  1065. 474 leng := M2Strings.Length(TheStr);
  1066. ***** ^ not supported yet
  1067. ***** ^ not supported yet
  1068. ***** ^ not supported yet
  1069. 475 lastbreak := -1;
  1070. 476 maxleng := 23;
  1071. 477 indx := 0;
  1072. 478 REPEAT
  1073. 479 (*If the width of the window is less than the number of chars
  1074. 480 yet to be written.*)
  1075. 481 IF (width < (leng - lastbreak)) THEN
  1076. 482 breakspot := PosUtils.BreakPoint( TheStr, lastbreak + width,
  1077. ***** ^ not supported yet
  1078. ***** ^ not supported yet
  1079. ***** ^ not supported yet
  1080. 483 " -;,\/)]}" );
  1081. ***** ^ not supported yet
  1082. 484 IF breakspot <= lastbreak THEN
  1083. 485 (*We didn't find any better place to break than we did last
  1084. 486 time through, so we have to cut the string in the middle
  1085. 487 of something.*)
  1086. 488 breakspot := (lastbreak + width) - 1;
  1087. 489 END;
  1088. 490 ELSE
  1089. 491 breakspot := leng;
  1090. 492 END;
  1091. 493 newleng := INTEGER(breakspot - lastbreak);
  1092. ***** ^ not supported yet
  1093. 494 (*INTEGER type cast necessary for JPI compiler.*)
  1094. 495 M2Strings.Copy(TheStr, lastbreak+1, newleng, msgary[indx]);
  1095. ***** ^ not supported yet
  1096. ***** ^ not supported yet
  1097. ***** ^ not supported yet
  1098. ***** ^ not supported yet
  1099. ***** ^ not supported yet
  1100. 496 IF newleng>maxleng THEN
  1101. 497 maxleng := newleng;
  1102. 498 END;
  1103. 499 INC(indx);
  1104. ***** ^ undeclared identifier
  1105. ***** ^ not supported yet
  1106. 500 lastbreak := breakspot;
  1107. 501 UNTIL (lastbreak = leng) OR (indx > LastRow);
  1108. 502 ScreenSave(screen, col1, row1, col1+maxleng+3, row1+indx+3);
  1109. ***** ^ not supported yet
  1110. ***** ^ not supported yet
  1111. ***** ^ not supported yet
  1112. 503 SmartScreen.ClearPart(col1, row1, col1+maxleng+3, row1+indx+3);
  1113. ***** ^ not supported yet
  1114. ***** ^ not supported yet
  1115. ***** ^ not supported yet
  1116. 504 (* save & clear an area of the required size *)
  1117. 505 DrawThisBox( SingleBox,col1, row1, col1+maxleng+3, row1+indx+3);
  1118. ***** ^ not supported yet
  1119. ***** ^ undeclared identifier
  1120. ***** ^ not supported yet
  1121. 506 (* draw a box of the required size *)
  1122. 507 colspot := col1+2;
  1123. 508 rowspot := row1+1;
  1124. 509 FOR i := 1 TO indx DO
  1125. 510 (* write text in window *)
  1126. 511 SmartScreen.WriteAt(colspot, rowspot+i, msgary[i-1]);
  1127. ***** ^ not supported yet
  1128. ***** ^ not supported yet
  1129. ***** ^ not supported yet
  1130. ***** ^ not supported yet
  1131. 512 END;
  1132. 513 KeyPressed := KbdInput.KeyHit( LegalKeys );
  1133. ***** ^ not supported yet
  1134. ***** ^ not supported yet
  1135. ***** ^ not supported yet
  1136. 514 ScreenRestore(screen, col1, row1);
  1137. ***** ^ not supported yet
  1138. ***** ^ not supported yet
  1139. ***** ^ not supported yet
  1140. 515 PopCursorCoords();
  1141. ***** ^ not supported yet
  1142. ***** ^ not supported yet
  1143. 516 PopCursorHeight();
  1144. ***** ^ not supported yet
  1145. ***** ^ not supported yet
  1146. 517 PopColors();
  1147. ***** ^ not supported yet
  1148. ***** ^ not supported yet
  1149. 518 (* restore screen, cursor, and mode *)
  1150. 519 END MsgBox;
  1151. ***** ^ not supported yet
  1152. 520
  1153. 521
  1154. 522 PROCEDURE ErrorBox( TheMessage: ARRAY OF CHAR ): BOOLEAN;
  1155. ***** ^ not supported yet
  1156. 523 VAR
  1157. 524 dumkey: CARDINAL;
  1158. 525 dummy: ARRAY [0..255] OF CHAR;
  1159. ***** ^ not supported yet
  1160. ***** ^ not supported yet
  1161. 526 BEGIN
  1162. 527 StrEdit.AssignStr( TheMessage, dummy );
  1163. ***** ^ not supported yet
  1164. ***** ^ not supported yet
  1165. ***** ^ not supported yet
  1166. ***** ^ not supported yet
  1167. 528 StrEdit.Append( dummy, '. Press C to continue, anything else to abort.' );
  1168. ***** ^ not supported yet
  1169. ***** ^ not supported yet
  1170. ***** ^ not supported yet
  1171. ***** ^ not supported yet
  1172. 529 MsgBox( VWindows.NE, dummy, KbdInput.AnyKeyNum, dumkey );
  1173. ***** ^ not supported yet
  1174. ***** ^ not supported yet
  1175. ***** ^ not supported yet
  1176. ***** ^ not supported yet
  1177. ***** ^ not supported yet
  1178. ***** ^ not supported yet
  1179. ***** ^ not supported yet
  1180. 530 RETURN KbdInput.CAPkey( dumkey ) # ORD('C');
  1181. ***** ^ not supported yet
  1182. ***** ^ not supported yet
  1183. ***** ^ not supported yet
  1184. ***** ^ undeclared identifier
  1185. ***** ^ not supported yet
  1186. 531 END ErrorBox;
  1187. ***** ^ not supported yet
  1188. 532
  1189. 533 PROCEDURE RestoreCursor();
  1190. 534 (*We add this procedure to ErrorManager's TermProcList below.*)
  1191. 535 BEGIN
  1192. 536 SmartScreen.SetCursorHeight( StartingCursorHt );
  1193. ***** ^ not supported yet
  1194. ***** ^ not supported yet
  1195. ***** ^ not supported yet
  1196. 537 END RestoreCursor;
  1197. ***** ^ not supported yet
  1198. 538
  1199. 539 PROCEDURE Init();
  1200. 540 BEGIN
  1201. 541 IF Initialized THEN
  1202. 542 RETURN;
  1203. 543 ELSE
  1204. 544 Initialized := TRUE;
  1205. 545 END;
  1206. 546 (*EntryDiag:
  1207. 547 Diagnostics.Init();
  1208. 548 :EntryDiag*)
  1209. 549 ErrorManager.Init();
  1210. ***** ^ not supported yet
  1211. ***** ^ not supported yet
  1212. ***** ^ not supported yet
  1213. 550 KbdInput.Init();
  1214. ***** ^ not supported yet
  1215. ***** ^ not supported yet
  1216. ***** ^ not supported yet
  1217. 551 LowLevel.Init();
  1218. ***** ^ not supported yet
  1219. ***** ^ not supported yet
  1220. ***** ^ not supported yet
  1221. 552 M2Strings.Init();
  1222. ***** ^ not supported yet
  1223. ***** ^ not supported yet
  1224. ***** ^ not supported yet
  1225. 553 Numbers.Init();
  1226. ***** ^ not supported yet
  1227. ***** ^ not supported yet
  1228. ***** ^ not supported yet
  1229. 554 PosUtils.Init();
  1230. ***** ^ not supported yet
  1231. ***** ^ not supported yet
  1232. ***** ^ not supported yet
  1233. 555 SmartScreen.Init();
  1234. ***** ^ not supported yet
  1235. ***** ^ not supported yet
  1236. ***** ^ not supported yet
  1237. 556 StrConv.Init();
  1238. ***** ^ not supported yet
  1239. ***** ^ not supported yet
  1240. ***** ^ not supported yet
  1241. 557 StrEdit.Init();
  1242. ***** ^ not supported yet
  1243. ***** ^ not supported yet
  1244. ***** ^ not supported yet
  1245. 558 StringIO.Init();
  1246. ***** ^ not supported yet
  1247. ***** ^ not supported yet
  1248. ***** ^ not supported yet
  1249. 559 VStorage.Init();
  1250. ***** ^ not supported yet
  1251. ***** ^ not supported yet
  1252. ***** ^ not supported yet
  1253. 560 VWindows.Init();
  1254. ***** ^ not supported yet
  1255. ***** ^ not supported yet
  1256. ***** ^ not supported yet
  1257. 561
  1258. 562 (*EntryDiag:
  1259. 563 Diagnostics.diagS( 'Entering WindowPrims', '' );
  1260. 564 :EntryDiag*)
  1261. 565
  1262. 566 SingleBox[0] := CHR(218);
  1263. ***** ^ undeclared identifier
  1264. ***** ^ not supported yet
  1265. ***** ^ undeclared identifier
  1266. ***** ^ not supported yet
  1267. 567 SingleBox[1] := CHR(196);
  1268. ***** ^ undeclared identifier
  1269. ***** ^ not supported yet
  1270. ***** ^ undeclared identifier
  1271. ***** ^ not supported yet
  1272. 568 SingleBox[2] := CHR(191);
  1273. ***** ^ undeclared identifier
  1274. ***** ^ not supported yet
  1275. ***** ^ undeclared identifier
  1276. ***** ^ not supported yet
  1277. 569 SingleBox[3] := CHR(179);
  1278. ***** ^ undeclared identifier
  1279. ***** ^ not supported yet
  1280. ***** ^ undeclared identifier
  1281. ***** ^ not supported yet
  1282. 570 SingleBox[4] := CHR(179);
  1283. ***** ^ undeclared identifier
  1284. ***** ^ not supported yet
  1285. ***** ^ undeclared identifier
  1286. ***** ^ not supported yet
  1287. 571 SingleBox[5] := CHR(192);
  1288. ***** ^ undeclared identifier
  1289. ***** ^ not supported yet
  1290. ***** ^ undeclared identifier
  1291. ***** ^ not supported yet
  1292. 572 SingleBox[6] := CHR(196);
  1293. ***** ^ undeclared identifier
  1294. ***** ^ not supported yet
  1295. ***** ^ undeclared identifier
  1296. ***** ^ not supported yet
  1297. 573 SingleBox[7] := CHR(217);
  1298. ***** ^ undeclared identifier
  1299. ***** ^ not supported yet
  1300. ***** ^ undeclared identifier
  1301. ***** ^ not supported yet
  1302. 574 SingleBox[8] := 0C;
  1303. ***** ^ undeclared identifier
  1304. ***** ^ not supported yet
  1305. 575 DoubleBox[0] := CHR(201);
  1306. ***** ^ undeclared identifier
  1307. ***** ^ not supported yet
  1308. ***** ^ undeclared identifier
  1309. ***** ^ not supported yet
  1310. 576 DoubleBox[1] := CHR(205);
  1311. ***** ^ undeclared identifier
  1312. ***** ^ not supported yet
  1313. ***** ^ undeclared identifier
  1314. ***** ^ not supported yet
  1315. 577 DoubleBox[2] := CHR(187);
  1316. ***** ^ undeclared identifier
  1317. ***** ^ not supported yet
  1318. ***** ^ undeclared identifier
  1319. ***** ^ not supported yet
  1320. 578 DoubleBox[3] := CHR(186);
  1321. ***** ^ undeclared identifier
  1322. ***** ^ not supported yet
  1323. ***** ^ undeclared identifier
  1324. ***** ^ not supported yet
  1325. 579 DoubleBox[4] := CHR(186);
  1326. ***** ^ undeclared identifier
  1327. ***** ^ not supported yet
  1328. ***** ^ undeclared identifier
  1329. ***** ^ not supported yet
  1330. 580 DoubleBox[5] := CHR(200);
  1331. ***** ^ undeclared identifier
  1332. ***** ^ not supported yet
  1333. ***** ^ undeclared identifier
  1334. ***** ^ not supported yet
  1335. 581 DoubleBox[6] := CHR(205);
  1336. ***** ^ undeclared identifier
  1337. ***** ^ not supported yet
  1338. ***** ^ undeclared identifier
  1339. ***** ^ not supported yet
  1340. 582 DoubleBox[7] := CHR(188);
  1341. ***** ^ undeclared identifier
  1342. ***** ^ not supported yet
  1343. ***** ^ undeclared identifier
  1344. ***** ^ not supported yet
  1345. 583 DoubleBox[8] := 0C;
  1346. ***** ^ undeclared identifier
  1347. ***** ^ not supported yet
  1348. 584 VStorage.NilHandle( NilValue );
  1349. ***** ^ not supported yet
  1350. ***** ^ not supported yet
  1351. ***** ^ not supported yet
  1352. 585
  1353. 586 StartingCursorHt := GetCursorHeight();
  1354. ***** ^ not supported yet
  1355. ***** ^ not supported yet
  1356. 587
  1357. 588 ErrorManager.AbortConfirmed := ErrorBox;
  1358. ***** ^ not supported yet
  1359. ***** ^ not supported yet
  1360. ***** ^ not supported yet
  1361. 589 (*This makes ErrorManager display its messages in a window
  1362. 590 so as not to disturb the rest of the screen.*)
  1363. 591
  1364. 592 ErrorManager.AddTermProc( RestoreCursor );
  1365. ***** ^ not supported yet
  1366. ***** ^ not supported yet
  1367. ***** ^ not supported yet
  1368. 593 (*This prevents us from losing the cursor if we terminate
  1369. 594 abnormally.*)
  1370. 595 ColorStack := NIL;
  1371. ***** ^ not supported yet
  1372. 596 CoordStackTop := NIL;
  1373. ***** ^ not supported yet
  1374. 597 HtStackTop := NIL;
  1375. ***** ^ not supported yet
  1376. 598 MsgForeColor := SmartScreen.lightgrey;
  1377. ***** ^ undeclared identifier
  1378. ***** ^ not supported yet
  1379. ***** ^ not supported yet
  1380. 599 MsgBackColor := SmartScreen.black;
  1381. ***** ^ undeclared identifier
  1382. ***** ^ not supported yet
  1383. ***** ^ not supported yet
  1384. 600 MsgMonoAtrib := SmartScreen.plain;
  1385. ***** ^ undeclared identifier
  1386. ***** ^ not supported yet
  1387. ***** ^ not supported yet
  1388. 601
  1389. 602 (*EntryDiag:
  1390. 603 Diagnostics.diagS( 'Exiting WindowPrims', '' );
  1391. 604 :EntryDiag*)
  1392. 605 END Init;
  1393. ***** ^ not supported yet
  1394. 606
  1395. 607 BEGIN
  1396. 608 Initialized := FALSE;
  1397. 609 Init();
  1398. ***** ^ not supported yet
  1399. ***** ^ not supported yet
  1400. 610 END WindowPrims.
  1401. ***** ^ not supported yet
  1402. 790 errors