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

View File

@ -150,7 +150,7 @@ uses
LCLVersion, LResources, LazFileUtils, LazUTF8, StrUtils, DateUtils, Translations, LCLVersion, LResources, LazFileUtils, LazUTF8, StrUtils, DateUtils, Translations,
IniFiles, Math, Printers, IniFiles, Math, Printers,
VpMisc, VpPrtFmt, VpMisc, VpPrtFmt,
sound; sound, ExVpRptSetup;
{$UNDEF UTF8_CALLS} {$UNDEF UTF8_CALLS}
{$IFDEF LCL} {$IFDEF LCL}
@ -401,15 +401,31 @@ begin
end; end;
procedure TMainForm.MnuPrintClick(Sender: TObject); procedure TMainForm.MnuPrintClick(Sender: TObject);
var
F: TfrmReportSetup;
begin begin
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 if PrintDialog1.Execute then begin
Printer.BeginDoc; Printer.BeginDoc;
{
VpControlLink1.Printer.CurFormat := VpControlLink1.Printer.Find(ReportData.Format); VpControlLink1.Printer.CurFormat := VpControlLink1.Printer.Find(ReportData.Format);
VpControlLink1.Printer.Print(Printer, ReportData.StartDate, ReportData.EndDate); VpControlLink1.Printer.Print(Printer, ReportData.StartDate, ReportData.EndDate);
}
Printer.EndDoc; Printer.EndDoc;
end; end;
finally
F.Free;
end;
end; end;
procedure TMainForm.MnuPrintPreviewClick(Sender: TObject); procedure TMainForm.MnuPrintPreviewClick(Sender: TObject);

View File

@ -145,62 +145,64 @@ msgstr "Mittwoch"
msgid "XML files (*.xml)" msgid "XML files (*.xml)"
msgstr "XML-Dateien (*.XML)" msgstr "XML-Dateien (*.XML)"
#: tfrmreportsetup.button1.caption #: tfrmreportsetup.btncancel.caption
msgctxt "tfrmreportsetup.button1.caption" #, fuzzy
msgid "OK" msgctxt "tfrmreportsetup.btncancel.caption"
msgstr "OK"
#: tfrmreportsetup.button2.caption
msgctxt "tfrmreportsetup.button2.caption"
msgid "Cancel" msgid "Cancel"
msgstr "Abbrechen" msgstr "Abbrechen"
#: tfrmreportsetup.btnok.caption
#, fuzzy
msgctxt "tfrmreportsetup.btnok.caption"
msgid "OK"
msgstr "OK"
#: tfrmreportsetup.caption #: tfrmreportsetup.caption
msgid "Report Setup" msgid "Report Setup"
msgstr "" msgstr ""
#: tfrmreportsetup.dateedit1.cancelcaption #: tfrmreportsetup.edenddate.cancelcaption
msgctxt "tfrmreportsetup.dateedit1.cancelcaption" #, fuzzy
msgctxt "tfrmreportsetup.edenddate.cancelcaption"
msgid "Cancel" msgid "Cancel"
msgstr "Abbrechen" msgstr "Abbrechen"
#: tfrmreportsetup.dateedit1.okcaption #: tfrmreportsetup.edenddate.okcaption
msgctxt "tfrmreportsetup.dateedit1.okcaption" #, fuzzy
msgctxt "tfrmreportsetup.edenddate.okcaption"
msgid "OK" msgid "OK"
msgstr "OK" msgstr "OK"
# No need to translate #: tfrmreportsetup.edstartdate.cancelcaption
#: tfrmreportsetup.dateedit1.text #, fuzzy
msgid "DateEdit1" msgctxt "tfrmreportsetup.edstartdate.cancelcaption"
msgstr ""
#: tfrmreportsetup.dateedit2.cancelcaption
msgctxt "tfrmreportsetup.dateedit2.cancelcaption"
msgid "Cancel" msgid "Cancel"
msgstr "Abbrechen" msgstr "Abbrechen"
#: tfrmreportsetup.dateedit2.okcaption #: tfrmreportsetup.edstartdate.okcaption
msgctxt "tfrmreportsetup.dateedit2.okcaption" #, fuzzy
msgctxt "tfrmreportsetup.edstartdate.okcaption"
msgid "OK" msgid "OK"
msgstr "OK" msgstr "OK"
# No need to translate #: tfrmreportsetup.lblenddate.caption
#: tfrmreportsetup.dateedit2.text #, fuzzy
msgid "DateEdit2" msgctxt "tfrmreportsetup.lblenddate.caption"
msgstr ""
#: tfrmreportsetup.label1.caption
msgid "Start Date:"
msgstr "Startdatum:"
#: tfrmreportsetup.label2.caption
msgid "End Date:" msgid "End Date:"
msgstr "Enddatum:" msgstr "Enddatum:"
#: tfrmreportsetup.label3.caption #: tfrmreportsetup.lblformat.caption
#, fuzzy
msgctxt "tfrmreportsetup.lblformat.caption"
msgid "Format:" msgid "Format:"
msgstr "Format:" msgstr "Format:"
#: tfrmreportsetup.lblstartdate.caption
#, fuzzy
msgctxt "tfrmreportsetup.lblstartdate.caption"
msgid "Start Date:"
msgstr "Startdatum:"
#: tmainform.btndeleteres.caption #: tmainform.btndeleteres.caption
msgid "Delete" msgid "Delete"
msgstr "Löschen" msgstr "Löschen"
@ -327,3 +329,4 @@ msgstr "Fertiggestellte Aufgaben ausblenden"
#: tmainform.titlelbl.caption #: tmainform.titlelbl.caption
msgid "TitleLbl" msgid "TitleLbl"
msgstr "" msgstr ""

