TvPlanIt: Fix incorrect drag-and-drop operation to or within TVpMonthView (https://forum.lazarus.freepascal.org/index.php/topic,59578.0.html).

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8288 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2022-06-09 20:48:10 +00:00
parent 992ddb6298
commit 09db53cc99

View File

@ -698,7 +698,8 @@ var
AllowIt: Boolean;
EventDlg : TVpEventEditDialog;
begin
if DataStore = nil then Exit;
if DataStore = nil then
Exit;
if (not IsNewEvent) and (not mvActiveEvent.CanEdit) then begin
MessageDlg(RSCannotEditOverlayedEvent, mtInformation, [mbOk], 0);
@ -718,7 +719,7 @@ begin
EventDlg.Free;
end;
end;
if AllowIt then begin
mvActiveEvent.Changed := true;
DataStore.PostEvents;
@ -732,7 +733,6 @@ begin
DataStore.PostEvents;
end;
Invalidate;
mvActiveEvent := nil;
end;
procedure TVpMonthView.mvSpinButtonClick(Sender: TObject; Button: TUDBtnType);
@ -1061,6 +1061,8 @@ begin
begin
{ The mouse click landed inside the client area }
MvSetDateByCoord(Point(Msg.XPos, Msg.YPos));
newEvent := not SelectEventAtCoord(Point(Msg.XPos, Msg.YPos));
if newEvent then mvActiveEvent := nil;
{ Did the mouse click land on an event? }
if Assigned(FOnEventDblClick) then begin
@ -1068,7 +1070,6 @@ begin
FOnEventDblClick(self, mvActiveEvent);
end else
if mvActiveEvent <> nil then begin
newevent := not SelectEventAtCoord(Point(Msg.XPos, Msg.YPos));
mvSpawnEventEditDialog(newevent);
end else
if (DataStore.Resource <> nil) then begin
@ -1322,7 +1323,8 @@ var
I: Integer;
begin
for I := 0 to pred(Length(mvMonthdayArray)) do
if PointInRect(APoint, mvMonthdayArray[I].Rec) then begin
if PointInRect(APoint, mvMonthdayArray[I].Rec) then
begin
Date := mvMonthdayArray[I].Date;
break;
end;