Dec 222017
 
Pop-up calander TP source.
File TURCAL.ZIP from The Programmer’s Corner in
Category Pascal Source Code
Pop-up calander TP source.
File Name File Size Zip Size Zip Type
TURBOCAL.DOC 4762 1714 deflated
TURBOCAL.PAS 18795 5037 deflated
TURBOCAL.TPU 7200 3323 deflated

Download File TURCAL.ZIP Here

Contents of the TURBOCAL.DOC file


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.

This unit REQUIRES the Turbo Professional 4.0 Library from Turbo Power
Software. It makes use of the units TPCRT and TPSTRING from that library.

The unit only has one procedure in the interface section, and that is:

procedure calendar(x,y,current_attr,select_attr,other_attr:byte;
changeflag: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.

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.

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,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,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


 December 22, 2017  Add comments

Leave a Reply