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 -
This commit is contained in:
maxim 2016-04-06 22:45:33 +00:00
parent c13737ca00
commit 6dd860fd79
2 changed files with 3 additions and 11 deletions

View File

@ -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);

View File

@ -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;