diff --git a/components/tvplanit/source/vpganttview.pas b/components/tvplanit/source/vpganttview.pas index 1c1ca39cb..9fdd77e77 100644 --- a/components/tvplanit/source/vpganttview.pas +++ b/components/tvplanit/source/vpganttview.pas @@ -87,8 +87,10 @@ type FActiveRow: Integer; // Selected row FActiveEvent: TVpEvent; // Selected event FActiveDate: TDateTime; // Selected date - FStartDate: TDateTime; // Date of the first event - FEndDate: TDateTime; // Date of the last event + FFirstDate: TDateTime; // Date of the first event in the resource + FLastDate: TDateTime; // Date of the last event in the resource + FStartDate: TDateTime; // Date of the first event to be displayed/printed + FEndDate: TDateTime; // Date of the last event to be displayed/printed FLeftCol: Integer; // Index of the left-most day column FTopRow: Integer; // Index of the top-most event row @@ -267,6 +269,8 @@ type property ActiveEvent: TVpEvent read FActiveEvent write SetActiveEvent; property ActiveDate: TDateTime read FActiveDate write SetActiveDate; property ActiveRow: Integer read FActiveRow write SetActiveRow; + property FirstDate: TDateTime read FFirstDate; + property LastDate: TDateTime read FLastDate; property StartDate: TDateTime read FStartDate write FStartDate; property EndDate: TDateTime read FEndDate write FEndDate; property ColCount: Integer read FColCount write FColCount; @@ -440,7 +444,6 @@ begin FMouseDown := false; SetActiveDate(Now); - FStartDate := FActiveDate; FColWidth := DEFAULT_COLWIDTH; FFixedColWidth := 120; @@ -843,20 +846,25 @@ var begin if (Datastore = nil) or (Datastore.Resource = nil) or (Datastore.Resource.Schedule.EventCount = 0) then begin - FStartDate := NO_DATE; - FEndDate := NO_DATE; + FFirstDate := NO_DATE; + FLastDate := NO_DATE; end else begin event := Datastore.Resource.Schedule.GetEvent(0); - FStartDate := trunc(event.StartTime); - FEndDate := -99999; + FFirstDate := trunc(event.StartTime); + FLastDate := -99999; for i := 0 to Datastore.Resource.Schedule.EventCount-1 do begin event := Datastore.Resource.Schedule.GetEvent(i); d := trunc(event.EndTime); - if d > FEndDate then FEndDate := d; + if d > FLastDate then FLastDate := d; end; end; + + if FStartDate = 0 then + FStartDate := FFirstDate; + if FEndDate = 0 then + FEndDate := FLastDate; end; function TVpGanttView.GetEventOfRow(ARow: Integer): TVpEvent; diff --git a/components/tvplanit/source/vpganttviewpainter.pas b/components/tvplanit/source/vpganttviewpainter.pas index 2591dcf97..ab77e1b84 100644 --- a/components/tvplanit/source/vpganttviewpainter.pas +++ b/components/tvplanit/source/vpganttviewpainter.pas @@ -535,7 +535,8 @@ begin R := ScaleRect(dayRec.Rect); x1 := R.Left - dx; x2 := R.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; diff --git a/components/tvplanit/source/vpprtfmt.pas b/components/tvplanit/source/vpprtfmt.pas index b375767b4..cc7c1ac04 100644 --- a/components/tvplanit/source/vpprtfmt.pas +++ b/components/tvplanit/source/vpprtfmt.pas @@ -1696,6 +1696,22 @@ var FLastContact := RenderControl.GetLastPrintLine; end; + itGanttView: + begin + RenderControl.RenderToCanvas( + ACanvas, + Rect(StartX, StartY, StopX, StopY), + Element.Rotation, + Scale, + GetDate(Element), + 0, // to be completed... + 0, + Granularity, + true + ); + end; + + else RenderControl.RenderToCanvas( ACanvas,