Provides a default implementation of the TCalendarControlWrapper abstract class for use in the LCL.

By default, TDateTimePicker uses the LCL TCalendar control to represent its drop-down calendar. But you can use another calendar control instead. In order to use another calendar control, you should "wrap" that control with a CalendarControlWrapper.

For use in TDateTimePicker, the calendar control must at least provide a way to determine whether the coordinates are on a date. When the control is clicked, we must decide if the date has just been chosen and respond by closing the drop-down form and setting the date from the calendar to the DateTimePicker control. For example, in the LCL TCalendar will respond when the calendar is clicked on a date, but not when the user clicks in the title area changing month or year. Then we let the user keep browsing the calendar.

When creating a new wrapper, there are abstract methods which need to be overridden.

lclcalwrapper.pas is part of DateTimeCtrls package for Lazarus.

Original Author:

Zoran Vučenović. Зоран Вученовић.

LICENSE

Modified LGPL -- see the file COPYING.modifiedLGPL.

NO WARRANTY

There is no warranty whatsoever.

Original documentation is located on the Lazarus Wiki at:

DateTimeCtrls Package

Provides a default implementation of the TCalendarControlWrapper abstract class.
Gets the TControlClass instance used to create new instances of the Calendar displayed in a date/time picker control.
TCalendarControlWrapper.Create
Returns TCalendar in TLCLCalendarWrapper.
Assigns the specified date to the DateTime property in the calendar control for the wrapper.
TDate value assigned to the calendar control for the wrapper.
Gets the value for the DateTime property in the calendar control for the wrapper.
TDate value returned from the calendar control for the wrapper.
Implements the abstract method used to verify that the specified coordinates are on a valid date in the month view for the calendar control.
True if the calendar can be closed, is using the month view for the dialog, and the coordinates are on a date or unused area on the calendar control.
Horizontal coordinate for a click event on the control.
Vertical coordinate for a click event on the control.
Indicates whether the month view is active on the calendar control.

The return value is True if the TCalendar calendar instance (from GetCalendarControl) is displaying the month view on the control (GetCalendarView is set to cvMonth).

True when the view for the calendar control is set to cvMonth.
Constructor for the class instance.

Create is the overridden constructor for the class instance, and calls the inherited method on entry. It sets the values for private members in the class instance, and stores the private LCLCalendarWrapperWndProc method as the window processing loop for the calendar control.

Destructor for the class instance.

Restores a previous window processing loop for the calendar control, and frees the class instance by calling the inherited method.