T Y E A R P L A N N E R R E A D M E |
By Jonathan Hosking |
T A B L E O F C O N T E N T S |
What is the TYearPlanner component? |
W H A T I S T H E T Y E A R P L A N N E R C O M P O N E N T ? |
The TYearPlanner component is a new component I have written for Delphi and C++Builder. It simply looks like a year planner. It can be fully customised if desired. It has the following features: -
The component code was written by modifying some code for my TOffice97Button component. The routine that tests for leap years is the routine used in Delphi 5.0. The code works fine on Delphi 1.0, 2.0, 4.0, 5.0, 6.0 and C++Builder 3.0 & 4.0, but I have not tested it with other versions. You are free to distribute the code, but you may NOT sell it. If you modify the code, you must include me in the acknowledgements. If you do want your ideas or modifications to be incorporated into the latest version, send them to the address at the end of this document. Thanks to Simon Nicholson for helping with the message hook to reduce flickering. Thanks to Richard Haven for helping with the heading setup routine. Thanks to Wolfgang Kleinrath for helping with the data setup routine and providing the code for the original routines for loading and saving cell data to INI files Thanks to Nacho Urenda for helping with the size calculation routine. Thanks to Rob Schoenaker for helping with the drawing routine. Thanks to Robert Gesswein for adding the NoDayPriority and StartDayOfWeek properties, and for helping with the SetColorAtDate routine. Thanks to Paul Fisher for adding printing support, the original routines for loading and saving cell data to streams, and for helping out with the new cell selection routines. Thanks to Paolo Prandini for removing the range check errors in the component routines. Thanks to Max Evans for the navigation buttons and graphical customisation improvements. Thanks to Goldschmidt Jean-Jacques for the selection information routines. Thanks to Roberto Chieregato for the cell images routines. Thanks to Martin Roberts for fixing a bug with cell selections. Thanks to Kaj Ekman for the code to draw images without stretching. Thanks to David Oakes for the code to control the display of default hints. Thanks to Istvan Mesaros for the code for the OnSelectionEnd event. Thanks to Christian Hackbart for
fixing a bug in the cell selection routines. Thanks to Trev for the code
to clear the contents of all the cells and the new year change events. Thanks to Paul Bailey for helping out with the new printing routines. Thanks to Wolf Garber for fixing a bug in the cell selection routines and the printing enhancements. Thanks to Jeurgen Jakob for fixing a bug in the file loading and saving routines. Thanks to Steve Childs
for making the year navigators work in Delphi 1.0. |
H O W T O I N S T A L L T H E T Y E A R P L A N N E R C O M P O N E N T |
To unzip the TYearPlanner component, assuming [Program Path] is the path to Delphi or C++Builder, follow these steps: -
You can now install the component into the component library. Follow the procedure for the version of Delphi or C++Builder that you are using. Delphi 1.0:
Delphi 2.0: This procedure should also work with C++Builder 1.0, but I'm not sure.
Delphi 4.0:
Delphi 5.0:
Delphi 6.0:
C++Builder 3.0: This procedure should also work, with minor modifications, with Delphi 3.0, but I'm not sure.
C++Builder 4.0: This procedure should also work, with minor modifications, with C++Builder 5.0 & 6.0, but I'm not sure.
|
T Y E A R P L A N N E R R E F E R E N C E |
Remarks: Just in case you didn't know, here is how you get information about a cell. You get the day using Day := CurrentDate.Day and the month by using Month := CurrentDate.Month. The date details are then obtained with the following: -
To clear the contents of all the cells, use the ClearCells procedure. To get the start and end dates in a selection, use the GetStartDate and GetEndDate routines. Both routines return a TDateTime as the value. Note that if there is no selection, the values returned will be the current date. To see if a date is selected, use the IsSelected routine. You need to specify the date as a TDateTime, and the return value is a boolean. You can select a cell manually using the SelectCells procedure, specifying two TDateTimes as the start date and end date. You can select a week of cells using the SelectWeek procedure, specifying the week number. To get the week number of a date, use the WeekNumber procedure and specify a TDateTimes as the date. IMPORTANT: The week number is based on the number of whole weeks in the year. Weeks are regarded as starting on the day specified in the StartDayOfWeek variable. To clear the current selection, use the ClearSelection procedure. The SetColorAtDate procedure can be used to set the cell colour of a date. You need to specify the date, as a TDateTime, the cell colour and whether or not the control should immediately show the change. The SetFontAtDate procedure can be used to set the cell font of a date. You need to specify the date, as a TDateTime, the cell font and whether or not the control should immediately show the change. The SetHintAtDate procedure can be used to set the hint of a date. You need to specify the date, as a TDateTime, the hint and whether or not the control should immediately show the change. The SetImageAtDate procedure can be used to set the cell image of a date. You need to specify the date, as a TDateTime, the cell image and whether or not the control should immediately show the change. The GetCellData function is used to retrieve cell data for a date. You specify the date as a TDateTime, and it will return a TCellData with the cell data. IMPORTANT: You must use the SetColorAtDate, SetFontAtDate, SetHintAtDate, SetImageAtDate and GetCellData routines to read and set the CellData variable in C++Builder. Do not directly access the CellData variable. You can use the LoadFromFile and SaveToFile procedures to load and save the cell data to a file. Before you call these procedures, make sure you put Reset(F, 1) or Rewrite(F, 1) to reduce the file size. The first parameter in both statements is a File type. You can use the LoadFromStream and SaveToStream procedures to load and save the cell data to a stream. To identify the cell at a coordinate, use the XYToCell procedure. You need to specify the X and Y coordinates, and two integers for the cell reference to go in to. These make up the grid reference, not the day and month of the cell. Known problems: There is a problem with the control in C++Builder. Basically, due to some strange reason, you cannot directly access the CellData variable. To read the CellData variable, you must use the GetCellData function. To set the CellData variable, use the SetColorAtDate, SetFontAtDate, SetHintAtDate and SetImageAtDate functions. Key properties:
Key events:
Runtime properties:
|
R E V I S I O N H I S T O R Y |
V2.7 (15.12.2001)
V2.61 (04.11.2001)
V2.6 (26.08.2001)
V2.52 (15.08.2001)
V2.51 (12.08.2001)
V2.5 (02.07.2001)
V2.43 (13.04.2001)
V2.42 (17.03.2001)
V2.41 (01.03.2001)
V2.4 (27.02.2001)
V2.33 (25.02.2001)
V2.32 (20.01.2001)
V2.31 (13.01.2001)
V2.3 (07.01.2001)
V2.22 (27.12.2000)
V2.21 (18.11.2000)
V2.2 (04.11.2000)
V2.13 (18/10.2000)
V2.12 (17/10.2000)
V2.11 (07/10.2000)
V2.1 (26.09.2000)
V2.01 (23.07.2000)
V2.0 (18.06.2000)
V1.9 (14.06.2000)
V1.8 (11.03.2000)
V1.75 (07.03.2000)
V1.74 (22.02.2000)
V1.73 (19.02.2000)
V1.72 (12.02.2000)
V1.71 (06.02.2000)
V1.7 (25.01.2000)
V1.63 (22.01.2000)
V1.62 (08.12.1999)
V1.61 (22.11.1999)
V1.6 (21.11.1999)
V1.57 (01.11.1999)
V1.56 (23/10.1999)
V1.55 (02/10.1999)
V1.54 (29.09.1999)
V1.53 (20.09.1999)
V1.52 (13.09.1999)
V1.51 (11.09.1999)
V1.5 (07.09.1999)
V1.4 (04.09.1999)
V1.3 (29.08.1999)
V1.2 (21.08.1999)
V1.12 (17.08.1999)
V1.11 (12.08.1999)
V1.1 (25.05.1999)
V1.0 (26.07.1998)
|
F U T U R E I D E A S |
I currently only have no ideas for future versions of the TYearPlanner
component. |
O T H E R C O M P O N E N T S |
Below is a list other components that I have written: -
|
C O N T A C T I N G M E |
Email: jonathan@the-hoskings.freeserve.co.uk |