This is FREEWARE but I am not presently releasing the source code.  Any comments and suggestions are welcome.

DISCLAIMER:
TDrawCalendar is supplied as is. The author disclaims all warranties, expressed or implied, including, without limitation, the warranties of merchantability and of fitness for any purpose. The author assumes no liability for damages,direct or consequential, which may result from the use of TDrawClendar.

Copyright  1996, Andrew J. Williams    andrew@williaj.u-net.com

	
About TDrawCalendar:
	TDrawCalendar is a component based on though not descended from the Calendar in the Samples page of the pallette.  I wanted to unublish a couple of published properties (e.g.Font) which meant I could not descend it directly.  	
	TDrawCalendar is my first component so I do not expect it to be perfect.

 The purpose of this component is to add flexibility to the calendar component
 to allow:
 1. Drawing bitmaps, Icons and text onto particular dates of the calendar.
 2. Allow font setting for the Days of the week, Date numbers and the added text
    as three separate properties (HeaderFont, DateFont and TextFont resp.).


Another property is Datebox : Boolean;
This property draws a box around the date numbers but this can be set to true or false depending on your needs.

The main point of this component is the methods:

function PasteBitmap(TheDate : string; TheBitmap : TBitmap) : Boolean;
function PasteIcon(TheDate : string; TheIcon : TIcon) : Boolean;
function PasteText(TheDate, MyText : string) : Boolean;

Each of these methods can be called from within the calendars OnDrawCell event.
E.G.
for a Bitmap:

   MyBitmap := TBitmap.create;
   MyBitmap.handle := LoadBitmap(Hinstance, 'MYBITMAP'); // Bitmap in resource file
//or if you use an imagelist to keep your bitmaps in you can use:
//   Imagelist1.GetBitmap(0, MyBitmap);
   Calendar1.PasteBitmap('14/5/96', MyBitmap);
   MyBitmap.free;

for text:
   Calendar1.PasteText('5/5/96', 'My Own text!!!');
   Calendar1.PasteText('15/5/96', 'Not my Birthday');

for an icon:
MyIcon := TIcon.create;
MyIcon.LoadFromFile('c:\test\Icon1.ico');
Calendar1.PasteIcon('6/5/96', MyIcon);
MyIcon.free;

Icons allow the use of transparent background which makes the calendar more attractive but I have found that placing icons on the DrawCalendar is slower than placing bitmaps.  


The Column width and Row Height I have tested this component on when drawing text and bitmaps are
Width 81, Row 47.  Bitmaps size is 32 x 32 as are icons and the text is size 8.  This text size allows about 13 characters per cell.

Bitmaps can be of different sizes but you will have to play around with the column width and row height to get this right.  I will be updating this soon to allow more accurate placing of the different size bitmaps.


NOTE:  The more bitmaps that are placed on the DrawCalndar, the slower it re-draws.  I may also try to speed this up in a later release.  The amount of text has less of a bearing on speed.

