You've already forked lazarus-ccr
tvplanit: Fix GanttView being unable to select a recurring event.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8560 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1218,13 +1218,25 @@ end;
|
||||
function TVpGanttView.GetRowOfEvent(AEvent: TVpEvent): Integer;
|
||||
var
|
||||
i: Integer;
|
||||
eventRec: PVpGanttEventRec;
|
||||
found: Boolean;
|
||||
begin
|
||||
for i := 0 to FEventRecords.Count-1 do
|
||||
if FEventRecords[i]^.Event = AEvent then
|
||||
begin
|
||||
eventRec := FEventRecords[i];
|
||||
if (eventRec^.Event = AEvent) then
|
||||
begin
|
||||
Result := i;
|
||||
exit;
|
||||
if AEvent.RepeatCode = rtNone then
|
||||
found := true
|
||||
else
|
||||
found := (DatePart(eventRec^.StartTime) <= FActiveDate) and (DatePart(eventRec^.EndTime) >= FActiveDate);
|
||||
if found then
|
||||
begin
|
||||
Result := i;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
Result := -1;
|
||||
end;
|
||||
|
||||
@ -1591,7 +1603,13 @@ begin
|
||||
|
||||
// Find the active row. This is the row with the active event.
|
||||
if eventRec^.Event = FActiveEvent then
|
||||
FActiveRow := i;
|
||||
begin
|
||||
if FActiveEvent.RepeatCode = rtNone then
|
||||
FActiveRow := i
|
||||
else
|
||||
if (DatePart(eventRec^.StartTime) <= FActiveDate) and (DatePart(eventRec^.EndTime) >= FActiveDate) then
|
||||
FActiveRow := i;
|
||||
end;
|
||||
|
||||
// Prepare for next row
|
||||
y1 := y2;
|
||||
@ -1843,6 +1861,7 @@ begin
|
||||
|
||||
ScrollDateIntoView(FActiveDate);
|
||||
FActiveCol := trunc(FActiveDate) - trunc(FRealStartDate);
|
||||
|
||||
Invalidate;
|
||||
|
||||
if (not FInLinkHandler) and (ControlLink <> nil) then
|
||||
@ -1851,6 +1870,8 @@ begin
|
||||
end;
|
||||
|
||||
procedure TVpGanttView.SetActiveEvent(AValue: TVpEvent);
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
if FActiveEvent <> AValue then
|
||||
begin
|
||||
|
Reference in New Issue
Block a user