You've already forked lazarus-ccr
tvplanit: Fix weekview not showing events on last day of week.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8455 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -26,6 +26,9 @@ type
|
||||
RealLineColor: TColor;
|
||||
RealRowHeadAttrColor: TColor;
|
||||
|
||||
RealColWidth: Integer;
|
||||
RealFixedColWidth: Integer;
|
||||
|
||||
protected
|
||||
procedure Clear;
|
||||
procedure DrawActiveDate;
|
||||
@ -86,7 +89,7 @@ begin
|
||||
dayRec := DayRecords[ActiveCol];
|
||||
eventRec := EventRecords[ActiveRow];
|
||||
|
||||
dx := LeftCol * ColWidth;
|
||||
dx := LeftCol * RealColWidth; //ColWidth;
|
||||
dy := TopRow * RowHeight;
|
||||
end;
|
||||
|
||||
@ -148,14 +151,14 @@ begin
|
||||
begin
|
||||
R1 := R;
|
||||
InflateRect(R1, -1, -1);
|
||||
R1.Right := FGanttView.FixedColWidth-1;
|
||||
R1.Right := RealFixedColWidth - 1; //FGanttView.FixedColWidth-1;
|
||||
DrawBevelRect(
|
||||
RenderCanvas,
|
||||
TPSRotateRectangle(Angle, RenderIn, R1),
|
||||
BevelHighlight,
|
||||
BevelShadow
|
||||
);
|
||||
R1.Left := FGanttView.FixedColWidth;
|
||||
R1.Left := RealFixedColWidth; //FGanttView.FixedColWidth;
|
||||
R1.Right := RealRight-2;
|
||||
DrawBevelRect(
|
||||
RenderCanvas,
|
||||
@ -165,14 +168,16 @@ begin
|
||||
);
|
||||
end else
|
||||
begin
|
||||
TPSMoveTo(RenderCanvas, Angle, RenderIn, FGanttView.FixedColWidth, R.Top);
|
||||
TPSLineTo(RenderCanvas, Angle, RenderIn, FGanttView.FixedColWidth, R.Bottom);
|
||||
// TPSMoveTo(RenderCanvas, Angle, RenderIn, FGanttView.FixedColWidth, R.Top);
|
||||
// TPSLineTo(RenderCanvas, Angle, RenderIn, FGanttView.FixedColWidth, R.Bottom);
|
||||
TPSMoveTo(RenderCanvas, Angle, RenderIn, RealFixedColWidth, R.Top);
|
||||
TPSLineTo(RenderCanvas, Angle, RenderIn, RealFixedColWidth, R.Bottom);
|
||||
TPSMoveTo(RenderCanvas, Angle, RenderIn, RealLeft, R.Bottom);
|
||||
TPSLineTo(RenderCanvas, Angle, RenderIn, RealRight, R.Bottom);
|
||||
end;
|
||||
|
||||
// Offset due to scrolling
|
||||
dx := FGanttView.LeftCol * FGanttView.ColWidth;
|
||||
dx := FGanttView.LeftCol * RealColWidth; //FGanttView.ColWidth;
|
||||
|
||||
// Draw month rectangles and month captions
|
||||
RenderCanvas.Font.Assign(FMonthFont);
|
||||
@ -184,8 +189,12 @@ begin
|
||||
OffsetRect(R, -dx , 0);
|
||||
|
||||
// Clip at fixed col edge
|
||||
{
|
||||
if R.Left < FGanttView.FixedColWidth then
|
||||
R.Left := FGanttView.FixedColWidth;
|
||||
}
|
||||
if R.Left < RealFixedColWidth then
|
||||
R.Left := RealFixedColWidth;
|
||||
|
||||
// Draw month box
|
||||
if FGanttView.DrawingStyle = ds3D then
|
||||
@ -232,7 +241,8 @@ begin
|
||||
dayRec := FGanttView.DayRecords[i];
|
||||
R := dayRec.Rect;
|
||||
OffsetRect(R, -dx, 0);
|
||||
if R.Left < FGanttView.FixedColWidth then
|
||||
if R.Left < RealFixedColWidth then
|
||||
// if R.Left < FGanttView.FixedColWidth then
|
||||
Continue;
|
||||
|
||||
// In sdmHeader SpecialDayMode we must repaint the background of the
|
||||
@ -301,7 +311,7 @@ var
|
||||
dx, dy: Integer;
|
||||
top_margin, bottom_margin: Integer;
|
||||
begin
|
||||
dx := FGanttView.LeftCol * FGanttView.ColWidth;
|
||||
dx := FGanttView.LeftCol * RealColWidth; //FGanttView.ColWidth;
|
||||
dy := FGanttView.TopRow * FGanttView.RowHeight;
|
||||
|
||||
if FGanttView.DrawingStyle = ds3D then
|
||||
@ -324,10 +334,16 @@ begin
|
||||
dec(R.Bottom, bottom_margin);
|
||||
if R.Top < FGanttView.TotalColHeaderHeight then
|
||||
Continue;
|
||||
if R.Right < RealFixedColWidth then
|
||||
Continue;
|
||||
if R.Left < RealFixedColWidth then
|
||||
R.Left := RealFixedColWidth;
|
||||
{
|
||||
if R.Right < FGanttView.FixedColWidth then
|
||||
Continue;
|
||||
if R.Left < FGanttView.FixedColWidth then
|
||||
R.Left := FGanttView.FixedColWidth;
|
||||
}
|
||||
cat := FGanttView.DataStore.CategoryColorMap.GetCategory(event.Category);
|
||||
RenderCanvas.Pen.Color := cat.Color;
|
||||
RenderCanvas.Brush.Color := cat.BackgroundColor;
|
||||
@ -346,11 +362,12 @@ var
|
||||
begin
|
||||
RenderCanvas.Pen.Color := RealLineColor;
|
||||
|
||||
dx := FGanttView.LeftCol * FGanttView.ColWidth;
|
||||
dx := FGanttView.LeftCol * RealColWidth; //FGanttView.ColWidth;
|
||||
dy := FGanttView.TopRow * FGanttView.RowHeight;
|
||||
|
||||
// Horizontal line terminating the col header block
|
||||
x1 := RealLeft + FGanttView.FixedColWidth;
|
||||
// x1 := RealLeft + FGanttView.FixedColWidth;
|
||||
x1 := RealLeft + RealFixedColWidth;
|
||||
n := FGanttView.NumMonths;
|
||||
if n > 0 then
|
||||
begin
|
||||
@ -360,7 +377,9 @@ begin
|
||||
x2 := RealRight;
|
||||
y0 := FGanttView.TotalColHeaderHeight;
|
||||
if FGanttView.DrawingStyle = ds3D then dec(y0);
|
||||
RenderCanvas.Line(x1, y0, x2, y0);
|
||||
TPSMoveTo(RenderCanvas, Angle, RenderIn, x1, y0);
|
||||
TPSLineTo(RenderCanvas, Angle, RenderIn, x2, y0);
|
||||
// RenderCanvas.Line(x1, y0, x2, y0);
|
||||
|
||||
// Horizontal lines
|
||||
if (gvoHorizGrid in FGanttView.Options) then
|
||||
@ -373,7 +392,11 @@ begin
|
||||
eventRec := FGanttView.EventRecords[i];
|
||||
y1 := y0 + eventRec.EventRect.Bottom;
|
||||
if y1 >= FGanttView.TotalColHeaderHeight then
|
||||
RenderCanvas.Line(x1, y1, x2, y1);
|
||||
begin
|
||||
TPSMoveTo(RenderCanvas, Angle, RenderIn, x1, y1);
|
||||
TPSLineTo(RenderCanvas, Angle, RenderIn, x2, y1);
|
||||
// RenderCanvas.Line(x1, y1, x2, y1);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -393,8 +416,13 @@ begin
|
||||
dayRec := FGanttView.DayRecords[i];
|
||||
x1 := dayRec.Rect.Right - dx;
|
||||
x2 := x1;
|
||||
if x1 >= FGanttView.FixedColWidth then
|
||||
RenderCanvas.Line(x1, y1, x2, y2);
|
||||
// if x1 >= FGanttView.FixedColWidth then
|
||||
if x1 >= RealFixedColWidth then
|
||||
begin
|
||||
TPSMoveTo(RenderCanvas, Angle, RenderIn, x1, y1);
|
||||
TPSLineTo(RenderCanvas, Angle, RenderIn, x2, y1);
|
||||
// RenderCanvas.Line(x1, y1, x2, y2);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -414,7 +442,8 @@ begin
|
||||
if FGanttView.DrawingStyle = ds3d then begin
|
||||
R.Left := RealLeft + 1;
|
||||
R.Top := RealTop;
|
||||
R.Right := RealLeft + FGanttView.FixedColWidth - 1;
|
||||
// R.Right := RealLeft + FGanttView.FixedColWidth - 1;
|
||||
R.Right := RealLeft + RealFixedColWidth - 1;
|
||||
R.Bottom := RealBottom - 1;
|
||||
TPSFillRect(RenderCanvas, Angle, RenderIn, R);
|
||||
DrawBevelRect(
|
||||
@ -424,10 +453,13 @@ begin
|
||||
BevelShadow
|
||||
);
|
||||
end else begin
|
||||
R := Rect(RealLeft, RealTop + 1, RealLeft + FGanttView.FixedColWidth, RealBottom);
|
||||
// R := Rect(RealLeft, RealTop + 1, RealLeft + FGanttView.FixedColWidth, RealBottom);
|
||||
R := Rect(RealLeft, RealTop + 1, RealLeft + RealFixedColWidth, RealBottom);
|
||||
TPSFillRect(RenderCanvas, Angle, RenderIn, R);
|
||||
RenderCanvas.Pen.Color := RealLineColor;
|
||||
RenderCanvas.Line(R.Right, R.Top, R.Right, R.Bottom);
|
||||
TPSMoveTo(RenderCanvas, Angle, RenderIn, R.Right, R.Top);
|
||||
TPSLineTo(RenderCanvas, Angle, RenderIn, R.Right, R.Bottom);
|
||||
// RenderCanvas.Line(R.Right, R.Top, R.Right, R.Bottom);
|
||||
end;
|
||||
|
||||
RenderCanvas.Font.Assign(FEventFont);
|
||||
@ -456,7 +488,9 @@ begin
|
||||
);
|
||||
end else
|
||||
begin
|
||||
RenderCanvas.Line(R.Left, R.Bottom, R.Right, R.Bottom);
|
||||
TPSMoveTo(RenderCanvas, Angle, RenderIn, R.Left, R.Bottom);
|
||||
TPSLineTo(RenderCanvas, Angle, RenderIn, R.Right, R.Bottom);
|
||||
// RenderCanvas.Line(R.Left, R.Bottom, R.Right, R.Bottom);
|
||||
end;
|
||||
|
||||
// Paint event description as header
|
||||
@ -482,7 +516,7 @@ begin
|
||||
|
||||
nEvents := NumEvents;
|
||||
nDays := NumDays;
|
||||
dx := LeftCol * ColWidth;
|
||||
dx := LeftCol * RealColWidth; //ColWidth;
|
||||
dy := TopRow * RowHeight;
|
||||
|
||||
y1 := TotalColHeaderHeight;
|
||||
@ -503,7 +537,8 @@ begin
|
||||
RenderCanvas.Brush.Color := clr;
|
||||
x1 := dayRec.Rect.Left - dx;
|
||||
x2 := dayRec.Rect.Right - dx;
|
||||
RenderCanvas.FillRect(x1, y1, x2, y2);
|
||||
TPSFillRect(RenderCanvas, Angle, RenderIn, Rect(x1, y1, x2, y2));
|
||||
// RenderCanvas.FillRect(x1, y1, x2, y2);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -606,6 +641,9 @@ begin
|
||||
FGanttView.Init;
|
||||
FGanttView.VisibleCols := FGanttView.CalcVisibleCols(RealRight - RealLeft);
|
||||
FGanttView.VisibleRows := FGanttView.CalcVisibleRows(RealBottom - RealTop);
|
||||
|
||||
RealColWidth := round(FGanttView.ColWidth * Scale);
|
||||
RealFixedColWidth := round(FGanttView.FixedColWidth * Scale);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
Reference in New Issue
Block a user