MSGBOX1.LST 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. Listing:
  2. 1 IMPLEMENTATION MODULE MsgBox1;
  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/msgbox1.mov 1.5 10 Mar 1991 15:29:44 coleb $
  13. 12 *
  14. 13 *)
  15. 14
  16. 15
  17. 16
  18. 17 IMPORT GenLists;
  19. 18 IMPORT KbdInput;
  20. 19 IMPORT ListUtils;
  21. 20 IMPORT LowLevel;
  22. 21 IMPORT Numbers;
  23. 22 IMPORT NumTypes;
  24. 23 IMPORT SmartScreen;
  25. 24 IMPORT SYSTEM;
  26. 25 IMPORT VWindows;
  27. 26 IMPORT WindowPrims;
  28. 27
  29. 28 VAR
  30. 29 Initialized : BOOLEAN;
  31. 30
  32. 31 PROCEDURE Init();
  33. 32 BEGIN
  34. 33 IF Initialized THEN
  35. 34 RETURN;
  36. 35 ELSE
  37. 36 Initialized := TRUE;
  38. 37 END;
  39. 38 GenLists.Init();
  40. ***** ^ not supported yet
  41. ***** ^ not supported yet
  42. ***** ^ not supported yet
  43. 39 KbdInput.Init();
  44. ***** ^ not supported yet
  45. ***** ^ not supported yet
  46. ***** ^ not supported yet
  47. 40 ListUtils.Init();
  48. ***** ^ not supported yet
  49. ***** ^ not supported yet
  50. ***** ^ not supported yet
  51. 41 LowLevel.Init();
  52. ***** ^ not supported yet
  53. ***** ^ not supported yet
  54. ***** ^ not supported yet
  55. 42 Numbers.Init();
  56. ***** ^ not supported yet
  57. ***** ^ not supported yet
  58. ***** ^ not supported yet
  59. 43 NumTypes.Init();
  60. ***** ^ not supported yet
  61. ***** ^ not supported yet
  62. ***** ^ not supported yet
  63. 44 SmartScreen.Init();
  64. ***** ^ not supported yet
  65. ***** ^ not supported yet
  66. ***** ^ not supported yet
  67. 45 VWindows.Init();
  68. ***** ^ not supported yet
  69. ***** ^ not supported yet
  70. ***** ^ not supported yet
  71. 46 WindowPrims.Init();
  72. ***** ^ not supported yet
  73. ***** ^ not supported yet
  74. ***** ^ not supported yet
  75. 47 END Init;
  76. ***** ^ not supported yet
  77. 48
  78. 49 CONST
  79. 50 lftcol = 4;
  80. 51 toprow = 3;
  81. 52 rtcol = 44;
  82. 53 btmrow = 14;
  83. 54 midcol = 24;
  84. 55 midrow = 9;
  85. 56
  86. 57 (* These define the starting points for the 4 msg box areas *)
  87. 58
  88. 59
  89. 60 PROCEDURE FindCoords( locatn: VWindows.Compass; MaxWidth,
  90. ***** ^ not supported yet
  91. 61 MaxHeight: CARDINAL; VAR col1, row1, col2, row2: CARDINAL );
  92. 62 BEGIN
  93. 63 CASE locatn OF
  94. ***** ^ not supported yet
  95. 64 VWindows.West, VWindows.NW, VWindows.SW :
  96. ***** ^ not supported yet
  97. ***** ^ not supported yet
  98. ***** ^ not supported yet
  99. ***** ^ not supported yet
  100. ***** ^ not supported yet
  101. ***** ^ not supported yet
  102. 65 col1 := lftcol;
  103. 66 | VWindows.North, VWindows.South :
  104. ***** ^ not supported yet
  105. ***** ^ not supported yet
  106. ***** ^ not supported yet
  107. ***** ^ not supported yet
  108. 67 col1 := midcol;
  109. 68 | VWindows.East, VWindows.NE, VWindows.SE :
  110. ***** ^ not supported yet
  111. ***** ^ not supported yet
  112. ***** ^ not supported yet
  113. ***** ^ not supported yet
  114. ***** ^ not supported yet
  115. ***** ^ not supported yet
  116. 69 col1 := rtcol;
  117. 70 END;
  118. 71 CASE locatn OF
  119. ***** ^ not supported yet
  120. 72 VWindows.North, VWindows.NW, VWindows.NE :
  121. ***** ^ not supported yet
  122. ***** ^ not supported yet
  123. ***** ^ not supported yet
  124. ***** ^ not supported yet
  125. ***** ^ not supported yet
  126. ***** ^ not supported yet
  127. 73 row1 := toprow;
  128. 74 | VWindows.East, VWindows.West :
  129. ***** ^ not supported yet
  130. ***** ^ not supported yet
  131. ***** ^ not supported yet
  132. ***** ^ not supported yet
  133. 75 row1 := midrow;
  134. 76 | VWindows.South, VWindows.SE, VWindows.SW :
  135. ***** ^ not supported yet
  136. ***** ^ not supported yet
  137. ***** ^ not supported yet
  138. ***** ^ not supported yet
  139. ***** ^ not supported yet
  140. ***** ^ not supported yet
  141. 77 row1 := btmrow;
  142. 78 END;
  143. 79 col2 := col1 + MaxWidth + 3;
  144. 80 row2 := row1 + MaxHeight + 3;
  145. 81 END FindCoords;
  146. ***** ^ not supported yet
  147. 82
  148. 83
  149. 84 PROCEDURE NullScan( StrAddr: SYSTEM.ADDRESS ): CARDINAL;
  150. ***** ^ not supported yet
  151. 85 BEGIN
  152. 86 RETURN LowLevel.ScanEQ( 32767, 0C, StrAddr );
  153. ***** ^ not supported yet
  154. ***** ^ not supported yet
  155. ***** ^ not supported yet
  156. 87 END NullScan;
  157. ***** ^ not supported yet
  158. 88
  159. 89
  160. 90 PROCEDURE WinMsgBox( TheWindow: VWindows.AWindowHandle;
  161. ***** ^ not supported yet
  162. 91 TextPtr: SYSTEM.ADDRESS; CaptionPtr: SYSTEM.ADDRESS;
  163. ***** ^ not supported yet
  164. ***** ^ not supported yet
  165. 92 WinType: CARDINAL ): CARDINAL;
  166. 93 VAR
  167. 94 TxtLngth, CaptionLngth: CARDINAL;
  168. 95 TmpList: GenLists.GenList;
  169. ***** ^ not supported yet
  170. 96 KeyPressed: CARDINAL;
  171. 97 BEGIN
  172. 98 TxtLngth := NullScan( TextPtr );
  173. ***** ^ not supported yet
  174. ***** ^ not supported yet
  175. 99 CaptionLngth := NullScan( CaptionPtr );
  176. ***** ^ not supported yet
  177. ***** ^ not supported yet
  178. 100 GenLists.NewList( TmpList );
  179. ***** ^ not supported yet
  180. ***** ^ not supported yet
  181. ***** ^ not supported yet
  182. 101 GenLists.ListInsertAdr( TextPtr, TxtLngth,
  183. ***** ^ not supported yet
  184. ***** ^ not supported yet
  185. ***** ^ not supported yet
  186. 102 GenLists.StrCode, TmpList, 1 );
  187. ***** ^ not supported yet
  188. ***** ^ not supported yet
  189. ***** ^ not supported yet
  190. ***** ^ not supported yet
  191. 103 ListMsgBox( VWindows.NE, TmpList, KbdInput.AnyKeyNum,
  192. ***** ^ undeclared identifier
  193. ***** ^ not supported yet
  194. ***** ^ not supported yet
  195. ***** ^ not supported yet
  196. ***** ^ not supported yet
  197. ***** ^ not supported yet
  198. 104 KeyPressed );
  199. ***** ^ not supported yet
  200. 105 GenLists.DisposeList( TmpList );
  201. ***** ^ not supported yet
  202. ***** ^ not supported yet
  203. ***** ^ not supported yet
  204. 106 RETURN KeyPressed;
  205. 107 END WinMsgBox;
  206. ***** ^ not supported yet
  207. 108
  208. 109
  209. 110 PROCEDURE ListMsgBox(locatn : VWindows.Compass; TheList :
  210. ***** ^ not supported yet
  211. 111 GenLists.GenList; LegalKeys: KbdInput.KeyNumSet; VAR KeyPressed :
  212. ***** ^ not supported yet
  213. ***** ^ not supported yet
  214. 112 CARDINAL);
  215. 113 VAR
  216. 114 leng, breakspot, lastbreak, LinesAdded, BytesAdded : INTEGER;
  217. 115 StartLine, CursorLine, CursorCol, LstLngth, maxleng, newleng, i,
  218. 116 col1, row1, col2, row2, rowspot, colspot: CARDINAL;
  219. 117 BytePos : LONGINT;
  220. 118 screen : WindowPrims.ScreenType;
  221. ***** ^ not supported yet
  222. 119 TmpAdr: SYSTEM.ADDRESS;
  223. ***** ^ not supported yet
  224. 120 TypeCode, TmpSize: CARDINAL;
  225. 121
  226. 122 BEGIN
  227. 123 WindowPrims.PushColors();
  228. ***** ^ not supported yet
  229. ***** ^ not supported yet
  230. ***** ^ not supported yet
  231. 124 WindowPrims.PushCursorCoords();
  232. ***** ^ not supported yet
  233. ***** ^ not supported yet
  234. ***** ^ not supported yet
  235. 125 WindowPrims.PushCursorHeight();
  236. ***** ^ not supported yet
  237. ***** ^ not supported yet
  238. ***** ^ not supported yet
  239. 126 SmartScreen.SetCursorHeight(0);
  240. ***** ^ not supported yet
  241. ***** ^ not supported yet
  242. ***** ^ not supported yet
  243. 127 SmartScreen.SetAttribOrColor( WindowPrims.MsgForeColor,
  244. ***** ^ not supported yet
  245. ***** ^ not supported yet
  246. ***** ^ not supported yet
  247. ***** ^ not supported yet
  248. 128 WindowPrims.MsgBackColor, WindowPrims.MsgMonoAtrib );
  249. ***** ^ not supported yet
  250. ***** ^ not supported yet
  251. ***** ^ not supported yet
  252. ***** ^ not supported yet
  253. 129 maxleng := Numbers.Min( ListUtils.LongestLine(
  254. ***** ^ not supported yet
  255. ***** ^ not supported yet
  256. ***** ^ not supported yet
  257. ***** ^ not supported yet
  258. 130 TheList ), SmartScreen.MaxCol - rtcol - 3 );
  259. ***** ^ not supported yet
  260. ***** ^ not supported yet
  261. ***** ^ not supported yet
  262. ***** ^ not supported yet
  263. 131
  264. 132 StartLine := 1;
  265. 133 CursorLine := 1;
  266. 134 CursorCol := 1;
  267. 135 BytePos := NumTypes.L0;
  268. ***** ^ not supported yet
  269. ***** ^ not supported yet
  270. 136 ListUtils.ReformPara( TheList, 0, maxleng - 2, StartLine,
  271. ***** ^ not supported yet
  272. ***** ^ not supported yet
  273. ***** ^ not supported yet
  274. 137 CursorLine, CursorCol, LinesAdded, BytesAdded, BytePos );
  275. ***** ^ not supported yet
  276. 138
  277. 139 LstLngth := Numbers.Min( GenLists.ListLength(
  278. ***** ^ not supported yet
  279. ***** ^ not supported yet
  280. ***** ^ not supported yet
  281. ***** ^ not supported yet
  282. 140 TheList ), SmartScreen.MaxRow - btmrow - 3 );
  283. ***** ^ not supported yet
  284. ***** ^ not supported yet
  285. ***** ^ not supported yet
  286. ***** ^ not supported yet
  287. 141 FindCoords( locatn, maxleng, LstLngth, col1, row1, col2, row2 );
  288. ***** ^ not supported yet
  289. ***** ^ not supported yet
  290. ***** ^ not supported yet
  291. 142 WindowPrims.ScreenSave(screen, col1, row1, col2, row2 );
  292. ***** ^ not supported yet
  293. ***** ^ not supported yet
  294. ***** ^ not supported yet
  295. ***** ^ not supported yet
  296. 143 SmartScreen.ClearPart(col1, row1, col2, row2);
  297. ***** ^ not supported yet
  298. ***** ^ not supported yet
  299. ***** ^ not supported yet
  300. 144 (* save & clear an area of the required size *)
  301. 145 WindowPrims.DrawThisBox( WindowPrims.SingleBox, col1, row1,
  302. ***** ^ not supported yet
  303. ***** ^ not supported yet
  304. ***** ^ not supported yet
  305. ***** ^ not supported yet
  306. 146 col2, row2 );
  307. ***** ^ not supported yet
  308. 147 (* draw a box of the required size *)
  309. 148 colspot := col1+2;
  310. 149 rowspot := row1+1;
  311. 150 FOR i := 1 TO LstLngth DO
  312. 151 (* write text in window *)
  313. 152 GenLists.GetElmtAdr( TheList, i, TmpAdr, TmpSize, TypeCode );
  314. ***** ^ not supported yet
  315. ***** ^ not supported yet
  316. ***** ^ not supported yet
  317. ***** ^ not supported yet
  318. ***** ^ not supported yet
  319. 153 TmpSize := ListUtils.ElmtSize( TheList, i );
  320. ***** ^ not supported yet
  321. ***** ^ not supported yet
  322. ***** ^ not supported yet
  323. ***** ^ not supported yet
  324. 154 IF TypeCode = GenLists.StrCode THEN
  325. ***** ^ not supported yet
  326. ***** ^ not supported yet
  327. 155 SmartScreen.AdrWriteAt( colspot, rowspot+i, TmpAdr, TmpSize );
  328. ***** ^ not supported yet
  329. ***** ^ not supported yet
  330. ***** ^ not supported yet
  331. ***** ^ not supported yet
  332. 156 END;
  333. 157 END;
  334. 158 KeyPressed := KbdInput.KeyHit( LegalKeys );
  335. ***** ^ not supported yet
  336. ***** ^ not supported yet
  337. ***** ^ not supported yet
  338. 159 WindowPrims.ScreenRestore(screen, col1, row1);
  339. ***** ^ not supported yet
  340. ***** ^ not supported yet
  341. ***** ^ not supported yet
  342. ***** ^ not supported yet
  343. 160 WindowPrims.PopCursorCoords();
  344. ***** ^ not supported yet
  345. ***** ^ not supported yet
  346. ***** ^ not supported yet
  347. 161 WindowPrims.PopCursorHeight();
  348. ***** ^ not supported yet
  349. ***** ^ not supported yet
  350. ***** ^ not supported yet
  351. 162 WindowPrims.PopColors();
  352. ***** ^ not supported yet
  353. ***** ^ not supported yet
  354. ***** ^ not supported yet
  355. 163 (* restore screen, cursor, and mode *)
  356. 164 END ListMsgBox;
  357. ***** ^ not supported yet
  358. 165
  359. 166
  360. 167 BEGIN
  361. 168 Initialized := FALSE;
  362. 169 Init();
  363. ***** ^ not supported yet
  364. ***** ^ not supported yet
  365. 170 END MsgBox1.
  366. ***** ^ not supported yet
  367. 195 errors