mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 05:56:02 +02:00
DateTimePicker: move key handling from calendar to its container form, so that it works when calendar is not TWinControl
git-svn-id: trunk@59875 -
This commit is contained in:
parent
bb20acbfb4
commit
94284ccbe5
@ -907,10 +907,11 @@ begin
|
||||
Cal.GetCalendarControl.OnResize := @CalendarResize;
|
||||
Cal.GetCalendarControl.OnClick := @CalendarClick;
|
||||
if Cal.GetCalendarControl is TWinControl then begin
|
||||
TWinControl(Cal.GetCalendarControl).OnKeyDown := @CalendarKeyDown;
|
||||
TWinControl(Cal.GetCalendarControl).TabStop := True;
|
||||
TWinControl(Cal.GetCalendarControl).SetFocus;
|
||||
end;
|
||||
Self.OnKeyDown := @CalendarKeyDown;
|
||||
Self.KeyPreview := True;
|
||||
|
||||
Shape.Parent := Self;
|
||||
Cal.GetCalendarControl.Parent := Self;
|
||||
@ -920,14 +921,14 @@ end;
|
||||
destructor TDTCalendarForm.Destroy;
|
||||
begin
|
||||
SetClosingCalendarForm;
|
||||
|
||||
OnKeyDown := nil;
|
||||
if Assigned(DTPickersParentForm) then
|
||||
DTPickersParentForm.RemoveAllHandlersOfObject(Self);
|
||||
|
||||
if Assigned(Cal) then begin
|
||||
Cal.GetCalendarControl.OnResize := nil;
|
||||
Cal.GetCalendarControl.OnClick := nil;
|
||||
if Cal.GetCalendarControl is TWinControl then
|
||||
TWinControl(Cal.GetCalendarControl).OnKeyDown := nil;
|
||||
Cal.Free;
|
||||
Cal := nil;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user