home *** CD-ROM | disk | FTP | other *** search
- POPCAL.DOC
-
- This is the documentation file for the unit TURBOCAL.TPU which is contained
- in this archive. This unit is copyrighted by the author. Please feel
- free to examine and see if it can be of use in your programs. If you like
- the unit and can use it, please send a registration fee of $10.00.
-
- Release History:
- Version 1.00 8/21/88
- Original Release
- Version 1.01 8/29/88
- Corrected bug which did not clear screen under help window.
- Added control of all display attributes.
- Version 1.02 4/22/89
- Added a mouse handler to simulate the arrow, PgUp, PgDn,
- Accept and Cancel keys. To enable mouse handler delete the
- period in front of the following statement in the source:
-
- {.$DEFINE USEMOUSE} <-- remove period
-
- The handler functions as follows:
-
- If the mouse cursor is over the Up/Down arrow keys the month
- will be decremented or incremented.
-
- If the mouse cursor is over the Right/Left arrow keys the day
- will be incremented or decremented.
-
- If the mouse cursor is over the PgUp/PgDn letters the year will
- be incremented or decremented.
-
- Placing the cursor over the enter symbol will accept the current
- date. Finally, placing the cursor over the letter ESC and pressing
- the RIGHT mouse button will abort the request and remove the windows.
-
- PROFESSIONAL SOFTWARE TECHNOLOGIES RELEASES THIS SOFTWARE TO THE
- PUBLIC DOMAIN AND ACCEPTS NO RESPONSIBILITY FOR USE OR INABILITY TO
- USE THE HANDLER PROPERLY AND YOU DO SO AT YOUR OWN RISK. IT HAS BEEN
- TESTED AND APPEARS TO WORK FINE. THANKS TO THE ORIGINAL AUTHORS FOR
- THEIR WORK AND DONT FORGET IF YOU FIND THIS UNIT USEFUL TO SEND THE
- REGISTRATION TO THE ORIGINAL AUTHOR MENTIONED BELOW AND NOT PST. IF
- YOU HAVE ANY QUESTION PLEASE FEEL FREE TO LEAVE ME A MESSAGE ON
- COMPUSERVE. USER ID 72707,2614
-
- Author: Brett Venson
- Professional Software Technologies
- PO Box 2802
- Plainfield NJ 07060
- Compuserve User ID : 72707,2614
-
-
- This unit REQUIRES the Turbo Professional 5.0 Library from Turbo Power
- Software. It makes use of the units TPCRT, TPSTRING and TPWINDOW from that
- library and most recently the TPMOUSE unit.
-
- The unit only has one procedure in the interface section, and that is:
-
- procedure calendar(x,y,current_attr,select_attr,other_attr,
- calframe_attr,calheader_attr,
- helpframe_attr,helpheader_attr,
- helptext_attr,helpchars_attr:byte;
- flag:boolean;var year,month,day:word);
-
-
- Paramater Explanation:
-
- x,y:byte
- These are absolute screen coordinates for location of the calendar.
- The unit will automatically adjust these values if the ones passed
- do not allow enough room for the calendar display.
-
- current_attr:byte
- This is the FULL text attribute, i.e. the foreground AND background
- values, used to display the days of the month which is the selected
- month. If a 0 is passed, the value will default to $0F hex.
-
- select_attr:byte
- This is the FULL text attribute, i.e. the foreground AND background
- values, used to display the day which is the current selected day.
- If a 0 is passed, the value will default to $70 hex.
-
- other_attr:byte
- This is the FULL text attribute, i.e. the foreground and background
- values, used to display the days of the months which precede and
- follow, the current selected month. If a 0 is passed, the value will
- default to $07 hex.
-
- calframe_attr:byte
- This is the FULL text attribute, for the frame of the calendar window.
- If a 0 is passed, the value will default to $07 hex.
-
- calheader_attr:byte
- This is the FULL text attribute, for the month/year heading in the
- calendar. If a 0 is passed, the value will default to $70 hex.
-
- helpframe_attr:byte
- This is the FULL text attribute, for the frame of the help window.
- If a 0 is passed, the value will default to $07 hex.
-
- helpheader_attr:byte
- This is the FULL text attribute, for the heading in the help window.
- If a 0 is passed, the value will default to $07 hex.
-
- helptext_attr:byte
- This is the FULL text attribute, for the text displayed in the help
- window. If a 0 is passed, the value will default to $07 hex.
-
- helpchars_attr:byte
- This is the FULL text attribute, for the 'key indicators' in the help
- window. If a 0 is passed, the value will default to $0F hex.
-
- changeflag:boolean
- This flag determines whether or not you wish to use the unit to
- select a date, or to merely display a calendar.
-
- If the flag is FALSE, then the calendar of the month passed will
- be displayed, and the date passed will be returned in the VAR
- parameters. The underlying contents of the screen are NOT saved,
- and the programmer will be responsible for removing the calendar
- from the screen.
-
- If the flag is TRUE, then the calendar of the month will be
- displayed, and the user will be allowed to use certain keys to
- select the desired date. The keys allowed are:
- UpArrow Select Previous Month
- DownArrow Select Next Month
- LeftArrow Select Previous Day
- RightArrow Select Next Day
- PageUp Select Previous Year
- PageDown Select Next Year
- Return Accept date which is highlighted
- Escape Exit and return 0/0/00 for date
-
- Upon exit, the underlying screen contents ARE restored, and the
- selected date is returned in the VAR parameters. Along with the
- calendar display, when the changeflag is set to TRUE, a display is
- provided below the calendar which explains the selection keys.
-
- var year,month,day:word
- These parameters contain the original date passed to the unit, and
- if the changeflag was set to TRUE, will contain the selected date
- upon return from the procedure. If the unit was exited via the
- Escape key, then each parameter will contain a '0'.
-
- This method for the date was selected because there are many
- different methods for constructin Julian dates available, some of
- which are not compatible with others. Rather than force the
- programmer to use the method used in this unit, the three separate
- parameters were used.
-
- The unit will use the CURRENT value of the global constant FrameChars from
- TPCrt, to draw the frame on the windows. To change these characters, a call
- to SetFrameChars from TPCrt, IMMEDIATELY before the call to calendar will set
- this array to the desired value.
-
-
- A sample call to display the calendar for August 1988, WITHOUT allowing for
- date selection would look like this:
-
- program foo;
- var
- year,month,day:word;
-
- begin
- ........
- ........
- year:=1988;
- month:=8;
- day:=17;
- calendar(1,1,$0F,$70,$07,0,0,0,0,0,0,false,year,month,day);
- ........
- ........
- end.
-
- The call which would allow for date selection, would look like this:
-
- program foo;
- var
- year,month,day:word;
-
- begin
- ........
- ........
- year:=1988;
- month:=8;
- day:=17;
- calendar(1,1,$0F,$70,$07,0,0,0,0,0,0,true,year,month,day);
- ........
- ........
- end.
-
-
- Again, please feel free to test out the unit to see if it can be of use
- to you. If it is useful I would appreciate a $10.00 registration fee. If
- you have any questions, suggestions or bugs, contact me by mail, telephone
- or on Compuserve.
-
- Kenny D. Walker
- 1819 Walthour Road
- Savannah, Georgia 31410
- (912) 897-3437 (Home)
- (912) 233-6691 (Work)
- Compuserve User Number: 70235,1160