PROMPTS.LST 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. Listing:
  2. 1 IMPLEMENTATION MODULE Prompts;
  3. 2 (*
  4. 3 * ModBase
  5. 4 * Release 3.0
  6. 5 * (c) Copyright 1986 - 1991 PMI
  7. 6 * P.O. Box 8402
  8. 7 * Green Bay Wi 53308
  9. 8 * All Rights Reserved
  10. 9 * by Ed Ross
  11. 10 *)
  12. 11
  13. 12 FROM BigSets IMPORT AppendSet, InitSet;
  14. 13 FROM KbdInput IMPORT AnyKeyNum, KeyHit, KeyNumSet, YorN;
  15. 14 FROM M2Strings IMPORT Length;
  16. 15 FROM MsgBox2 IMPORT MsgOkay, StrMsgBox;
  17. 16 FROM ScrnTypes IMPORT DisplayFrame, InitDisplayFrame;
  18. 17 FROM ScrnUtl2 IMPORT CloseDisplayFrame;
  19. 18 FROM SmartScreen IMPORT ClearPart, SetCursorHeight, WriteAt;
  20. 19 FROM StrConv IMPORT StrToCardinal,ReturnedCard,CardinalToStr;
  21. 20 FROM StrEdit IMPORT AssignStr,CrunchBlanks;
  22. 21 FROM StrInput IMPORT ReadWithEdits;
  23. 22 FROM VWindows IMPORT Compass, CurrentWindow;
  24. 23 FROM WindowPrims IMPORT DrawBox, GetCursorCoords, PopColors,
  25. 24 PopCursorCoords, PopCursorHeight, PushColors, PushCursorCoords,
  26. 25 PushCursorHeight, ScreenRestore, ScreenSave;
  27. 26 IMPORT SYSTEM;
  28. 27
  29. 28 VAR
  30. 29 CH : CHAR;
  31. 30 B : BOOLEAN;
  32. 31 x2 : CARDINAL;
  33. 32
  34. 33 PROCEDURE SetUp;
  35. 34 BEGIN
  36. 35 PushCursorHeight;
  37. ***** ^ not supported yet
  38. 36 PushCursorCoords;
  39. ***** ^ not supported yet
  40. 37 PushColors;
  41. ***** ^ not supported yet
  42. 38 ScreenSave(StatusScr,5,10,x2,15);
  43. ***** ^ not supported yet
  44. ***** ^ undeclared identifier
  45. ***** ^ not supported yet
  46. 39 ClearPart(5,10,x2,15);
  47. ***** ^ not supported yet
  48. ***** ^ not supported yet
  49. 40 DrawBox(5,10,x2,15);
  50. ***** ^ not supported yet
  51. ***** ^ not supported yet
  52. 41 END SetUp;
  53. ***** ^ not supported yet
  54. 42
  55. 43 PROCEDURE TakeDown;
  56. 44 BEGIN
  57. 45 PopCursorHeight;
  58. ***** ^ not supported yet
  59. 46 PopColors;
  60. ***** ^ not supported yet
  61. 47 ScreenRestore(StatusScr,5,10);
  62. ***** ^ not supported yet
  63. ***** ^ undeclared identifier
  64. ***** ^ not supported yet
  65. 48 PopCursorCoords;
  66. ***** ^ not supported yet
  67. 49 END TakeDown;
  68. ***** ^ not supported yet
  69. 50
  70. 51
  71. 52
  72. 53 PROCEDURE Prompt(S1: ARRAY OF CHAR);
  73. ***** ^ not supported yet
  74. 54 VAR Key : CARDINAL;
  75. 55 DF : DisplayFrame;
  76. 56 BEGIN
  77. 57 InitDisplayFrame(DF,CurrentWindow);
  78. ***** ^ not supported yet
  79. ***** ^ not supported yet
  80. ***** ^ not supported yet
  81. 58 DF^.ClearAfter := TRUE;
  82. ***** ^ not supported yet
  83. ***** ^ not supported yet
  84. 59 StrMsgBox(DF,NE,S1);
  85. ***** ^ not supported yet
  86. ***** ^ not supported yet
  87. ***** ^ undeclared identifier
  88. ***** ^ not supported yet
  89. 60 CloseDisplayFrame(DF);
  90. ***** ^ not supported yet
  91. ***** ^ not supported yet
  92. 61 END Prompt;
  93. ***** ^ not supported yet
  94. 62
  95. 63 PROCEDURE PromptStr(S1 : ARRAY OF CHAR; VAR S2 : ARRAY OF CHAR);
  96. ***** ^ not supported yet
  97. ***** ^ not supported yet
  98. 64 VAR
  99. 65 Insert : BOOLEAN;
  100. 66 CurPos : CARDINAL;
  101. 67 LastKey : CARDINAL;
  102. 68 LegalKeys,
  103. 69 ExitKeys : KeyNumSet;
  104. 70 BEGIN
  105. 71 x2 := HIGH(S1) + HIGH(S2)+12;
  106. ***** ^ undeclared identifier
  107. ***** ^ not supported yet
  108. ***** ^ undeclared identifier
  109. ***** ^ not supported yet
  110. 72 SetUp;
  111. ***** ^ not supported yet
  112. 73 WriteAt(12,12,S1);
  113. ***** ^ not supported yet
  114. ***** ^ not supported yet
  115. 74 CurPos := 0;
  116. 75 Insert := TRUE;
  117. 76 LegalKeys := AnyKeyNum;
  118. ***** ^ not supported yet
  119. ***** ^ not supported yet
  120. 77 InitSet(LegalKeys);
  121. ***** ^ not supported yet
  122. ***** ^ not supported yet
  123. 78 InitSet(ExitKeys);
  124. ***** ^ not supported yet
  125. ***** ^ not supported yet
  126. 79 AppendSet(ExitKeys,"{8,9,271,13,27,328,336,329,337}");
  127. ***** ^ not supported yet
  128. ***** ^ not supported yet
  129. ***** ^ not supported yet
  130. 80
  131. 81 (* Means BackSpace, TAB, BackTab, CR, ESC, and the arrow
  132. 82 keys let you out of a field. *)
  133. 83 ReadWithEdits(CurrentWindow,S2,13+Length(S1),12,HIGH(S2),CurPos,
  134. ***** ^ not supported yet
  135. ***** ^ not supported yet
  136. ***** ^ not supported yet
  137. ***** ^ not supported yet
  138. ***** ^ not supported yet
  139. ***** ^ undeclared identifier
  140. ***** ^ not supported yet
  141. 84 Insert,FALSE,LastKey,
  142. 85 AnyKeyNum,ExitKeys);
  143. ***** ^ not supported yet
  144. ***** ^ not supported yet
  145. 86 TakeDown;
  146. ***** ^ not supported yet
  147. 87 END PromptStr;
  148. ***** ^ not supported yet
  149. 88
  150. 89 PROCEDURE PromptNum(S1 : ARRAY OF CHAR;DefaultNbr : CARDINAL): CARDINAL;
  151. ***** ^ not supported yet
  152. 90 VAR
  153. 91 ExitKeys, NumKeys : KeyNumSet;
  154. 92 TmpStr : ARRAY[1..5] OF CHAR;
  155. ***** ^ not supported yet
  156. ***** ^ not supported yet
  157. 93 R,C : CARDINAL;
  158. 94 Len : CARDINAL;
  159. 95 Num : CARDINAL;
  160. 96 Pos : CARDINAL;
  161. 97 InsertMode : BOOLEAN;
  162. 98 LastKey : CARDINAL;
  163. 99
  164. 100 BEGIN
  165. 101 x2 := HIGH(S1) + 5 + 12; (* 5 is for the digits *)
  166. ***** ^ undeclared identifier
  167. ***** ^ not supported yet
  168. 102 SetUp;
  169. ***** ^ not supported yet
  170. 103 GetCursorCoords(C,R);
  171. ***** ^ not supported yet
  172. ***** ^ not supported yet
  173. 104 InitSet(ExitKeys);
  174. ***** ^ not supported yet
  175. ***** ^ not supported yet
  176. 105 AppendSet(ExitKeys,"{8,9,271,13,27,328,336,329,337}");
  177. ***** ^ not supported yet
  178. ***** ^ not supported yet
  179. ***** ^ not supported yet
  180. 106
  181. 107 (* Means BackSpace, TAB, BackTab, CR, ESC, and the arrow
  182. 108 keys let you out of a field. *)
  183. 109 WriteAt(12,12,S1);
  184. ***** ^ not supported yet
  185. ***** ^ not supported yet
  186. 110 InitSet(NumKeys);
  187. ***** ^ not supported yet
  188. ***** ^ not supported yet
  189. 111 AppendSet(NumKeys,'{"0".."9",8,9,271,13,27,328,336,329,337,331,333,339}');
  190. ***** ^ not supported yet
  191. ***** ^ not supported yet
  192. ***** ^ not supported yet
  193. 112
  194. 113 Len := 5;
  195. 114 Pos := 0;
  196. 115 CardinalToStr(DefaultNbr,5,TmpStr);
  197. ***** ^ not supported yet
  198. ***** ^ not supported yet
  199. 116 CrunchBlanks(TmpStr);
  200. ***** ^ not supported yet
  201. ***** ^ not supported yet
  202. 117 ReadWithEdits( CurrentWindow,TmpStr,13+Length(S1),12,Len,Pos,InsertMode,FALSE,
  203. ***** ^ not supported yet
  204. ***** ^ not supported yet
  205. ***** ^ not supported yet
  206. ***** ^ not supported yet
  207. ***** ^ not supported yet
  208. 118 LastKey, NumKeys, ExitKeys );
  209. ***** ^ not supported yet
  210. ***** ^ not supported yet
  211. 119 TakeDown;
  212. ***** ^ not supported yet
  213. 120 RETURN ReturnedCard(TmpStr)
  214. ***** ^ not supported yet
  215. ***** ^ not supported yet
  216. 121 END PromptNum;
  217. ***** ^ not supported yet
  218. 122
  219. 123 PROCEDURE PromptYN(S1 : ARRAY OF CHAR; DFrame : DisplayFrame) : BOOLEAN;
  220. ***** ^ not supported yet
  221. 124 (* Return true for yes ; false for no *)
  222. 125 VAR
  223. 126 DF : DisplayFrame;
  224. 127 Key : CARDINAL;
  225. 128 B : BOOLEAN;
  226. 129 BEGIN
  227. 130 InitDisplayFrame(DF,CurrentWindow);
  228. ***** ^ not supported yet
  229. ***** ^ not supported yet
  230. ***** ^ not supported yet
  231. 131 B := MsgOkay(DF,NW,S1);
  232. ***** ^ not supported yet
  233. ***** ^ not supported yet
  234. ***** ^ undeclared identifier
  235. ***** ^ not supported yet
  236. 132 CloseDisplayFrame(DF);
  237. ***** ^ not supported yet
  238. ***** ^ not supported yet
  239. 133 RETURN B;
  240. 134 END PromptYN;
  241. ***** ^ not supported yet
  242. 135
  243. 136 PROCEDURE DisplayStatus(S1 : ARRAY OF CHAR);
  244. ***** ^ not supported yet
  245. 137 BEGIN
  246. 138 END DisplayStatus;
  247. ***** ^ not supported yet
  248. 139
  249. 140 PROCEDURE RemoveDisplay();
  250. 141 BEGIN
  251. 142 END RemoveDisplay;
  252. ***** ^ not supported yet
  253. 143
  254. 144 BEGIN
  255. 145 END Prompts.
  256. ***** ^ not supported yet
  257. 146
  258. 110 errors