home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / BEEHIVE / UTILITYS / WINDOM2.ARC / WINDOWS.DEF < prev    next >
Text File  |  1990-07-21  |  9KB  |  214 lines

  1. DEFINITION MODULE Windows;
  2. (*                                                              *)
  3. (* (C)Copyright 1987 Bob Catiller all commercial rights reserved*)
  4. (*                                                              *)
  5. (* This module provides utilitiy procedures for implementing *)
  6. (* menus that feature pull down windows with graphic borders, *)
  7. (* and highlighted menu items for selection. Procedures are *)
  8. (* provided for opening and closing up to 10 windows. Up to *)
  9. (* 10 graphic border types may be selected for each window. *)
  10. (* Procedures are also provided for highlighting a selected *)
  11. (* line in the window and rotating the highlighting up or *)
  12. (* down in the selected window. Window parameters may be *)
  13. (* read or modified while a window is opened, such as: *)
  14. (*     - window screen origin (X Y coordinates) *)
  15. (*    - window position for writing/reading text *)
  16. (*    - Window text *)
  17. (*    - Window border type *)
  18. (*    - Highlighted window line *)
  19.  
  20. (* Global variables available to user. *)
  21. (* wiStatus is set TRUE if a window function is succesfully *)
  22. (* completed and is set FALSE if the function cannot be  *)
  23. (* completed as requested. IF the end of a line is reached *)
  24. (* when writing to a window then wiEoln is set TRUE. *)
  25. (* If the end of the window is reached then wiEow is set TRUE. *)
  26.  
  27. CONST
  28.   wxz = 80; (* max col *)
  29.   
  30. VAR
  31.   wiStatus, wiEow, wiEoln: BOOLEAN;
  32.   x, y: INTEGER;
  33.  
  34. TYPE
  35.   wst = ARRAY [0..wxz-1] OF CHAR;
  36.  
  37. (* The following procedures are available to the user. *)
  38.  
  39. PROCEDURE wiDelln (no, y: INTEGER);
  40. (* Accepts the window number (no), the line number (y), *)
  41. (* and deletes the selected line of text in the selected *)
  42. (* window. Returns with wiStatus set FALSE if window was *)
  43. (* not open. *)
  44.  
  45. PROCEDURE wiInsln (no, y: INTEGER);
  46. (* Accepts the window number (no), the line number (y), *)
  47. (* and inserts a blank line before the selected line in the selected *)
  48. (* window. Returns with wiStatus set FALSE if window was *)
  49. (* not open. *)
  50.  
  51. PROCEDURE wiClreol (no: INTEGER);
  52. (* Accepts the window number (no) and clears from the *)
  53. (* current window position to the end of the line. *)
  54. (* Returns with wiStatus set FALSE if window was *)
  55. (* not open. *)
  56.  
  57. PROCEDURE wiClear (no: INTEGER);
  58. (* Accepts the window number (no) and clears the *)
  59. (* entire text area in the window parameters of *)
  60. (* the selected window to blanks. *)
  61. (* Does not affect the terminal display. *)
  62. (* Returns with wiStatus set FALSE if window was *)
  63. (* not open. *)
  64.  
  65. PROCEDURE wiHome (no: INTEGER);
  66. (* Accepts the window number (no) and sets the *)
  67. (* window position to the beginning of the first line. *)
  68. (* Returns with wiStatus set FALSE if window was *)
  69. (* not open. *)
  70.  
  71. PROCEDURE wiBorder (no, bt: INTEGER);
  72. (* Accepts the window number (no) and the border type (bt) *)
  73. (* and sets the new border type in the window parameters. *)
  74. (* Returns with wiStatus set FALSE if window was *)
  75. (* not open. *)
  76.  
  77. PROCEDURE wiOpen (no, x, y, w, h, bt: INTEGER);
  78. (* Accepts the window number (no) , screen coordinates *)
  79. (* (x & y), window size (w & h),and the border type (bt). *)
  80. (* Builds a window parameter block for the new window. *)
  81. (* Returns with wiStatus set FALSE if window was *)
  82. (* already open. *)
  83.  
  84. PROCEDURE wiClose (no: INTEGER);
  85. (* Accepts the window number (no) and deallocates the *)
  86. (* window parameter block for the selected window. *)
  87. (* Returns with wiStatus set FALSE if window was *)
  88. (* not previously open. *)
  89.  
  90. PROCEDURE wiGetpos (no: INTEGER; VAR x, y: INTEGER);
  91. (* Accepts the window number (no) and accesses the *)
  92. (* window parameter block for the selected window. *)
  93. (* Returns with x & y set to current window position. *)
  94. (* Returns with wiStatus set FALSE if window was *)
  95. (* not previously open. *)
  96.  
  97. PROCEDURE wiGetorg (no: INTEGER; VAR x, y: INTEGER);
  98. (* Accepts the window number (no) and accesses the *)
  99. (* window parameter block for the selected window. *)
  100. (* Returns with x & y set to current window origin. *)
  101. (* Returns with wiStatus set FALSE if window was *)
  102. (* not open. *)
  103.  
  104. PROCEDURE wiSetpos (no, x, y: INTEGER);
  105. (* Accepts the window number (no) and window position *)
  106. (* (x & y) and then sets the new window position in the *)
  107. (* window parameter block for the selected window. *)
  108. (* Returns with wiStatus set FALSE if window was *)
  109. (* not open. *)
  110.  
  111. PROCEDURE wiSetorg (no, x, y: INTEGER);
  112. (* Accepts the window number (no) and window origin *)
  113. (* (x & y) and then sets the new window position in the *)
  114. (* window parameter block for the selected window. *)
  115. (* Returns with wiStatus set FALSE if window was *)
  116. (* not open. *)
  117.  
  118. PROCEDURE wiPut (no: INTEGER; st: wst);
  119. (* Accepts the window number (no) and window text *)
  120. (* (st) and then writes the text in the *)
  121. (* window parameter block for the selected window. *)
  122. (* Does not update the screen display on the terminal. *)
  123. (* Returns with wiStatus set FALSE if window was *)
  124. (* not open. *)
  125. (* Returns with wiEoln set TRUE if the end of line is reached. *)
  126. (* Returns with wiEow set TRUE if the end of the window *)
  127. (* is reached. *)
  128.  
  129. PROCEDURE wiPutln (no: INTEGER; st: wst);
  130. (* Accepts the window number (no) and window text *)
  131. (* (st) and then writes the text in the *)
  132. (* window parameter block for the selected window. *)
  133. (* Sets the window position to the next line. *)
  134. (* Does not update the screen display on the terminal. *)
  135. (* Returns with wiStatus set FALSE if window was *)
  136. (* not open. *)
  137. (* Returns with wiEoln set TRUE if the end of line is reached. *)
  138. (* Returns with wiEow set TRUE if the end of the window *)
  139. (* is reached. *)
  140.  
  141. PROCEDURE wiWrite (no: INTEGER; st: wst);
  142. (* Accepts the window number (no) and window text *)
  143. (* (st) and then writes the text in the *)
  144. (* window parameter block for the selected window. *)
  145. (* Updates the screen display on the terminal. *)
  146. (* Returns with wiStatus set FALSE if window was *)
  147. (* not open. *)
  148. (* Returns with wiEoln set TRUE if the end of line is reached. *)
  149. (* Returns with wiEow set TRUE if the end of the window *)
  150. (* is reached. *)
  151.  
  152. PROCEDURE wiWriteln (no: INTEGER; st: wst);
  153. (* Accepts the window number (no) and window text *)
  154. (* (st) and then writes the text in the *)
  155. (* window parameter block for the selected window. *)
  156. (* Sets the window position to the next line. *)
  157. (* Updates the screen display on the terminal. *)
  158. (* Returns with wiStatus set FALSE if window was *)
  159. (* not open. *)
  160. (* Returns with wiEoln set TRUE if the end of line is reached. *)
  161. (* Returns with wiEow set TRUE if the end of the window *)
  162. (* is reached. *)
  163.  
  164. PROCEDURE wiShow (no: INTEGER);
  165. (* Accepts the window number (no) and displays the *)
  166. (* entire window on the terminal from the *)
  167. (* window parameter block for the selected window. *)
  168. (* Returns with wiStatus set FALSE if window was *)
  169. (* not open. *)
  170.  
  171. PROCEDURE wiErase (no: INTEGER);
  172. (* Accepts the window number (no) and blanks the *)
  173. (* entire text area of the display on the terminal *)
  174. (* for the selected window. *)
  175. (* Does not affect the text contained in the *)
  176. (* window parameters. *)
  177. (* Returns with wiStatus set FALSE if window was *)
  178. (* not open. *)
  179.  
  180. PROCEDURE wiHlup (no: INTEGER);
  181. (* Accepts the window number (no) and rotates the *)
  182. (* highlighting to the next line up. Updates the *)
  183. (* window parameter block for the selected window. *)
  184. (* Moves to the bottom line if at the top line. *)
  185. (* Displays the updated window on the terminal. *)
  186. (* Returns with wiStatus set FALSE if window was *)
  187. (* not open or if highlighting was disabled. *)
  188.  
  189. PROCEDURE wiHldown (no: INTEGER);
  190. (* Accepts the window number (no) and rotates the *)
  191. (* highlighting to the next line down. Updates the *)
  192. (* window parameter block for the selected window. *)
  193. (* Moves to the top line if at the bottom line. *)
  194. (* Displays the updated window on the terminal. *)
  195. (* Returns with wiStatus set FALSE if window was *)
  196. (* not open or if highlighting was disabled. *)
  197.  
  198. PROCEDURE wiSethl (no, rh: INTEGER);
  199. (* Accepts the window number (no) and row number (rh) *)
  200. (* to be highlighted. A 0 value disables highlighting. *)
  201. (* Updates the window parameter block for the selected window. *)
  202. (* Displays the updated window on the terminal. *)
  203. (* Returns with wiStatus set FALSE if window was *)
  204. (* not open. *)
  205.  
  206. PROCEDURE wiGethl (no: INTEGER);
  207. (* Accepts the window number (no) and accesses the *)
  208. (* window parameter block for the selected window. *)
  209. (* Returns with the highligted row number in y. *)
  210. (* Returns with wiStatus set FALSE if window was *)
  211. (* not open. *)
  212.  
  213. END Windows.
  214.