Rx Pick Date

RX Library

UNIT
PickDate

Const
PopupCalendarSize

Routine

PopupDate
SelectDate
SelectDateStr


Const PopupCalendarSize
Declaration: PopupCalendarSize: TPoint = (X: 187; Y: 124);;

The PopupCalendarSize global variable can be used to control the size of pop-up calendar in TDateEdit and TDBDateEdit controls.


Routine PopupDate
Declaration: function PopupDate(var Date: TDateTime; Edit: TWinControl): Boolean;

PopDate function pops-up the calendar with Date on the control Edit.

PopupDate example:

if PopupDate(Date1, Edit1) then
begin
__{...}
end;


Routine SelectDate
Declaration: function SelectDate(var Date: TDateTime; const DlgCaption: TCaption; AStartOfWeek: TDayNameOfWeek; AWeekends: TDaysOfWeek; AWeekendColor: TColor; BtnHints: TStrings): Boolean;

function SelectDate pops up a dialog box with Date as a variable to accept the date. The DlgCaption is the caption of the dialogbox. AStartOfWeek defines the start of the week, while AWeekEnds defines the dates which are the weekends, and AWeekEndColour is the AWeekEnds label's colour and BtnHints are the hints strings.

SelectDate example:
__D := SysUtils.Date; { set D to current date }
__if SelectDate(D, 'Select a date', Mon, [Sun], clRed, nil) then
__begin
____{ use selected date }
__end;


Routine SelectDateStr
Declaration: function SelectDateStr(var StrDate: string; const DlgCaption: TCaption; AStartOfWeek: TDayNameOfWeek; AWeekends: TDaysOfWeek; AWeekendColor: TColor; BtnHints: TStrings): Boolean;

SelectDateStr is the same as selectdate with the variable Date returned as a string is.

SelectDateStr example:
SD := DateToStr(SysUtils.Date); { set SD to current date }
if SelectDateStr(SD, 'Select a date', Mon, [Sun], clRed, nil) then
begin
__{ use selected date }
end;


Index Page | About | Download
Creation Date: 4 Feb 1998 | Last Update: 16 Mar 2000