TDateEdit.ButtonClick procedure
Displays a pop-up calendar dialog when the Button for the grouped edit control is clicked.
Declaration
procedure ButtonClick; overrideDescription
ButtonClick is an overridden method in
TDateEdit. It
implements the virtual method defined in the ancestor class, and is called
when the Button for the grouped edit control is clicked.
ButtonClick creates, displays, and executes a pop-up calendar dialog used to get a TDateTime value. The value in the Date property is passed as the initial date displayed on the dialog form. If Date contains the NullDate value, the current system date is used.
Values in the MinDate and MaxDate properties are used to validate and to limit the range of dates displayed on the pop-up calendar. When the properties contain non-zero values that are at least one day apart, they are used as the lower and upper limits for the value in Date. Otherwise, the MinDateTime and MaxDateTime RTL constants are used as the limits for the date value.
The ShowCalendarPopup routine is called to display and execute the dialog form. Set values in CalendarDisplaySettings and DefaultToday to control the appearance and behavior for the calendar on the dialog.
Assign a routine to the OnAcceptDate event handler to perform actions needed when a new date value is selected using the dialog. Enable FocusOnButtonClick to focus and optionally auto-select the value in the edit control after the dialog has been closed.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
