You've already forked lazarus-ccr
tvplanit: Extend TVpGanttView such that it can be painted only over a given date interval.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8480 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -333,6 +333,10 @@ begin
|
||||
begin
|
||||
eventRec := FGanttView.EventRecords[i];
|
||||
event := eventRec.Event;
|
||||
if event.EndTime < FGanttView.FirstDate then
|
||||
Continue;
|
||||
if event.StartTime > FGanttView.LastDate then
|
||||
exit;
|
||||
R := ScaleRect(eventRec.EventRect);
|
||||
OffsetRect(R, -dx, -dy);
|
||||
inc(R.Top, top_margin);
|
||||
@ -409,18 +413,17 @@ begin
|
||||
eventRec := FGanttView.EventRecords[numEvents-1];
|
||||
R := ScaleRect(eventRec.EventRect);
|
||||
y2 := R.Bottom - dy;
|
||||
end else
|
||||
y2 := RealBottom;
|
||||
n := FGanttView.NumDays;
|
||||
for i := 0 to n-1 do
|
||||
begin
|
||||
dayRec := FGanttView.DayRecords[i];
|
||||
R := ScaleRect(dayRec.Rect);
|
||||
x1 := R.Right - dx;
|
||||
if x1 >= FScaledFixedColWidth then
|
||||
n := FGanttView.NumDays;
|
||||
for i := 0 to n-1 do
|
||||
begin
|
||||
TPSMoveTo(RenderCanvas, Angle, RenderIn, x1, y1);
|
||||
TPSLineTo(RenderCanvas, Angle, RenderIn, x1, y2)
|
||||
dayRec := FGanttView.DayRecords[i];
|
||||
R := ScaleRect(dayRec.Rect);
|
||||
x1 := R.Right - dx;
|
||||
if x1 >= FScaledFixedColWidth then
|
||||
begin
|
||||
TPSMoveTo(RenderCanvas, Angle, RenderIn, x1, y1);
|
||||
TPSLineTo(RenderCanvas, Angle, RenderIn, x1, y2)
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -507,7 +510,7 @@ var
|
||||
begin
|
||||
with FGanttView do
|
||||
begin
|
||||
if (StartDate = NO_DATE) or (SpecialDayMode <> sdmColumn) then
|
||||
if (RealStartDate = NO_DATE) or (SpecialDayMode <> sdmColumn) then
|
||||
exit;
|
||||
|
||||
nEvents := NumEvents;
|
||||
@ -515,9 +518,13 @@ begin
|
||||
dx := LeftCol * FScaledColWidth;
|
||||
dy := TopRow * FScaledRowHeight;
|
||||
|
||||
R := ScaleRect(EventRecords[nEvents-1].HeadRect);
|
||||
y1 := RealTop + FScaledTotalColHeaderHeight;
|
||||
y2 := R.Bottom - dy;
|
||||
if nEvents > 0 then
|
||||
begin
|
||||
R := ScaleRect(EventRecords[nEvents-1].HeadRect);
|
||||
y2 := R.Bottom - dy;
|
||||
end else
|
||||
y2 := y1;
|
||||
|
||||
RenderCanvas.Brush.style := bsSolid;
|
||||
for i := 0 to nDays-1 do
|
||||
|
Reference in New Issue
Block a user