tvplanit: Fix Fulldemo's Print routine.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5048 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-07-29 16:48:36 +00:00
parent ccf954454a
commit 5cfee9383f
11 changed files with 187 additions and 128 deletions

View File

@ -42,7 +42,7 @@
<PackageName Value="LCL"/>
</Item3>
</RequiredPackages>
<Units Count="3">
<Units Count="4">
<Unit0>
<Filename Value="demo.lpr"/>
<IsPartOfProject Value="True"/>
@ -59,6 +59,13 @@
<Filename Value="sound.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
<Unit3>
<Filename Value="ExVpRptSetup.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmReportSetup"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit3>
</Units>
</ProjectOptions>
<CompilerOptions>

View File

@ -150,7 +150,7 @@ uses
LCLVersion, LResources, LazFileUtils, LazUTF8, StrUtils, DateUtils, Translations,
IniFiles, Math, Printers,
VpMisc, VpPrtFmt,
sound;
sound, ExVpRptSetup;
{$UNDEF UTF8_CALLS}
{$IFDEF LCL}
@ -401,14 +401,30 @@ begin
end;
procedure TMainForm.MnuPrintClick(Sender: TObject);
var
F: TfrmReportSetup;
begin
if PrintDialog1.Execute then begin
Printer.BeginDoc;
{
VpControlLink1.Printer.CurFormat := VpControlLink1.Printer.Find(ReportData.Format);
VpControlLink1.Printer.Print(Printer, ReportData.StartDate, ReportData.EndDate);
}
Printer.EndDoc;
if ReportData.StartDate = 0 then
ReportData.StartDate := VpMonthView1.Date;
if ReportData.EndDate = 0 then
ReportData.EndDate := VpMonthView1.Date;
if ReportData.Format = '' then
ReportData.Format := VpControlLink1.Printer.PrintFormats.Items[0].FormatName;
F := TfrmReportSetup.Create(nil);
try
F.ControlLink := VpControlLink1;
if not F.Execute(ReportData) then
exit;
if PrintDialog1.Execute then begin
Printer.BeginDoc;
VpControlLink1.Printer.CurFormat := VpControlLink1.Printer.Find(ReportData.Format);
VpControlLink1.Printer.Print(Printer, ReportData.StartDate, ReportData.EndDate);
Printer.EndDoc;
end;
finally
F.Free;
end;
end;