From d8eb7563105131c588d9c9897d65a7f15cfa8ea0 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Mon, 3 Oct 2022 20:58:15 +0000 Subject: [PATCH] tvplanit: Fix printing of incorrect dates. Introduced in one of previous commits. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8510 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/tvplanit/source/vpprtfmt.pas | 5 ++++- components/tvplanit/source/vpprtprvdlg.lfm | 5 +++-- components/tvplanit/source/vpprtprvdlg.pas | 5 ++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/components/tvplanit/source/vpprtfmt.pas b/components/tvplanit/source/vpprtfmt.pas index cc7c1ac04..492d5daac 100644 --- a/components/tvplanit/source/vpprtfmt.pas +++ b/components/tvplanit/source/vpprtfmt.pas @@ -1709,9 +1709,9 @@ var Granularity, true ); + Element.DayOffset := TvpGanttView(RenderControl).VisibleCols; end; - else RenderControl.RenderToCanvas( ACanvas, @@ -1759,6 +1759,9 @@ begin for i := 0 to FPrintFormats.Items[CurFormat].Elements.Count - 1 do begin elem := FPrintFormats.Items[CurFormat].Elements.Items[i]; + if elem.ItemType = itGanttView then + elem.DayOffsetUnits := duDay; + GetPrintRectangle(elem); if elem.ItemType = itCaption then begin diff --git a/components/tvplanit/source/vpprtprvdlg.lfm b/components/tvplanit/source/vpprtprvdlg.lfm index 7a30b32b7..687782a9c 100644 --- a/components/tvplanit/source/vpprtprvdlg.lfm +++ b/components/tvplanit/source/vpprtprvdlg.lfm @@ -14,6 +14,7 @@ object frmPrintPreview: TfrmPrintPreview OnCreate = FormCreate OnKeyDown = FormKeyDown OnShow = FormShow + LCLVersion = '2.3.0.0' object Panel1: TPanel Left = 0 Height = 56 @@ -50,7 +51,7 @@ object frmPrintPreview: TfrmPrintPreview end object ToolButton3: TToolButton Left = 55 - Height = 25 + Height = 5 Top = 0 Caption = 'ToolButton3' ImageIndex = 2 @@ -86,7 +87,7 @@ object frmPrintPreview: TfrmPrintPreview end object ToolButton8: TToolButton Left = 152 - Height = 25 + Height = 5 Top = 0 Caption = 'ToolButton8' ImageIndex = 6 diff --git a/components/tvplanit/source/vpprtprvdlg.pas b/components/tvplanit/source/vpprtprvdlg.pas index ceb7be3fe..746a1af75 100644 --- a/components/tvplanit/source/vpprtprvdlg.pas +++ b/components/tvplanit/source/vpprtprvdlg.pas @@ -275,8 +275,6 @@ begin DoFormPlacement(EditForm); EditForm.WindowState := WindowState; - EditForm.VpPrintPreview1.ControlLink := ControlLink; - EditForm.VpPrintFormatComboBox1.ControlLink := ControlLink; EditForm.VpPrintPreview1.StartDate := StartDate; EditForm.VpPrintPreview1.EndDate := EndDate; EditForm.VpPrintPreview1.ZoomFactor := ZoomFactor; @@ -285,7 +283,8 @@ begin EditForm.VpPrintPreview1.ForceUpdate; EditForm.VpPrintPreview1.FirstPage; EditForm.DrawingStyle := FDrawingStyle; -// EditForm.PageInfo.Caption := Format('%d pages', [EditForm.VpPrintPreview1.PageCount]); + EditForm.VpPrintPreview1.ControlLink := ControlLink; + EditForm.VpPrintFormatComboBox1.ControlLink := ControlLink; EditForm.ShowModal; if EditForm.ReturnCode = rtCommit then begin Result := True;