Recent

Author Topic: TDateTimePicker vs TDateEdit  (Read 940 times)

Frank

  • Jr. Member
  • **
  • Posts: 69
TDateTimePicker vs TDateEdit
« on: February 14, 2021, 10:27:33 pm »
Hi All,
  I use TDateTimePicker in a long time project of mine (originally Delphi) with Lazarus trunk with macOS Big Sur.
The TDateTimePicker has worked for me in both Windows & Mac Cocoa, but for a while now the Cocoa version has not.
  The Cocoa component TCocoaDatePicker is the underlining code for both TDateTimePicker and TDateEdit.
TDateEdit works as expected in Cocoa...

The issue appears in TDTCalendarForm.CalendarClick where
  P := Cal.GetCalendarControl.ScreenToClient(Mouse.CursorPos);
reports P.y incorrectly...

Where as TDateEdit TCalendarPopupForm.CalendarDblClick
  P := Calendar.ScreenToClient(Mouse.CursorPos);
returns P.y correctly...

Has anyone seen this (bug)? Should it be reported as bug?
And would this be considered a TDateTimePicker, TDateEdit or TCocoaDatePicker Bug?

Thanks

Frank

  • Jr. Member
  • **
  • Posts: 69
Re: TDateTimePicker vs TDateEdit
« Reply #1 on: February 15, 2021, 08:20:47 pm »
  Added bug report : 0038493: TDateTimePicker click event

Zoran

  • Hero Member
  • *****
  • Posts: 1673
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: TDateTimePicker vs TDateEdit
« Reply #2 on: February 22, 2021, 10:16:40 am »
Both TDateTimePicker and TDateEdit are custom controls, so I would be very surprised if, on Cocoa only, they use some native underlying control.

Just to be clear, do you mean actually that they use this underlying control for the pop-up calendar?
Because, it is true that these controls do use LCL's TCalendar, which really is implemented with underlying native calendar.

From the information you gave, it is not easy to tell which control should the bug address. I would first suspect that the bug is in TCalendar's implementation of ScreenToClient on Cocoa.

I would like to help, but I don't have Mac and I have never used one, so I cannot test myself.

 

TinyPortal © 2005-2018