TCalendar.HitTest method incorectly returns cpDate
Original Reporter info from Mantis: zoran
-
Reporter name: Zoran Vučenović
Original Reporter info from Mantis: zoran
- Reporter name: Zoran Vučenović
Description:
In recent Windows versions (probably since Windows 7), the native windows MontCalendar widget has new look. When the user clicks on month name in title (for example February 2016), then the calendar changes to grid of months (see attached file Capture.PNG). Then, when user clicks on a month, the Calendar.HitTest (http://lazarus-ccr.sourceforge.net/docs/lcl/calendar/tcustomcalendar.hittest.html) returns cpDate. I think that it should return cpTitleMonth.
Additional information:
This affects the incorrect behaviour of TDateTimePicker, TDateEdit and TCalendarDialog. All those controls ask Calendar.HitTest(aPoint) in [cpDate, cpNoWhere] and, when they get cpDate, they incorrectly close the calendar when the user hasn't chosen the date.
This is reported as TDateTimePicker bug (see issue 29617), but it should be solved in TCalendar for Win32/64 widgetset, so I'm creating this bug report.