home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TURBCA.ZIP / TURBCALC.DOC next >
Encoding:
Text File  |  1989-04-22  |  8.0 KB  |  204 lines

  1. POPCAL.DOC
  2.  
  3. This is the documentation file for the unit TURBOCAL.TPU which is contained
  4. in this archive.  This unit is copyrighted by the author.  Please feel
  5. free to examine and see if it can be of use in your programs.  If you like
  6. the unit and can use it, please send a registration fee of $10.00.
  7.  
  8. Release History:
  9.   Version 1.00  8/21/88
  10.           Original Release
  11.   Version 1.01  8/29/88
  12.           Corrected bug which did not clear screen under help window.
  13.           Added control of all display attributes.
  14.   Version 1.02  4/22/89
  15.           Added a mouse handler to simulate the arrow, PgUp, PgDn,
  16.           Accept and Cancel keys. To enable mouse handler delete the
  17.           period in front of the following statement in the source:
  18.  
  19.           {.$DEFINE USEMOUSE} <-- remove period
  20.  
  21.           The handler functions as follows:
  22.  
  23.           If the mouse cursor is over the Up/Down arrow keys the month
  24.           will be decremented or incremented.
  25.  
  26.           If the mouse cursor is over the Right/Left arrow keys the day
  27.           will be incremented or decremented.
  28.  
  29.           If the mouse cursor is over the PgUp/PgDn letters the year will
  30.           be incremented or decremented.
  31.  
  32.           Placing the cursor over the enter symbol will accept the current
  33.           date.  Finally, placing the cursor over the letter ESC and pressing
  34.           the RIGHT mouse button will abort the request and remove the windows.
  35.  
  36.           PROFESSIONAL  SOFTWARE  TECHNOLOGIES  RELEASES  THIS  SOFTWARE  TO THE
  37.           PUBLIC DOMAIN  AND ACCEPTS NO  RESPONSIBILITY FOR USE  OR INABILITY TO
  38.           USE THE HANDLER PROPERLY  AND YOU DO SO AT YOUR OWN  RISK. IT HAS BEEN
  39.           TESTED AND  APPEARS TO WORK FINE.  THANKS TO THE ORIGINAL  AUTHORS FOR
  40.           THEIR WORK  AND DONT FORGET IF  YOU FIND THIS UNIT  USEFUL TO SEND THE
  41.           REGISTRATION TO  THE ORIGINAL AUTHOR  MENTIONED BELOW AND  NOT PST. IF
  42.           YOU  HAVE ANY  QUESTION PLEASE  FEEL  FREE  TO LEAVE  ME A  MESSAGE ON
  43.           COMPUSERVE. USER ID 72707,2614
  44.  
  45.           Author: Brett Venson
  46.           Professional Software Technologies
  47.           PO Box 2802
  48.           Plainfield NJ 07060
  49.           Compuserve User ID : 72707,2614
  50.  
  51.  
  52. This unit REQUIRES the Turbo Professional 5.0 Library from Turbo Power
  53. Software.  It makes use of the units TPCRT, TPSTRING and TPWINDOW from that
  54. library and most recently the TPMOUSE unit.
  55.  
  56. The unit only has one procedure in the interface section, and that is:
  57.  
  58. procedure calendar(x,y,current_attr,select_attr,other_attr,
  59.                    calframe_attr,calheader_attr,
  60.                    helpframe_attr,helpheader_attr,
  61.                    helptext_attr,helpchars_attr:byte;
  62.                    flag:boolean;var year,month,day:word);
  63.  
  64.  
  65. Paramater Explanation:
  66.  
  67.     x,y:byte
  68.         These are absolute screen coordinates for location of the calendar.
  69.         The unit will automatically adjust these values if the ones passed
  70.         do not allow enough room for the calendar display.
  71.  
  72.     current_attr:byte
  73.         This is the FULL text attribute, i.e. the foreground AND background
  74.         values, used to display the days of the month which is the selected
  75.         month.  If a 0 is passed, the value will default to $0F hex.
  76.  
  77.     select_attr:byte
  78.         This is the FULL text attribute, i.e. the foreground AND background
  79.         values, used to display the day which is the current selected day.
  80.         If a 0 is passed, the value will default to $70 hex.
  81.  
  82.     other_attr:byte
  83.         This is the FULL text attribute, i.e. the foreground and background
  84.         values, used to display the days of the months which precede and
  85.         follow, the current selected month.  If a 0 is passed, the value will
  86.         default to $07 hex.
  87.  
  88.     calframe_attr:byte
  89.         This is the FULL text attribute, for the frame of the calendar window.
  90.         If a 0 is passed, the value will default to $07 hex.
  91.  
  92.     calheader_attr:byte
  93.         This is the FULL text attribute, for the month/year heading in the
  94.         calendar.  If a 0 is passed, the value will default to $70 hex.
  95.  
  96.     helpframe_attr:byte
  97.         This is the FULL text attribute, for the frame of the help window.
  98.         If a 0 is passed, the value will default to $07 hex.
  99.  
  100.     helpheader_attr:byte
  101.         This is the FULL text attribute, for the heading in the help window.
  102.         If a 0 is passed, the value will default to $07 hex.
  103.  
  104.     helptext_attr:byte
  105.         This is the FULL text attribute, for the text displayed in the help
  106.         window. If a 0 is passed, the value will default to $07 hex.
  107.  
  108.     helpchars_attr:byte
  109.         This is the FULL text attribute, for the 'key indicators' in the help
  110.         window.  If a 0 is passed, the value will default to $0F hex.
  111.  
  112.     changeflag:boolean
  113.         This flag determines whether or not you wish to use the unit to
  114.         select a date, or to merely display a calendar.
  115.  
  116.         If the flag is FALSE, then the calendar of the month passed will
  117.         be displayed, and the date passed will be returned in the VAR
  118.         parameters.  The underlying contents of the screen are NOT saved,
  119.         and the programmer will be responsible for removing the calendar
  120.         from the screen.
  121.  
  122.         If the flag is TRUE, then the calendar of the month will be
  123.         displayed, and the user will be allowed to use certain keys to
  124.         select the desired date.  The keys allowed are:
  125.                  UpArrow          Select Previous Month
  126.                  DownArrow        Select Next Month
  127.                  LeftArrow        Select Previous Day
  128.                  RightArrow       Select Next Day
  129.                  PageUp           Select Previous Year
  130.                  PageDown         Select Next Year
  131.                  Return           Accept date which is highlighted
  132.                  Escape           Exit and return 0/0/00 for date
  133.  
  134.         Upon exit, the underlying screen contents ARE restored, and the
  135.         selected date is returned in the VAR parameters.  Along with the
  136.         calendar display, when the changeflag is set to TRUE, a display is
  137.         provided below the calendar which explains the selection keys.
  138.  
  139.     var year,month,day:word
  140.         These parameters contain the original date passed to the unit, and
  141.         if the changeflag was set to TRUE, will contain the selected date
  142.         upon return from the procedure.  If the unit was exited via the
  143.         Escape key, then each parameter will contain a '0'.
  144.  
  145.         This method for the date was selected because there are many
  146.         different methods for constructin Julian dates available, some of
  147.         which are not compatible with others.  Rather than force the
  148.         programmer to use the method used in this unit, the three separate
  149.         parameters were used.
  150.  
  151. The unit will use the CURRENT value of the global constant FrameChars from
  152. TPCrt, to draw the frame on the windows.  To change these characters, a call
  153. to SetFrameChars from TPCrt, IMMEDIATELY before the call to calendar will set
  154. this array to the desired value.
  155.  
  156.  
  157. A sample call to display the calendar for August 1988, WITHOUT allowing for
  158. date selection would look like this:
  159.  
  160. program foo;
  161. var
  162.   year,month,day:word;
  163.  
  164. begin
  165.   ........
  166.   ........
  167.   year:=1988;
  168.   month:=8;
  169.   day:=17;
  170.   calendar(1,1,$0F,$70,$07,0,0,0,0,0,0,false,year,month,day);
  171.   ........
  172.   ........
  173. end.
  174.  
  175. The call which would allow for date selection, would look like this:
  176.  
  177. program foo;
  178. var
  179.   year,month,day:word;
  180.  
  181. begin
  182.   ........
  183.   ........
  184.   year:=1988;
  185.   month:=8;
  186.   day:=17;
  187.   calendar(1,1,$0F,$70,$07,0,0,0,0,0,0,true,year,month,day);
  188.   ........
  189.   ........
  190. end.
  191.  
  192.  
  193. Again, please feel free to test out the unit to see if it can be of use
  194. to you.  If it is useful I would appreciate a $10.00 registration fee. If
  195. you have any questions, suggestions or bugs, contact me by mail, telephone
  196. or on Compuserve.
  197.  
  198. Kenny D. Walker
  199. 1819 Walthour Road
  200. Savannah, Georgia 31410
  201. (912) 897-3437 (Home)
  202. (912) 233-6691 (Work)
  203. Compuserve User Number: 70235,1160
  204.