mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-26 18:03:49 +02:00
Cocoa: DateTimePicker: mouse click is supported to select the date in the date selection view on MacOS, which is consistent with Windows
This commit is contained in:
parent
bf0878f8f9
commit
b873d91b70
lcl/interfaces/cocoa
@ -16,6 +16,7 @@ type
|
||||
TCocoaDatePicker = objcclass(NSDatePicker)
|
||||
public
|
||||
callback: ICommonCallback;
|
||||
dateClicked: boolean;
|
||||
autoResize: boolean;
|
||||
retainAspectRatio: boolean;
|
||||
|
||||
@ -57,7 +58,8 @@ begin
|
||||
|
||||
// After mouse event, has our date changed
|
||||
newDate:= NSDateToDateTime(Self.dateValue);
|
||||
if (oldDate <> newDate) and Assigned(callback) then
|
||||
dateClicked:= (oldDate <> newDate);
|
||||
if dateClicked and Assigned(callback) then
|
||||
callback.SendOnChange;
|
||||
|
||||
// This also calls OnClick....
|
||||
|
@ -111,6 +111,9 @@ end;
|
||||
|
||||
class function TCocoaWSCustomCalendar.HitTest(const ACalendar: TCustomCalendar; const APoint: TPoint): TCalendarPart;
|
||||
begin
|
||||
if TCocoaDatePicker(ACalendar.Handle).dateClicked then
|
||||
exit(cpDate);
|
||||
|
||||
// need to validate this decision...
|
||||
//Debugln('TCocoaWSCustomCalendar.HitTest Mouse Y : ' + IntToStr(APoint.y));
|
||||
if APoint.y >= 40 then
|
||||
|
Loading…
Reference in New Issue
Block a user