View File

@ -134,60 +134,64 @@ msgstr "Woensdag"
msgid "XML files (*.xml)" msgid "XML files (*.xml)"
msgstr "" msgstr ""
#: tfrmreportsetup.button1.caption #: tfrmreportsetup.btncancel.caption
msgctxt "tfrmreportsetup.button1.caption" #, fuzzy
msgid "OK" msgctxt "tfrmreportsetup.btncancel.caption"
msgstr "OK"
#: tfrmreportsetup.button2.caption
msgctxt "tfrmreportsetup.button2.caption"
msgid "Cancel" msgid "Cancel"
msgstr "Annuleren" msgstr "Annuleren"
#: tfrmreportsetup.btnok.caption
#, fuzzy
msgctxt "tfrmreportsetup.btnok.caption"
msgid "OK"
msgstr "OK"
#: tfrmreportsetup.caption #: tfrmreportsetup.caption
msgid "Report Setup" msgid "Report Setup"
msgstr "Overzicht Instellingen" msgstr "Overzicht Instellingen"
#: tfrmreportsetup.dateedit1.cancelcaption #: tfrmreportsetup.edenddate.cancelcaption
msgctxt "TFRMREPORTSETUP.DATEEDIT1.CANCELCAPTION" #, fuzzy
msgctxt "tfrmreportsetup.edenddate.cancelcaption"
msgid "Cancel" msgid "Cancel"
msgstr "Annuleren" msgstr "Annuleren"
#: tfrmreportsetup.dateedit1.okcaption #: tfrmreportsetup.edenddate.okcaption
msgctxt "TFRMREPORTSETUP.DATEEDIT1.OKCAPTION" #, fuzzy
msgctxt "tfrmreportsetup.edenddate.okcaption"
msgid "OK" msgid "OK"
msgstr "OK" msgstr "OK"
#: tfrmreportsetup.dateedit1.text #: tfrmreportsetup.edstartdate.cancelcaption
msgid "DateEdit1" #, fuzzy
msgstr "DateEdit1" msgctxt "tfrmreportsetup.edstartdate.cancelcaption"
#: tfrmreportsetup.dateedit2.cancelcaption
msgctxt "TFRMREPORTSETUP.DATEEDIT2.CANCELCAPTION"
msgid "Cancel" msgid "Cancel"
msgstr "Annuleren" msgstr "Annuleren"
#: tfrmreportsetup.dateedit2.okcaption #: tfrmreportsetup.edstartdate.okcaption
msgctxt "TFRMREPORTSETUP.DATEEDIT2.OKCAPTION" #, fuzzy
msgctxt "tfrmreportsetup.edstartdate.okcaption"
msgid "OK" msgid "OK"
msgstr "OK" msgstr "OK"
#: tfrmreportsetup.dateedit2.text #: tfrmreportsetup.lblenddate.caption
msgid "DateEdit2" #, fuzzy
msgstr "DateEdit2" msgctxt "tfrmreportsetup.lblenddate.caption"
#: tfrmreportsetup.label1.caption
msgid "Start Date:"
msgstr "Start Datum:"
#: tfrmreportsetup.label2.caption
msgid "End Date:" msgid "End Date:"
msgstr "Eind Datum:" msgstr "Eind Datum:"
#: tfrmreportsetup.label3.caption #: tfrmreportsetup.lblformat.caption
#, fuzzy
msgctxt "tfrmreportsetup.lblformat.caption"
msgid "Format:" msgid "Format:"
msgstr "Formaat:" msgstr "Formaat:"
#: tfrmreportsetup.lblstartdate.caption
#, fuzzy
msgctxt "tfrmreportsetup.lblstartdate.caption"
msgid "Start Date:"
msgstr "Start Datum:"
#: tmainform.btndeleteres.caption #: tmainform.btndeleteres.caption
msgid "Delete" msgid "Delete"
msgstr "Wissen" msgstr "Wissen"

