WINDOWPR.MOD 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. IMPLEMENTATION MODULE WindowPrims;
  2. (*
  3. * REPERTOIRE
  4. * Release 1.6
  5. * By Charles Bradford and Cole Brecheen
  6. * (c) Copyright 1985-1992 PMI
  7. * Green Bay, Wisconsin
  8. * All rights reserved
  9. * (414) 468-6040
  10. *
  11. * $Header: D:/logfiles/mods/windowpr.mov 1.9 17 Mar 1991 18:01:28 coleb $
  12. *
  13. *)
  14. (*EntryDiag:
  15. IMPORT Diagnostics;
  16. :EntryDiag*)
  17. IMPORT ErrorManager;
  18. IMPORT KbdInput;
  19. IMPORT LowLevel;
  20. IMPORT M2Strings;
  21. IMPORT Numbers;
  22. IMPORT PosUtils;
  23. IMPORT SmartScreen;
  24. IMPORT StrConv;
  25. IMPORT StrEdit;
  26. IMPORT StringIO;
  27. IMPORT VStorage;
  28. IMPORT VWindows;
  29. IMPORT SYSTEM;
  30. IMPORT FAPI;
  31. VAR
  32. Initialized : BOOLEAN;
  33. CONST
  34. blank = ' ';
  35. null = '';
  36. InsufficientMemory = 'WindowPr -- Too little memory';
  37. StackError = 'Misuse of Push/Pop routines in WindowPrims';
  38. OS2Error =' os/2 returned error from Video subsystem';
  39. backspace = 10C;
  40. CarriageReturn = 15C;
  41. lftcol = 4;
  42. toprow = 3;
  43. rtcol = 44;
  44. btmrow = 14;
  45. midcol = 24;
  46. midrow = 9;
  47. (* These define the starting points for the 4 msg box areas *)
  48. TYPE
  49. Cell =
  50. RECORD
  51. Char, Attribute: CHAR;
  52. END;
  53. VAR
  54. StartingCursorHt : CARDINAL;
  55. NilValue : VStorage.MemHandle;
  56. PROCEDURE GetCursorCoords(VAR column, row : CARDINAL);
  57. BEGIN
  58. IF FAPI.VIOGETCURPOS(SYSTEM.ADR(row), SYSTEM.ADR(column), 0) # 0 THEN
  59. ErrorManager.WARN("VioGetCurPos");
  60. END;
  61. (* Remember that the Repertoire convention is to number
  62. the top left corner 1,1; OS/2 numbers it 0,0. We ought
  63. to follow the OS/2 convention, probably, but changing
  64. now would be difficult. *)
  65. INC(column);
  66. INC(row);
  67. END GetCursorCoords;
  68. PROCEDURE left();
  69. (*Moves the cursor one space left.*)
  70. VAR
  71. col, row : CARDINAL;
  72. BEGIN
  73. GetCursorCoords(col, row);
  74. col := col-1;
  75. SmartScreen.GotoXY(col, row);
  76. END left;
  77. PROCEDURE right();
  78. (*Moves the cursor one space right.*)
  79. VAR
  80. col, row : CARDINAL;
  81. BEGIN
  82. GetCursorCoords(col, row);
  83. col := col+1;
  84. SmartScreen.GotoXY(col, row);
  85. END right;
  86. PROCEDURE up();
  87. (*Moves the cursor one row up.*)
  88. VAR
  89. col, row : CARDINAL;
  90. BEGIN
  91. GetCursorCoords(col, row);
  92. row := row-1;
  93. SmartScreen.GotoXY(col, row);
  94. END up;
  95. PROCEDURE down();
  96. (*Moves the cursor one row down.*)
  97. VAR
  98. col, row : CARDINAL;
  99. BEGIN
  100. GetCursorCoords(col, row);
  101. row := row+1;
  102. SmartScreen.GotoXY(col, row);
  103. END down;
  104. PROCEDURE coord(ColNum, RowNum : CARDINAL) : CARDINAL;
  105. (*Makes it easier to work WITH the routines below, which
  106. treat the screen as a linear sequence OF 4000 bytes.*)
  107. BEGIN
  108. RETURN (Numbers.Between(0,RowNum-1,SmartScreen.MaxRow-1) *
  109. SmartScreen.MaxCol+ Numbers.Between(1,ColNum,
  110. SmartScreen.MaxCol));
  111. END coord;
  112. PROCEDURE WriteVidCh(spot : CARDINAL; TheChar : SmartScreen.VideoMemChar);
  113. BEGIN
  114. SmartScreen.NominalCol := spot MOD SmartScreen.MaxCol;
  115. SmartScreen.NominalRow := (spot DIV SmartScreen.MaxCol)+1;
  116. CASE SmartScreen.VideoMethod OF
  117. SmartScreen.DMA, SmartScreen.ROM :
  118. IF FAPI.VIOWRTCELLSTR( SYSTEM.ADR(TheChar), 1,
  119. SmartScreen.NominalRow, SmartScreen.NominalCol, 0) # 0 THEN
  120. ErrorManager.WARN(OS2Error);
  121. END;
  122. ELSE
  123. SmartScreen.GotoXY(SmartScreen.NominalCol, SmartScreen.NominalRow);
  124. StringIO.WriteStr(StringIO.outp, TheChar.ch);
  125. END;
  126. END WriteVidCh;
  127. TYPE
  128. CoordStackPtr = POINTER TO CoordStackElem;
  129. CoordStackElem =
  130. RECORD
  131. col, row: CARDINAL;
  132. prv: CoordStackPtr;
  133. END;
  134. VAR
  135. CoordStackTop: CoordStackPtr;
  136. PROCEDURE PushCursorCoords();
  137. (*For temporary storage of a cursor position.*)
  138. VAR
  139. tmp: CoordStackPtr;
  140. BEGIN
  141. VStorage.DosAlloc( tmp, SYSTEM.TSIZE(CoordStackElem) );
  142. tmp^.prv := CoordStackTop;
  143. WITH tmp^ DO
  144. GetCursorCoords( col, row );
  145. END;
  146. CoordStackTop := tmp;
  147. END PushCursorCoords;
  148. PROCEDURE PopCursorCoords();
  149. VAR
  150. tmp: CoordStackPtr;
  151. BEGIN
  152. tmp := CoordStackTop;
  153. IF tmp = NIL THEN
  154. ErrorManager.WARN( StackError );
  155. END;
  156. WITH tmp^ DO
  157. SmartScreen.GotoXY( col, row );
  158. SmartScreen.NominalCol := col;
  159. SmartScreen.NominalRow := row;
  160. END;
  161. CoordStackTop := CoordStackTop^.prv;
  162. VStorage.DosDealloc( tmp, SYSTEM.TSIZE(CoordStackElem) );
  163. END PopCursorCoords;
  164. PROCEDURE GetCursorHeight(): CARDINAL;
  165. VAR
  166. CursorData: FAPI.VIOCURSORINFO;
  167. ErrorNum, height: CARDINAL;
  168. BEGIN
  169. ErrorNum := FAPI.VIOGETCURTYPE( SYSTEM.ADR(CursorData), 0 );
  170. IF ErrorNum # 0 THEN
  171. ErrorManager.WarnNumber("VIOGETCURTYPE error", ErrorNum);
  172. END;
  173. IF (CursorData.cEnd<CursorData.yStart) OR
  174. (CursorData.attr=CARDINAL(-1)) THEN
  175. height := 0;
  176. ELSE
  177. height := (CursorData.cEnd - CursorData.yStart) + 1;
  178. END;
  179. RETURN height;
  180. END GetCursorHeight;
  181. TYPE
  182. HtStackPtr = POINTER TO HtStackElem;
  183. HtStackElem =
  184. RECORD
  185. ht: CARDINAL;
  186. prv: HtStackPtr;
  187. END;
  188. VAR
  189. HtStackTop: HtStackPtr;
  190. PROCEDURE PushCursorHeight();
  191. VAR
  192. tmp: HtStackPtr;
  193. BEGIN
  194. VStorage.DosAlloc( tmp, SYSTEM.TSIZE(HtStackElem) );
  195. tmp^.prv := HtStackTop;
  196. tmp^.ht := GetCursorHeight();
  197. HtStackTop := tmp;
  198. END PushCursorHeight;
  199. PROCEDURE PopCursorHeight();
  200. VAR
  201. tmp: HtStackPtr;
  202. BEGIN
  203. tmp := HtStackTop;
  204. IF tmp = NIL THEN
  205. ErrorManager.WARN( StackError );
  206. END;
  207. SmartScreen.SetCursorHeight( tmp^.ht );
  208. HtStackTop := tmp^.prv;
  209. VStorage.DosDealloc( tmp, SYSTEM.TSIZE(HtStackElem) );
  210. END PopCursorHeight;
  211. TYPE
  212. (* Type used for Global Color Stack *)
  213. CStackP = POINTER TO CStack;
  214. CStack =
  215. RECORD
  216. forec, backc: SmartScreen.Colors;
  217. prv: CStackP;
  218. END;
  219. VAR
  220. ColorStack: CStackP; (* Global Color Stack *)
  221. PROCEDURE PushColors();
  222. (* Pushes fore and back ground on color stack *)
  223. VAR
  224. TmpStack: CStackP;
  225. BEGIN
  226. VStorage.DosAlloc( TmpStack, SYSTEM.TSIZE(CStack) );
  227. TmpStack^.prv := ColorStack;
  228. ColorStack := TmpStack;
  229. ColorStack^.forec := SmartScreen.ForeGround;
  230. ColorStack^.backc := SmartScreen.BackGround;
  231. END PushColors;
  232. PROCEDURE PopColors();
  233. (* Pops fore and back ground from color stack *)
  234. VAR
  235. TmpStack: CStackP;
  236. BEGIN
  237. IF ColorStack = NIL THEN
  238. ErrorManager.WARN( StackError );
  239. END;
  240. SmartScreen.TextColor( ColorStack^.forec, ColorStack^.backc);
  241. TmpStack := ColorStack;
  242. ColorStack := ColorStack^.prv;
  243. VStorage.DosDealloc( TmpStack, SYSTEM.TSIZE(CStack) );
  244. END PopColors;
  245. PROCEDURE ScrollWindow(col1, row1, col2, row2, lines : INTEGER);
  246. VAR
  247. BackGroundCell:Cell;
  248. vertdist : INTEGER;
  249. row, backg, StartingSpot, horizdist,
  250. widmem : CARDINAL;
  251. BEGIN
  252. col1 := Numbers.Min( col1, SmartScreen.MaxCol );
  253. col2 := Numbers.Min( col2, SmartScreen.MaxCol );
  254. row1 := Numbers.Min( row1, SmartScreen.MaxRow );
  255. row2 := Numbers.Min( row2, SmartScreen.MaxRow );
  256. vertdist := (row2 - row1) + 1;
  257. IF lines > 0 THEN
  258. lines := Numbers.Min( vertdist, lines );
  259. ELSE
  260. lines := - INTEGER(Numbers.Min( vertdist, ABS(lines) ));
  261. END;
  262. IF (lines = 0) OR (ABS(lines) = vertdist) THEN
  263. (* clear the entire window *)
  264. SmartScreen.ClearPart( col1, row1, col2, row2);
  265. ELSE
  266. BackGroundCell.Char := ' ';
  267. backg := ORD(SmartScreen.BackGround);
  268. LowLevel.ShiftLeft(backg, 4);
  269. BackGroundCell.Attribute := CHR(ORD(SmartScreen.ForeGround)+backg);
  270. IF lines < 0 THEN
  271. IF FAPI.VIOSCROLLDN(row1-1,col1-1,row2-1,col2-1,ABS(lines),
  272. SYSTEM.ADR(BackGroundCell.Char),0) # 0 THEN
  273. ErrorManager.WARN('scrolldn error');
  274. END;
  275. ELSE
  276. IF FAPI.VIOSCROLLUP(row1-1,col1-1,row2-1,col2-1,ABS(lines),
  277. SYSTEM.ADR(BackGroundCell.Char),0) #0 THEN
  278. ErrorManager.WARN('scrollup error');
  279. END;
  280. END;
  281. END;
  282. END ScrollWindow;
  283. PROCEDURE ScreenSave(VAR scrn : ScreenType; col1, row1, col2,
  284. row2 : CARDINAL);
  285. VAR
  286. row, widmem : CARDINAL;
  287. MemPtr: LowLevel.Address8086;
  288. BEGIN
  289. WITH scrn DO
  290. width := Numbers.Between(1,col2-col1+1,SmartScreen.MaxCol);
  291. size := width * Numbers.Between(1,row2-row1+1,SmartScreen.MaxRow)*2;
  292. (*It's *2 to make room for attribute bytes.*)
  293. IF NOT VStorage.AllocMem( handle, size ) THEN
  294. StringIO.WriteEol( StringIO.outp, InsufficientMemory );
  295. IF 0 = KbdInput.KeyHit( KbdInput.AnyKeyNum ) THEN END;
  296. HALT;
  297. END;
  298. MemPtr.a := VStorage.LockMem( handle );
  299. IF (col1 = 1) AND (col2 = SmartScreen.MaxCol) AND
  300. (row1 = 1) AND (row2 = SmartScreen.MaxRow) THEN
  301. (* to save entire screen *)
  302. IF FAPI.VIOREADCELLSTR(
  303. MemPtr.a,
  304. SYSTEM.ADR(size),
  305. row1 - 1, col1 - 1, 0 ) # 0 THEN
  306. ErrorManager.WARN( 'VioReadCellStr error' );
  307. END;
  308. ELSE
  309. (* to save only part of screen *)
  310. widmem := 2*width;
  311. FOR row := row1 TO row2 DO
  312. IF FAPI.VIOREADCELLSTR(
  313. LowLevel.AddAddr(MemPtr.a, widmem*(row-row1)),
  314. SYSTEM.ADR(widmem),
  315. row - 1, col1 - 1, 0 ) # 0 THEN
  316. ErrorManager.WARN( 'VioReadCellStr error' );
  317. END;
  318. END;
  319. END;
  320. VStorage.UnLockMem( handle );
  321. END;
  322. END ScreenSave;
  323. PROCEDURE ScreenRestore(scrn : ScreenType; col, row : CARDINAL);
  324. VAR
  325. cnt, offset, widmem: CARDINAL;
  326. MemPtr: LowLevel.Address8086;
  327. RowRestored, NumOfRowsToRestore:CARDINAL;
  328. BEGIN
  329. MemPtr.a := VStorage.LockMem( scrn.handle );
  330. widmem := 2 * scrn.width;
  331. NumOfRowsToRestore := (scrn.size DIV scrn.width) DIV 2;
  332. RowRestored := row-1;
  333. cnt := 0;
  334. REPEAT
  335. offset := cnt * widmem;
  336. IF FAPI.VIOWRTCELLSTR( LowLevel.AddAddr(MemPtr.a, offset),
  337. widmem, RowRestored, col-1, 0 ) # 0 THEN
  338. ErrorManager.WARN("VioWrtCellStr error");
  339. END;
  340. INC(RowRestored);
  341. INC(cnt);
  342. UNTIL cnt >= NumOfRowsToRestore;
  343. VStorage.UnLockMem( scrn.handle );
  344. VStorage.DeallocMem( scrn.handle, scrn.size );
  345. END ScreenRestore;
  346. PROCEDURE DrawLine( col1, row1, col2, row2: CARDINAL; TheChar:
  347. CHAR );
  348. VAR
  349. row : CARDINAL;
  350. linestr : ARRAY [0..80] OF CHAR;
  351. BEGIN
  352. IF col1 < col2 THEN
  353. (*We're drawing a horizontal line.*)
  354. LowLevel.Fill( SYSTEM.ADR(linestr), 1+HIGH(linestr), TheChar);
  355. StrEdit.SetLength( linestr, col2 - col1 +1);
  356. SmartScreen.WriteAt( col1, row1, linestr);
  357. ELSE
  358. (*We're drawing a vertical line.*)
  359. FOR row := row1 TO row2 DO
  360. SmartScreen.WriteAt( col1, row, TheChar );
  361. END;
  362. END;
  363. END DrawLine;
  364. PROCEDURE DrawBox(col1, row1, col2, row2 : CARDINAL);
  365. BEGIN
  366. DrawThisBox( SingleBox, col1, row1, col2, row2 );
  367. END DrawBox;
  368. PROCEDURE DrawDblBox(col1, row1, col2, row2 : CARDINAL);
  369. BEGIN
  370. DrawThisBox( DoubleBox, col1, row1, col2, row2 );
  371. END DrawDblBox;
  372. PROCEDURE DrawThisBox( BoxChars: VWindows.BoxStr; col1,
  373. row1, col2, row2 : CARDINAL);
  374. VAR
  375. row, lngth : CARDINAL;
  376. UpperBound, LowerBound: CARDINAL;
  377. linestr : ARRAY [0..127] OF CHAR;
  378. BEGIN
  379. LowLevel.Fill(SYSTEM.ADR(linestr), 1+HIGH(linestr), BoxChars[1] );
  380. linestr[0] := BoxChars[0];
  381. lngth := col2-col1+1;
  382. StrEdit.SetLength( linestr, lngth );
  383. linestr[lngth-1] := BoxChars[2];
  384. SmartScreen.AdrWriteAt(col1, row1, SYSTEM.ADR(linestr), lngth);
  385. LowerBound := row1 + 1;
  386. UpperBound := row2 - 1;
  387. FOR row := LowerBound TO UpperBound DO
  388. SmartScreen.AdrWriteAt(col1, row, SYSTEM.ADR(BoxChars[3]), 1);
  389. SmartScreen.AdrWriteAt(col2, row, SYSTEM.ADR(BoxChars[4]), 1);
  390. END;
  391. LowLevel.Fill(SYSTEM.ADR(linestr), 1+HIGH(linestr), BoxChars[6] );
  392. linestr[0] := BoxChars[5];
  393. linestr[lngth-1] := BoxChars[7];
  394. SmartScreen.AdrWriteAt(col1, row2, SYSTEM.ADR(linestr), lngth);
  395. END DrawThisBox;
  396. PROCEDURE MsgBox(locatn : VWindows.Compass; TheStr : ARRAY OF
  397. CHAR; LegalKeys: KbdInput.KeyNumSet; VAR KeyPressed : CARDINAL);
  398. CONST
  399. width = 30;
  400. LastRow = 17;
  401. VAR
  402. leng, breakspot, lastbreak : INTEGER;
  403. indx, maxleng, newleng, i, col1, row1, rowspot, colspot : CARDINAL;
  404. screen : ScreenType;
  405. msgary : ARRAY [0..LastRow] OF ARRAY [0..width] OF CHAR;
  406. BEGIN
  407. PushColors();
  408. PushCursorCoords();
  409. PushCursorHeight();
  410. SmartScreen.SetCursorHeight(0);
  411. SmartScreen.SetAttribOrColor(MsgForeColor, MsgBackColor, MsgMonoAtrib);
  412. CASE locatn OF
  413. VWindows.West, VWindows.NW, VWindows.SW :
  414. col1 := lftcol;
  415. | VWindows.North, VWindows.South :
  416. col1 := midcol;
  417. | VWindows.East, VWindows.NE, VWindows.SE :
  418. col1 := rtcol;
  419. END;
  420. CASE locatn OF
  421. VWindows.North, VWindows.NW, VWindows.NE :
  422. row1 := toprow;
  423. | VWindows.East, VWindows.West :
  424. row1 := midrow;
  425. | VWindows.South, VWindows.SE, VWindows.SW :
  426. row1 := btmrow;
  427. END;
  428. (* now break the text into rows and put it into msgary *)
  429. leng := M2Strings.Length(TheStr);
  430. lastbreak := -1;
  431. maxleng := 23;
  432. indx := 0;
  433. REPEAT
  434. (*If the width of the window is less than the number of chars
  435. yet to be written.*)
  436. IF (width < (leng - lastbreak)) THEN
  437. breakspot := PosUtils.BreakPoint( TheStr, lastbreak + width,
  438. " -;,\/)]}" );
  439. IF breakspot <= lastbreak THEN
  440. (*We didn't find any better place to break than we did last
  441. time through, so we have to cut the string in the middle
  442. of something.*)
  443. breakspot := (lastbreak + width) - 1;
  444. END;
  445. ELSE
  446. breakspot := leng;
  447. END;
  448. newleng := INTEGER(breakspot - lastbreak);
  449. (*INTEGER type cast necessary for JPI compiler.*)
  450. M2Strings.Copy(TheStr, lastbreak+1, newleng, msgary[indx]);
  451. IF newleng>maxleng THEN
  452. maxleng := newleng;
  453. END;
  454. INC(indx);
  455. lastbreak := breakspot;
  456. UNTIL (lastbreak = leng) OR (indx > LastRow);
  457. ScreenSave(screen, col1, row1, col1+maxleng+3, row1+indx+3);
  458. SmartScreen.ClearPart(col1, row1, col1+maxleng+3, row1+indx+3);
  459. (* save & clear an area of the required size *)
  460. DrawThisBox( SingleBox,col1, row1, col1+maxleng+3, row1+indx+3);
  461. (* draw a box of the required size *)
  462. colspot := col1+2;
  463. rowspot := row1+1;
  464. FOR i := 1 TO indx DO
  465. (* write text in window *)
  466. SmartScreen.WriteAt(colspot, rowspot+i, msgary[i-1]);
  467. END;
  468. KeyPressed := KbdInput.KeyHit( LegalKeys );
  469. ScreenRestore(screen, col1, row1);
  470. PopCursorCoords();
  471. PopCursorHeight();
  472. PopColors();
  473. (* restore screen, cursor, and mode *)
  474. END MsgBox;
  475. PROCEDURE ErrorBox( TheMessage: ARRAY OF CHAR ): BOOLEAN;
  476. VAR
  477. dumkey: CARDINAL;
  478. dummy: ARRAY [0..255] OF CHAR;
  479. BEGIN
  480. StrEdit.AssignStr( TheMessage, dummy );
  481. StrEdit.Append( dummy, '. Press C to continue, anything else to abort.' );
  482. MsgBox( VWindows.NE, dummy, KbdInput.AnyKeyNum, dumkey );
  483. RETURN KbdInput.CAPkey( dumkey ) # ORD('C');
  484. END ErrorBox;
  485. PROCEDURE RestoreCursor();
  486. (*We add this procedure to ErrorManager's TermProcList below.*)
  487. BEGIN
  488. SmartScreen.SetCursorHeight( StartingCursorHt );
  489. END RestoreCursor;
  490. PROCEDURE Init();
  491. BEGIN
  492. IF Initialized THEN
  493. RETURN;
  494. ELSE
  495. Initialized := TRUE;
  496. END;
  497. (*EntryDiag:
  498. Diagnostics.Init();
  499. :EntryDiag*)
  500. ErrorManager.Init();
  501. KbdInput.Init();
  502. LowLevel.Init();
  503. M2Strings.Init();
  504. Numbers.Init();
  505. PosUtils.Init();
  506. SmartScreen.Init();
  507. StrConv.Init();
  508. StrEdit.Init();
  509. StringIO.Init();
  510. VStorage.Init();
  511. VWindows.Init();
  512. (*EntryDiag:
  513. Diagnostics.diagS( 'Entering WindowPrims', '' );
  514. :EntryDiag*)
  515. SingleBox[0] := CHR(218);
  516. SingleBox[1] := CHR(196);
  517. SingleBox[2] := CHR(191);
  518. SingleBox[3] := CHR(179);
  519. SingleBox[4] := CHR(179);
  520. SingleBox[5] := CHR(192);
  521. SingleBox[6] := CHR(196);
  522. SingleBox[7] := CHR(217);
  523. SingleBox[8] := 0C;
  524. DoubleBox[0] := CHR(201);
  525. DoubleBox[1] := CHR(205);
  526. DoubleBox[2] := CHR(187);
  527. DoubleBox[3] := CHR(186);
  528. DoubleBox[4] := CHR(186);
  529. DoubleBox[5] := CHR(200);
  530. DoubleBox[6] := CHR(205);
  531. DoubleBox[7] := CHR(188);
  532. DoubleBox[8] := 0C;
  533. VStorage.NilHandle( NilValue );
  534. StartingCursorHt := GetCursorHeight();
  535. ErrorManager.AbortConfirmed := ErrorBox;
  536. (*This makes ErrorManager display its messages in a window
  537. so as not to disturb the rest of the screen.*)
  538. ErrorManager.AddTermProc( RestoreCursor );
  539. (*This prevents us from losing the cursor if we terminate
  540. abnormally.*)
  541. ColorStack := NIL;
  542. CoordStackTop := NIL;
  543. HtStackTop := NIL;
  544. MsgForeColor := SmartScreen.lightgrey;
  545. MsgBackColor := SmartScreen.black;
  546. MsgMonoAtrib := SmartScreen.plain;
  547. (*EntryDiag:
  548. Diagnostics.diagS( 'Exiting WindowPrims', '' );
  549. :EntryDiag*)
  550. END Init;
  551. BEGIN
  552. Initialized := FALSE;
  553. Init();
  554. END WindowPrims.
  555.