From 6dd860fd7939fea88d01b812ea1878aef8c3bb71 Mon Sep 17 00:00:00 2001 From: maxim Date: Wed, 6 Apr 2016 22:45:33 +0000 Subject: [PATCH] Reverted revision(s) 51695 #3d71055636 from trunk: LCL: Try not to close CalendarDialogs if CurrentView <> cvMonth. Partly resolves Issue #0029646. git-svn-id: branches/fixes_1_6@52131 - --- lcl/extdlgs.pas | 5 +---- lcl/forms/calendarpopup.pas | 9 ++------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/lcl/extdlgs.pas b/lcl/extdlgs.pas index db1c3d40ad..9690151d5c 100644 --- a/lcl/extdlgs.pas +++ b/lcl/extdlgs.pas @@ -667,12 +667,9 @@ procedure TCalendarDialog.CalendarDblClick(Sender: TObject); var CalendarForm: TForm; P: TPoint; - htRes: TCalendarPart; begin P := FCalendar.ScreenToClient(Mouse.CursorPos); - //if FCalendar.HitTest(P) in [cpNoWhere, cpDate] then - htRes := FCalendar.HitTest(P); - if {(htRes = cpNoWhere) or }((htRes = cpDate) and (FCalendar.GetCalendarView = cvMonth)) then + if FCalendar.HitTest(P) in [cpNoWhere, cpDate] then begin GetNewDate(Sender); CalendarForm:=TForm(TComponent(Sender).Owner); diff --git a/lcl/forms/calendarpopup.pas b/lcl/forms/calendarpopup.pas index 78fcdcd062..736c1fbf36 100644 --- a/lcl/forms/calendarpopup.pas +++ b/lcl/forms/calendarpopup.pas @@ -85,11 +85,9 @@ end; procedure TCalendarPopupForm.CalendarDblClick(Sender: TObject); var P: TPoint; - htRes: TCalendarPart; begin P := Calendar.ScreenToClient(Mouse.CursorPos); - htRes := Calendar.HitTest(P); - if {(htRes = cpNoWhere) or }((htRes = cpDate) and (Calendar.GetCalendarView = cvMonth)) then + if Calendar.HitTest(P) in [cpNoWhere, cpDate] then ReturnDate; end; @@ -105,10 +103,7 @@ begin VK_ESCAPE: Close; VK_RETURN, VK_SPACE: - if (Calendar.GetCalendarView = cvMonth) then - ReturnDate - else - Handled := False; + ReturnDate; else Handled := false; end;