View File

@ -134,60 +134,55 @@ msgstr ""
msgid "XML files (*.xml)" msgid "XML files (*.xml)"
msgstr "" msgstr ""
#: tfrmreportsetup.button1.caption #: tfrmreportsetup.btncancel.caption
msgctxt "tfrmreportsetup.button1.caption" msgctxt "tfrmreportsetup.btncancel.caption"
msgid "OK" msgid "Cancel"
msgstr "" msgstr ""
#: tfrmreportsetup.button2.caption #: tfrmreportsetup.btnok.caption
msgctxt "tfrmreportsetup.button2.caption" msgctxt "tfrmreportsetup.btnok.caption"
msgid "Cancel" msgid "OK"
msgstr "" msgstr ""
#: tfrmreportsetup.caption #: tfrmreportsetup.caption
msgid "Report Setup" msgid "Report Setup"
msgstr "" msgstr ""
#: tfrmreportsetup.dateedit1.cancelcaption #: tfrmreportsetup.edenddate.cancelcaption
msgctxt "TFRMREPORTSETUP.DATEEDIT1.CANCELCAPTION" msgctxt "tfrmreportsetup.edenddate.cancelcaption"
msgid "Cancel" msgid "Cancel"
msgstr "" msgstr ""
#: tfrmreportsetup.dateedit1.okcaption #: tfrmreportsetup.edenddate.okcaption
msgctxt "TFRMREPORTSETUP.DATEEDIT1.OKCAPTION" msgctxt "tfrmreportsetup.edenddate.okcaption"
msgid "OK" msgid "OK"
msgstr "" msgstr ""
#: tfrmreportsetup.dateedit1.text #: tfrmreportsetup.edstartdate.cancelcaption
msgid "DateEdit1" msgctxt "tfrmreportsetup.edstartdate.cancelcaption"
msgstr ""
#: tfrmreportsetup.dateedit2.cancelcaption
msgctxt "TFRMREPORTSETUP.DATEEDIT2.CANCELCAPTION"
msgid "Cancel" msgid "Cancel"
msgstr "" msgstr ""
#: tfrmreportsetup.dateedit2.okcaption #: tfrmreportsetup.edstartdate.okcaption
msgctxt "TFRMREPORTSETUP.DATEEDIT2.OKCAPTION" msgctxt "tfrmreportsetup.edstartdate.okcaption"
msgid "OK" msgid "OK"
msgstr "" msgstr ""
#: tfrmreportsetup.dateedit2.text #: tfrmreportsetup.lblenddate.caption
msgid "DateEdit2" msgctxt "tfrmreportsetup.lblenddate.caption"
msgstr ""
#: tfrmreportsetup.label1.caption
msgid "Start Date:"
msgstr ""
#: tfrmreportsetup.label2.caption
msgid "End Date:" msgid "End Date:"
msgstr "" msgstr ""
#: tfrmreportsetup.label3.caption #: tfrmreportsetup.lblformat.caption
msgctxt "tfrmreportsetup.lblformat.caption"
msgid "Format:" msgid "Format:"
msgstr "" msgstr ""
#: tfrmreportsetup.lblstartdate.caption
msgctxt "tfrmreportsetup.lblstartdate.caption"
msgid "Start Date:"
msgstr ""
#: tmainform.btndeleteres.caption #: tmainform.btndeleteres.caption
msgid "Delete" msgid "Delete"
msgstr "" msgstr ""

