View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0029617||Lazarus||LCL||public||2016-02-07 21:44||2016-02-22 00:54|
|Reporter||Peter Page||Assigned To||Zoran Vučenović|
|Status||resolved||Resolution||no change required|
|Platform||Intel Core i7-4790||OS||Windows|
|Summary||0029617: TDateTimePicker – can’t pick date when year is changed|
|Description||If the user changes the year (by clicking on the name of the month at the top of the component) and then selects a month, the DateTimePicker closes before the day of the month can be selected. The DateTimePicker must then be opened a second time to select a date. The TCalendarDialog performs this task correctly.|
|Steps To Reproduce||1. Click on the date at the top of the component to select a different|
month or year (don't use the navigation arrows; that won't cause
2. Select the month.
3. Select the date of the month.
This works properly with the TCalendarDialog component but the DateTimePicker component closes after step 2. It must be reopened to change the date of the month.
|Tags||No tags attached.|
|Fixed in Revision|
DateTimePickerBug.zip (375,472 bytes)
I would think the culprit is
TCalendarControlWrapper.AreCoordinatesOnDate(X, Y: Integer): Boolean;
It is called in MoueUp of the calendar form.
If it returns True the calendar form is closed.
It is not a problem in TDateTimePicker, but the problem appears in LCL's TCalendar control.
TCalendar in Windows is a wrapper of native widget MonthCalendar (https://msdn.microsoft.com/en-us/library/system.windows.forms.monthcalendar.aspx). In recent windows versions (since Win 7 or Win 8?) it has the look which you describe. With this new calendar, TCalendar makes a mistake, which I will try to describe now.
LCL's TCalendar has a method HitTest (http://lazarus-ccr.sourceforge.net/docs/lcl/calendar/tcustomcalendar.hittest.html), which (in mentioned TCalendar implementation found in recent Windows versions) incorrectly returns cpDate instead of cpTitleMonth.
And no, it doesn't work well with TCalendarDialog. The difference is that by design TCalendarDialog does not close the pop-up calendar on user's click, but only on double click, that is why you can click once on month and the pop-up Calendar does not close. But the code that TCalendarDialog uses to determine whether it should close is the same as in TDateTimePicker - it also checks TCalendar.HitTest. Try to double click on month and - it will close immediately.
To summarize, all I can do is to report this TCalendar's bug and see if it can bi fixed.
> Try to double click on month and - it will close immediately.
You are right.
||I reported it - 29646.|
||I'm resolving it as fixed - no change required, as it is not DateTimePicker issue and now it is passed to new bug report 29646.|
|2016-02-07 21:44||Peter Page||New Issue|
|2016-02-07 21:44||Peter Page||File Added: DateTimePickerBug.zip|
|2016-02-08 16:05||Bart Broersma||Note Added: 0089854|
|2016-02-08 16:06||Bart Broersma||LazTarget||=> -|
|2016-02-08 16:06||Bart Broersma||Status||new => confirmed|
|2016-02-08 16:08||Bart Broersma||Assigned To||=> Zoran Vučenović|
|2016-02-08 16:08||Bart Broersma||Status||confirmed => assigned|
|2016-02-13 15:18||Zoran Vučenović||Note Added: 0089988|
|2016-02-13 15:18||Zoran Vučenović||Note Edited: 0089988||View Revisions|
|2016-02-13 15:38||Bart Broersma||Note Added: 0089989|
|2016-02-13 16:02||Zoran Vučenović||Relationship added||related to 0029646|
|2016-02-13 16:03||Zoran Vučenović||Note Added: 0089990|
|2016-02-13 16:07||Zoran Vučenović||Widgetset||=> Win32/Win64|
|2016-02-13 16:07||Zoran Vučenović||Note Added: 0089991|
|2016-02-13 16:07||Zoran Vučenović||Status||assigned => resolved|
|2016-02-13 16:07||Zoran Vučenović||Resolution||open => no change required|
|2016-02-22 00:54||Zoran Vučenović||Relationship added||related to 0029696|
|2016-02-22 00:56||Zoran Vučenović||Relationship replaced||has duplicate 0029696|