From 63789cb360a52a94b59145356b4ac1bf8f2e87da Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Fri, 9 Aug 2019 17:29:14 +0000 Subject: [PATCH] jvcllaz: Fix too-small default font used by TJvTFDaysPrinter for appointments (JvTimeFramework) git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7108 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../jvcllaz/examples/JvTimeFramework/tfmain.pas | 1 + .../jvcllaz/run/JvTimeFramework/jvtfdays.pas | 17 +++++++++++++++++ .../jvcllaz/run/JvTimeFramework/jvtfmanager.pas | 10 ++-------- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/components/jvcllaz/examples/JvTimeFramework/tfmain.pas b/components/jvcllaz/examples/JvTimeFramework/tfmain.pas index bdd118f42..eb7a978e3 100644 --- a/components/jvcllaz/examples/JvTimeFramework/tfmain.pas +++ b/components/jvcllaz/examples/JvTimeFramework/tfmain.pas @@ -390,6 +390,7 @@ end; procedure TMainForm.NextDateButtonClick(Sender: TObject); begin JvTFDays1.NextDate; + JvTFMonths1.DisplayDate := JvTFDays1.CurrentDate; end; procedure TMainForm.GotoDatePickerChange(Sender: TObject); diff --git a/components/jvcllaz/run/JvTimeFramework/jvtfdays.pas b/components/jvcllaz/run/JvTimeFramework/jvtfdays.pas index 94cf8e8b5..0b2e2f175 100644 --- a/components/jvcllaz/run/JvTimeFramework/jvtfdays.pas +++ b/components/jvcllaz/run/JvTimeFramework/jvtfdays.pas @@ -1238,6 +1238,7 @@ type {$ENDIF Jv_TIMEBLOCKS} // date navigation methods + function CurrentDate: TDate; procedure PrevDate; procedure NextDate; procedure GotoDate(aDate: TDate); @@ -9676,6 +9677,16 @@ begin EndRow := RowCount - 1; end; +function TJvTFDays.CurrentDate: TDate; +begin + case Template.ActiveTemplate of + agtLinear: + Result := Template.LinearStartDate; + agtComparative: + Result := Template.CompDate; + end; +end; + procedure TJvTFDays.PrevDate; begin case Template.ActiveTemplate of @@ -13735,6 +13746,11 @@ begin Grouping := aJvTFDays.Grouping; HdrAttr := aJvTFDays.HdrAttr; + FixFont(FancyRowHdrAttr.MajorFont); + FixFont(FancyRowHdrAttr.Minorfont); + FixFont(GroupHdrAttr.Font); + FixFont(HdrAttr.Font); + MinColWidth := ConvertMeasure(ScreenToPrinter(aJvTFDays.MinColWidth, True), pmPixels, Measure, True); @@ -14085,6 +14101,7 @@ begin DrawInfo.FrameColor := ApptAttr.FrameColor; DrawInfo.FrameWidth := ApptAttr.FrameWidth; DrawInfo.Font := ApptAttr.Font; + FixFont(DrawInfo.Font); DrawInfo.Visible := True; if Assigned(FOnGetApptDrawInfo) then diff --git a/components/jvcllaz/run/JvTimeFramework/jvtfmanager.pas b/components/jvcllaz/run/JvTimeFramework/jvtfmanager.pas index 068ca1d83..00617f282 100644 --- a/components/jvcllaz/run/JvTimeFramework/jvtfmanager.pas +++ b/components/jvcllaz/run/JvTimeFramework/jvtfmanager.pas @@ -4658,13 +4658,7 @@ end; procedure TJvTFPrinter.NewPage; var - { wp --- to do - aMetafile: TMetafile; - } - aBitmap: TBitmap; - - - + aBitmap: TBitmap; // wp: was Metafile, but this is not supported by Lazarus aCanvas: TCanvas; HeaderRect, FooterRect: TRect; begin @@ -4700,7 +4694,7 @@ begin } end; FBodies.AddObject('', aCanvas); - //aCanvas.Font.PixelsPerInch := Printer.XDPI; + aCanvas.Font.PixelsPerInch := Printer.XDPI; FixFont(aCanvas.Font); { aCanvas.Font.PixelsPerInch := Windows.GetDeviceCaps(Printer.Handle, LOGPIXELSX);