View File

@ -144,62 +144,61 @@ msgstr "Среда"
msgid "XML files (*.xml)" msgid "XML files (*.xml)"
msgstr "" msgstr ""
#: tfrmreportsetup.button1.caption #: tfrmreportsetup.btncancel.caption
msgctxt "tfrmreportsetup.button1.caption" #, fuzzy
msgid "OK" msgctxt "tfrmreportsetup.btncancel.caption"
msgstr ""
#: tfrmreportsetup.button2.caption
msgctxt "tfrmreportsetup.button2.caption"
msgid "Cancel" msgid "Cancel"
msgstr "Отмена" msgstr "Отмена"
#: tfrmreportsetup.btnok.caption
msgctxt "tfrmreportsetup.btnok.caption"
msgid "OK"
msgstr ""
#: tfrmreportsetup.caption #: tfrmreportsetup.caption
msgid "Report Setup" msgid "Report Setup"
msgstr "Параметры отчёта" msgstr "Параметры отчёта"
#: tfrmreportsetup.dateedit1.cancelcaption #: tfrmreportsetup.edenddate.cancelcaption
msgctxt "TFRMREPORTSETUP.DATEEDIT1.CANCELCAPTION" #, fuzzy
msgctxt "tfrmreportsetup.edenddate.cancelcaption"
msgid "Cancel" msgid "Cancel"
msgstr "Отмена" msgstr "Отмена"
#: tfrmreportsetup.dateedit1.okcaption #: tfrmreportsetup.edenddate.okcaption
msgctxt "TFRMREPORTSETUP.DATEEDIT1.OKCAPTION" msgctxt "tfrmreportsetup.edenddate.okcaption"
msgid "OK" msgid "OK"
msgstr "" msgstr ""
# No need to translate #: tfrmreportsetup.edstartdate.cancelcaption
#: tfrmreportsetup.dateedit1.text #, fuzzy
msgid "DateEdit1" msgctxt "tfrmreportsetup.edstartdate.cancelcaption"
msgstr ""
#: tfrmreportsetup.dateedit2.cancelcaption
msgctxt "TFRMREPORTSETUP.DATEEDIT2.CANCELCAPTION"
msgid "Cancel" msgid "Cancel"
msgstr "Отмена" msgstr "Отмена"
#: tfrmreportsetup.dateedit2.okcaption #: tfrmreportsetup.edstartdate.okcaption
msgctxt "TFRMREPORTSETUP.DATEEDIT2.OKCAPTION" msgctxt "tfrmreportsetup.edstartdate.okcaption"
msgid "OK" msgid "OK"
msgstr "" msgstr ""
# No need to translate #: tfrmreportsetup.lblenddate.caption
#: tfrmreportsetup.dateedit2.text #, fuzzy
msgid "DateEdit2" msgctxt "tfrmreportsetup.lblenddate.caption"
msgstr ""
#: tfrmreportsetup.label1.caption
msgid "Start Date:"
msgstr "Дата начала:"
#: tfrmreportsetup.label2.caption
msgid "End Date:" msgid "End Date:"
msgstr "Дата окончания:" msgstr "Дата окончания:"
#: tfrmreportsetup.label3.caption #: tfrmreportsetup.lblformat.caption
#, fuzzy
msgctxt "tfrmreportsetup.lblformat.caption"
msgid "Format:" msgid "Format:"
msgstr "Формат:" msgstr "Формат:"
#: tfrmreportsetup.lblstartdate.caption
#, fuzzy
msgctxt "tfrmreportsetup.lblstartdate.caption"
msgid "Start Date:"
msgstr "Дата начала:"
#: tmainform.btndeleteres.caption #: tmainform.btndeleteres.caption
msgid "Delete" msgid "Delete"
msgstr "Удалить" msgstr "Удалить"

View File

