Class TDrawCalendar (unit DrawCalendar)

Inherits from

TCustomGrid

Constructors


constructor Create(AOwner: TComponent);



Functions

function IsCurrentMonth(TheDate: TDateTime): Boolean;


procedure NextMonth;


procedure NextYear;


function PasteBitmap(TheDate : TDateTime; TheBitmap : TBitmap) : Boolean;

These are for The DrawCalendar

function PasteIcon(TheDate : TDateTime; TheIcon : TIcon) : Boolean;


function PasteText(TheDate : TDateTime; MyText : string) : Boolean;


procedure PrevMonth;


procedure PrevYear;


procedure UpdateCalendar;


procedure Change;

These are straight from the calendar sample component

Refers to DrawCalendar


procedure ChangeMonth(Delta: Integer);

Given a value of 1 or -1, moves to Next or Prev month accordingly

procedure Click;


function DaysPerMonth(AYear, AMonth: Integer): Integer;


function DaysThisMonth: Integer;

leap-year Feb is special

procedure DrawCell(ACol, ARow: Longint; ARect: TRect; AState: TGridDrawState);


Function GetCoords(TheDate : TDateTime; index : TCoordResults) : Integer;

Specific items to DrawCalendar

This function get the x & y coords for drawing the Icon, Bitmap and text Onto the DrawCalendar depending upon the date paramenter


function IsLeapYear(AYear: Integer): Boolean;


function SelectCell(ACol, ARow: Longint): Boolean;

day names at tops of columns

function StrAsPChar(var S: Openstring): PChar;


procedure WMSize(var Message: TWMSize);

day of week for 1st of month

function GetCellText(ACol, ARow: Integer): string;

From Calendar sample component

This code takes care of those cells without a date number.


function GetDateElement(Index: Integer): Integer;


procedure SetCalendarDate(Value: TDateTime);


procedure SetCol0Color(AColor : TColor);


procedure SetCol1Color(AColor : TColor);


procedure SetCol2Color(AColor : TColor);


procedure SetCol3Color(AColor : TColor);


procedure SetCol4Color(AColor : TColor);


procedure SetCol5Color(AColor : TColor);


procedure SetCol6Color(AColor : TColor);


procedure SetDateBox(Value : Boolean);

SPECIFIC TO DRAW CALENDAR

procedure SetDateElement(Index: Integer; Value: Integer);


procedure SetDateFont(AFont : Tfont);


procedure SetHeaderFont(AFont : Tfont);

Return coord depending upon whicjh is required.

procedure SetLongDay(Value : Boolean);


procedure SetStartOfWeek(Value: TDayOfWeek);


procedure SetTextFont(AFont : Tfont);


procedure SetUseCurrentDate(Value: Boolean);


function StoreCalendarDate: Boolean;


Properties

property Align :


property BorderStyle :


property Color :


property ColumnColor0 : TColor


property ColumnColor1 : TColor


property ColumnColor2 : TColor


property ColumnColor3 : TColor


property ColumnColor4 : TColor


property ColumnColor5 : TColor


property ColumnColor6 : TColor


property Ctl3D :


property DateBox : Boolean


property DateFont : TFont


property Day : Integer


property DefaultColWidth :


property DefaultRowHeight :


property Enabled :


property GridLineWidth :


property HeaderFont : TFont


property Month : Integer


property ParentColor :


property ParentFont :


property ParentShowHint :


property PopupMenu :


property ReadOnly : Boolean


property ShowHint :


property StartOfWeek : TDayOfWeek


property TabOrder :


property TabStop :


property TextFont : TFont


property UseCurrentDate : Boolean


property UseLongDayNames : Boolean


property Visible :


property Year : Integer


property CalendarDate : TDateTime


property canvas :


property CellText : string


property Font :


Events

event OnChange : TNotifyEvent


event OnClick :


event OnDblClick :


event OnDragDrop :


event OnDragOver :


event OnDrawCell : TDrawCellEvent

Specific to DrawCalendar

event OnEndDrag :


event OnEnter :


event OnExit :


event OnKeyDown :


event OnKeyPress :


event OnKeyUp :


event OnMouseDown :


event OnMouseMove :


event OnMouseUp :


Variables

FCol0Color : TColor;


FCol1Color : TColor;


FCol2Color : TColor;


FCol3Color : TColor;


FCol4Color : TColor;


FCol5Color : TColor;


FCol6Color : TColor;


FDate : TDateTime;

From Calendar sample component

FDateBox : Boolean;

These are needed for DrawCalendar

FDateFont : TFont;


FHeaderFont : TFont;


FLongDay : Boolean;


FMonthOffset : Integer;


FOnChange : TNotifyEvent;


FOnDrawCell : TDrawCellEvent;


FReadOnly : Boolean;


FStartOfWeek : TDayOfWeek;


FTextFont : TFont;


FUpdating : Boolean;


