home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / BASIC / POWBASIC / LIBRARY5 / LRWIND.ZIP / LRWIND.DOC next >
Text File  |  1990-07-09  |  5KB  |  94 lines

  1.     LRWIND.PBU (Leithauser Research Windows) is a simple 
  2. window function for PowerBASIC. The emphasis here is on 
  3. SIMPLE. There are several more powerful wind functions 
  4. available. However, they are more complicated to use. More 
  5. important, they add up to 40 K to your program size, even if 
  6. you don't use most of the features the function offers. 
  7. LRWIND.PBU adds only 4 K.
  8.     To use the window function, just put $LINK "LRWIND.PBU" 
  9. in your program. To call the function, the command is
  10. CALL Wind(XPosition%, YPosition%, BackgroundColor%, 
  11. ForegroundColor%, MessageArray$(), MakeOrRemove%)
  12.     In this command, you can (and probably should) replace 
  13. all of these variables except MessageArray$() with constants. 
  14. Thus, the actual command would look more like
  15. CALL Wind(20,10,0,15,M$(),1)
  16. The variables or constants have the following significance:
  17. XPosition% is the column where the window border starts. That 
  18. is, the left side of the window.
  19. YPosition% is the position of the top of the window border.
  20. BackgroundColor% and ForegroundColor% and the colors of the 
  21. background and foreground of the text within the window.
  22. MessageArray$() is the name of the array that contains the 
  23. text you want to appear in the window. You must put this text 
  24. into the array, starting at MessageArray$(1), before you call 
  25. the window function. The array element after the last line of 
  26. the message must contain an empty string. For example, your 
  27. program might look like this:
  28. M$(1)="First line":M$(2)="Second line":M$(3)="":CALL 
  29. Wind(30,12,0,15,M$(),1)
  30. MakeOrRemove% is either zero or any nonzero number. If the 
  31. number is nonzero the function prints the window on the 
  32. screen. If MakeOrRemove% equals zero, the function removes the 
  33. existing window, restoring the original screen under it. In 
  34. that case, all the other values are dummies, and have no 
  35. effect. However, values of the proper type (integers and a 
  36. string array) must be put in the proper places.
  37.     This window function allows you to put only one window on 
  38. the screen at a time. If you put more than one on the screen 
  39. at once, the function can only remove the last one.
  40.     This window function handles all of the windowing work 
  41. automatically. It looks at the contents of the MessageArray$ 
  42. array and determines how high and wide the window must be. It 
  43. puts a border around the window, saves the screen, and prints 
  44. the window. It then returns control to your program. Your 
  45. program can then take the proper action while the window is on 
  46. the screen. For example, if the contents of MessageArray$ list 
  47. a numbered menu and then say "Press Number of your choice.", 
  48. your program can then wait for a numbered key press. After the 
  49. user presses a key, your program would call the window 
  50. function again with a zero in the MakeOrRemove% position to 
  51. remove the window. The window function restores all 
  52.  
  53.  
  54. parameters, such as printing color and cursor location, 
  55. after a window is either created or removed.
  56.     Because of the border, the window is two lines higher 
  57. than the number of lines in MessageArray$ and four characters 
  58. wider than the longest line in MessageArray$. If you use a 
  59. value for XPosition% or YPosition% that causes the window to 
  60. run off the screen, the window function will move the window 
  61. to avoid this.
  62.     This package contains a BASIC demonstration program, 
  63. WINDDEMO.BAS, to demonstrate how to use the window function. 
  64. Any other questions you might have about using the window 
  65. function should be answered by running and examining this demo 
  66. program.
  67.  
  68. Shareware fee and related stuff
  69.  
  70.     This program is copyrighted. You may distribute the 
  71. package containing LRWIND.PBU, WINDDEMO.BAS, and LRWIND.DOC, 
  72. provided that all three files are kept in the package and you 
  73. do not charge more than a token fee (no more than $10). If you 
  74. use LRWIND.PBU in any of your programs, you are required to 
  75. register the package by sending $5.00 to:
  76.  
  77.                          David Leithauser
  78.                          Leithauser Research
  79.                          4649 Van Kleeck Drive
  80.                          New Smyrna Beach, FL 32169
  81.  
  82.     If you would like the source code for LRWIND.PBU, just 
  83. include an extra $.50 for postage and handling when you 
  84. register, and I will send you a printed listing of the source 
  85. code.
  86.     Once you have registered, you may use LRWIND.PBU in any 
  87. and all of your programs. It is not necessary to pay 
  88. separately each time you use LRWIND.PBU in a new program.
  89.     This package is also a demonstration of the work done by 
  90. Leithauser Research, a custom programming service. If you have 
  91. a need for an unusual program that you cannot find 
  92. commercially, send a description of the program and ask for an 
  93. estimate. Rates are very reasonable.
  94.