@ -551,6 +551,10 @@ msgstr "Vorname:"
msgid "Font..." msgid "Font..."
msgstr "Schriftart..." msgstr "Schriftart..."
#: vpsr.rsformatlbl
msgid "Format:"
msgstr "Format:"
#: vpsr.rsformats #: vpsr.rsformats
msgid "Formats:" msgid "Formats:"
msgstr "Formate:" msgstr "Formate:"
@ -1041,6 +1045,10 @@ msgstr "Termin-Wiederholung:"
msgid "Reminder" msgid "Reminder"
msgstr "Erinnerung" msgstr "Erinnerung"
#: vpsr.rsreportsetup
msgid "Report setup"
msgstr "Druck einrichten"
#: vpsr.rsresource #: vpsr.rsresource
msgid "Resource" msgid "Resource"
msgstr "Ressource" msgstr "Ressource"

View File

@ -554,6 +554,10 @@ msgstr "Voornaam:"
msgid "Font..." msgid "Font..."
msgstr "" msgstr ""
#: vpsr.rsformatlbl
msgid "Format:"
msgstr ""
#: vpsr.rsformats #: vpsr.rsformats
msgid "Formats:" msgid "Formats:"
msgstr "" msgstr ""
@ -1044,6 +1048,10 @@ msgstr "Afspraak herhaling:"
msgid "Reminder" msgid "Reminder"
msgstr "Herinnering" msgstr "Herinnering"
#: vpsr.rsreportsetup
msgid "Report setup"
msgstr ""
#: vpsr.rsresource #: vpsr.rsresource
msgid "Resource" msgid "Resource"
msgstr "Hulpmiddel" msgstr "Hulpmiddel"

View File

@ -541,6 +541,10 @@ msgstr ""
msgid "Font..." msgid "Font..."
msgstr "" msgstr ""
#: vpsr.rsformatlbl
msgid "Format:"
msgstr ""
#: vpsr.rsformats #: vpsr.rsformats
msgid "Formats:" msgid "Formats:"
msgstr "" msgstr ""
@ -1031,6 +1035,10 @@ msgstr ""
msgid "Reminder" msgid "Reminder"
msgstr "" msgstr ""
#: vpsr.rsreportsetup
msgid "Report setup"
msgstr ""
#: vpsr.rsresource #: vpsr.rsresource
msgid "Resource" msgid "Resource"
msgstr "" msgstr ""

View File

@ -551,6 +551,10 @@ msgstr "Имя:"
msgid "Font..." msgid "Font..."
msgstr "Шрифт..." msgstr "Шрифт..."
#: vpsr.rsformatlbl
msgid "Format:"
msgstr ""
#: vpsr.rsformats #: vpsr.rsformats
msgid "Formats:" msgid "Formats:"
msgstr "Форматы:" msgstr "Форматы:"
@ -1041,6 +1045,10 @@ msgstr "Повторение встречи:"
msgid "Reminder" msgid "Reminder"
msgstr "Напоминание" msgstr "Напоминание"
#: vpsr.rsreportsetup
msgid "Report setup"
msgstr ""
#: vpsr.rsresource #: vpsr.rsresource
msgid "Resource" msgid "Resource"
msgstr "Ресурс" msgstr "Ресурс"

View File

@ -409,6 +409,7 @@ resourcestring
{ Print Format Editor } { Print Format Editor }
RSEditPrintFormat = 'Edit Print Formats...'; RSEditPrintFormat = 'Edit Print Formats...';
RSPrintFormatDesigner = 'Print format designer'; RSPrintFormatDesigner = 'Print format designer';
RSFormatLbl = 'Format:';
RSFormats = 'Formats:'; RSFormats = 'Formats:';
RSElements = 'Elements:'; RSElements = 'Elements:';
RSNewBtn = 'New'; RSNewBtn = 'New';
@ -419,6 +420,8 @@ resourcestring
RSLoadFileBtn = 'Load file...'; RSLoadFileBtn = 'Load file...';
RSSaveFileBtn = 'Save file...'; RSSaveFileBtn = 'Save file...';
RSReportSetup = 'Report setup';
{ Print Format Item Editor } { Print Format Item Editor }
RSEditFormatCaption= 'Edit format'; RSEditFormatCaption= 'Edit format';
RSNameLbl = 'Name:'; RSNameLbl = 'Name:';