FUseCurrentDate : Boolean;



Constructors


constructor Create(AOwner: TComponent);


Functions


function IsCurrentMonth(TheDate: TDateTime): Boolean;


procedure NextMonth;


procedure NextYear;


function PasteBitmap(TheDate : TDateTime; TheBitmap : TBitmap) : Boolean;

These are for The DrawCalendar


function PasteIcon(TheDate : TDateTime; TheIcon : TIcon) : Boolean;


function PasteText(TheDate : TDateTime; MyText : string) : Boolean;


procedure PrevMonth;


procedure PrevYear;


procedure UpdateCalendar;


procedure Change;

These are straight from the calendar sample component

Refers to DrawCalendar


procedure ChangeMonth(Delta: Integer);

Given a value of 1 or -1, moves to Next or Prev month accordingly


procedure Click;


function DaysPerMonth(AYear, AMonth: Integer): Integer;


function DaysThisMonth: Integer;

leap-year Feb is special


procedure DrawCell(ACol, ARow: Longint; ARect: TRect; AState: TGridDrawState);


Function GetCoords(TheDate : TDateTime; index : TCoordResults) : Integer;

Specific items to DrawCalendar

This function get the x & y coords for drawing the Icon, Bitmap and text Onto the DrawCalendar depending upon the date paramenter


function IsLeapYear(AYear: Integer): Boolean;


function SelectCell(ACol, ARow: Longint): Boolean;

day names at tops of columns


function StrAsPChar(var S: Openstring): PChar;


procedure WMSize(var Message: TWMSize);

day of week for 1st of month


function GetCellText(ACol, ARow: Integer): string;

From Calendar sample component

This code takes care of those cells without a date number.


function GetDateElement(Index: Integer): Integer;


procedure SetCalendarDate(Value: TDateTime);


procedure SetCol0Color(AColor : TColor);


procedure SetCol1Color(AColor : TColor);


procedure SetCol2Color(AColor : TColor);


procedure SetCol3Color(AColor : TColor);


procedure SetCol4Color(AColor : TColor);


procedure SetCol5Color(AColor : TColor);


procedure SetCol6Color(AColor : TColor);


procedure SetDateBox(Value : Boolean);

SPECIFIC TO DRAW CALENDAR


procedure SetDateElement(Index: Integer; Value: Integer);


procedure SetDateFont(AFont : Tfont);


procedure SetHeaderFont(AFont : Tfont);

Return coord depending upon whicjh is required.


procedure SetLongDay(Value : Boolean);


procedure SetStartOfWeek(Value: TDayOfWeek);


procedure SetTextFont(AFont : Tfont);


procedure SetUseCurrentDate(Value: Boolean);


function StoreCalendarDate: Boolean;


Properties


property Align :


property BorderStyle :


property Color :


property ColumnColor0 : TColor


property ColumnColor1 : TColor


property ColumnColor2 : TColor


property ColumnColor3 : TColor


property ColumnColor4 : TColor


property ColumnColor5 : TColor


property ColumnColor6 : TColor


property Ctl3D :


property DateBox : Boolean


property DateFont : TFont


property Day : Integer


property DefaultColWidth :


property DefaultRowHeight :


property Enabled :


property GridLineWidth :


property HeaderFont : TFont


property Month : Integer


property ParentColor :


property ParentFont :


property ParentShowHint :


property PopupMenu :


property ReadOnly : Boolean


property ShowHint :


property StartOfWeek : TDayOfWeek


property TabOrder :


property TabStop :


property TextFont : TFont


property UseCurrentDate : Boolean


property UseLongDayNames : Boolean


property Visible :


property Year : Integer


property CalendarDate : TDateTime


property canvas :


property CellText : string


property Font :


Events


event OnChange : TNotifyEvent


event OnClick :


event OnDblClick :


event OnDragDrop :


event OnDragOver :


event OnDrawCell : TDrawCellEvent

Specific to DrawCalendar


event OnEndDrag :


event OnEnter :


event OnExit :


event OnKeyDown :


event OnKeyPress :


event OnKeyUp :


event OnMouseDown :


event OnMouseMove :


event OnMouseUp :


Variables


FCol0Color : TColor;


FCol1Color : TColor;


FCol2Color : TColor;


FCol3Color : TColor;


FCol4Color : TColor;


FCol5Color : TColor;


FCol6Color : TColor;


FDate : TDateTime;

From Calendar sample component


FDateBox : Boolean;

These are needed for DrawCalendar


FDateFont : TFont;


FHeaderFont : TFont;


FLongDay : Boolean;


FMonthOffset : Integer;


FOnChange : TNotifyEvent;


FOnDrawCell : TDrawCellEvent;


FReadOnly : Boolean;


FStartOfWeek : TDayOfWeek;


FTextFont : TFont;


FUpdating : Boolean;


FUseCurrentDate : Boolean;