ShowCalendarPopup procedure
Creates, configures, and displays a TCalendarPopupForm instance.
Declaration
procedure ShowCalendarPopup(const APosition: TPoint; ADate: TDateTime;
const CalendarDisplaySettings: TDisplaySettings;
AMinDate: TDateTime; AMaxDate: TDateTime;
const OnReturnDate: TReturnDateEvent;
const OnShowHide: TNotifyEvent=Nil;
ACaller: TControl=Nil)Arguments
APosition | Coordinates where the pop-up calendar form is displayed. |
ADate | Initial date displayed in the Calendar for the form. |
CalendarDisplaySettings | Display settings applied to the Calendar control. |
AMinDate | Minimum date value that can be displayed or selected using the Calendar on the dialog, or an empty value (0.0) when omitted. |
AMaxDate | Minimum date value that can be displayed or selected using the Calendar on the dialog, or an empty value (0.0) when omitted. |
OnReturnDate | Event handler signalled when a new date value is selected. |
OnShowHide | Event handler signalled when the pop-up form is shown or hidden. |
ACaller | The control which creates the pop-up and captures its return value. |
Description
ShowCalendarPopup is an overloaded procedure used to create,
configure, and display a TCalendarPopupForm instance using the arguments
passed to the routine. The argument values are stored to the TCalendar
instance on the dialog form by calling the Initialize method.
ShowCalendarPopup calls the Show method in the form to make it visible. The KeepInView method in the form is called to ensure that the pop-up is fully visible on the current monitor.
ShowCalendarPopup is called from the ButtonClick method in TDateEdit. The caller sets the argument values, including the date range in AMinDate and AMaxDate, to the defaults needed for the control. AMinDate is set to the date value for September 14, 1752 (the start of the Gregorian calendar in England). AMaxDate is set to the date portion of the MaxDateTime constant in the RTL (December 31, 9999). When omitted, an empty TDateTime value (0.0) is used in the arguments and does not impose a date range for the calendar pop-up.
Modified in LCL version 3.0 to include an overloaded variant with minimum and maximum date arguments.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
