From ccf954454a2eb7e67dcfa20805e77c0428ba834e Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Fri, 29 Jul 2016 15:56:52 +0000 Subject: [PATCH] tvplanit: Add loading of saved print formats to FullDemo. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5047 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../tvplanit/examples/fulldemo/demomain.lfm | 15 + .../tvplanit/examples/fulldemo/demomain.pas | 16 + .../examples/fulldemo/printerdefs.xml | 746 ++++++++++++++++++ components/tvplanit/languages/demo.de.po | 15 +- components/tvplanit/languages/demo.nl.po | 14 + components/tvplanit/languages/demo.po | 14 + components/tvplanit/languages/demo.ru.po | 14 + 7 files changed, 833 insertions(+), 1 deletion(-) create mode 100644 components/tvplanit/examples/fulldemo/printerdefs.xml diff --git a/components/tvplanit/examples/fulldemo/demomain.lfm b/components/tvplanit/examples/fulldemo/demomain.lfm index 15f4e328e..a04a03947 100644 --- a/components/tvplanit/examples/fulldemo/demomain.lfm +++ b/components/tvplanit/examples/fulldemo/demomain.lfm @@ -787,6 +787,7 @@ object MainForm: TMainForm OnPlaySound = VpBufDSDataStore1PlaySound AutoConnect = True AutoCreate = True + DayBuffer = 31 Directory = 'data' left = 312 top = 128 @@ -1961,6 +1962,13 @@ object MainForm: TMainForm Caption = 'Edit print formats...' OnClick = MnuEditPrintFormatsClick end + object MnuLoadPrintFormats: TMenuItem + Caption = 'Load print formats...' + OnClick = MnuLoadPrintFormatsClick + end + object MenuItem4: TMenuItem + Caption = '-' + end object MnuPrintPreview: TMenuItem Caption = 'Print preview...' OnClick = MnuPrintPreviewClick @@ -2033,4 +2041,11 @@ object MainForm: TMainForm left = 712 top = 192 end + object OpenDialog: TOpenDialog + DefaultExt = '.xml' + Filter = 'xml files (*.xml)|*.xml' + Options = [ofFileMustExist, ofEnableSizing, ofViewDetail] + left = 560 + top = 440 + end end diff --git a/components/tvplanit/examples/fulldemo/demomain.pas b/components/tvplanit/examples/fulldemo/demomain.pas index 00935c36b..bbaa89c68 100644 --- a/components/tvplanit/examples/fulldemo/demomain.pas +++ b/components/tvplanit/examples/fulldemo/demomain.pas @@ -38,11 +38,14 @@ type LblLanguage: TLabel; LblVisibleDays: TLabel; MenuItem3: TMenuItem; + MenuItem4: TMenuItem; + MnuLoadPrintFormats: TMenuItem; MnuPrint: TMenuItem; MnuEditPrintFormats: TMenuItem; MnuPrintPreview: TMenuItem; Notebook: TNotebook; Events: TPage; + OpenDialog: TOpenDialog; Tasks: TPage; Contacts: TPage; Resources: TPage; @@ -96,6 +99,7 @@ type procedure FormCreate(Sender: TObject); procedure MnuAboutClick(Sender: TObject); procedure MnuEditPrintFormatsClick(Sender: TObject); + procedure MnuLoadPrintFormatsClick(Sender: TObject); procedure MnuPrintClick(Sender: TObject); procedure MnuPrintPreviewClick(Sender: TObject); procedure MnuQuitClick(Sender: TObject); @@ -191,6 +195,7 @@ resourcestring RSFlat = 'flat'; RS3d = '3D'; RSBorderless = 'no border'; + RSXMLFiles = 'XML files (*.xml)'; {$IFDEF WINDOWS} { This function determines the LCID from the language code. @@ -386,6 +391,15 @@ begin VpPrintFormatEditDialog1.Execute; end; +procedure TMainForm.MnuLoadPrintFormatsClick(Sender: TObject); +begin + if OpenDialog.Filename = '' then + OpenDialog.InitialDir := Application.Location else + OpenDialog.InitialDir := ExtractFileDir(OpenDialog.FileName); + if OpenDialog.Execute then + VpControlLink1.Printer.LoadFromFile(Opendialog.Filename, false); +end; + procedure TMainForm.MnuPrintClick(Sender: TObject); begin if PrintDialog1.Execute then begin @@ -784,6 +798,8 @@ begin CbDrawingStyle.Items.Add(RS3d); CbDrawingStyle.Items.Add(RSBorderless); + OpenDialog.Filter := rsXMLFiles + '|*.xml'; + // Next settings work correctly only for Windows. {$IFDEF WINDOWS} UpdateFormatSettings(ALang); diff --git a/components/tvplanit/examples/fulldemo/printerdefs.xml b/components/tvplanit/examples/fulldemo/printerdefs.xml new file mode 100644 index 000000000..79891fe08 --- /dev/null +++ b/components/tvplanit/examples/fulldemo/printerdefs.xml @@ -0,0 +1,746 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/tvplanit/languages/demo.de.po b/components/tvplanit/languages/demo.de.po index 44eaf5514..9be9d9db1 100644 --- a/components/tvplanit/languages/demo.de.po +++ b/components/tvplanit/languages/demo.de.po @@ -141,6 +141,10 @@ msgstr "Dienstag" msgid "Wednesday" msgstr "Mittwoch" +#: demomain.rsxmlfiles +msgid "XML files (*.xml)" +msgstr "XML-Dateien (*.XML)" + #: tfrmreportsetup.button1.caption msgctxt "tfrmreportsetup.button1.caption" msgid "OK" @@ -263,6 +267,12 @@ msgid "Help" msgstr "Hilfe" #: tmainform.menuitem3.caption +msgctxt "tmainform.menuitem3.caption" +msgid "-" +msgstr "" + +#: tmainform.menuitem4.caption +msgctxt "tmainform.menuitem4.caption" msgid "-" msgstr "" @@ -274,6 +284,10 @@ msgstr "Über Visual PlanIt" msgid "Edit print formats..." msgstr "Druckformate bearbeiten..." +#: tmainform.mnuloadprintformats.caption +msgid "Load print formats..." +msgstr "Druckformate laden..." + #: tmainform.mnumaintenance.caption msgctxt "tmainform.mnumaintenance.caption" msgid "Maintenance" @@ -313,4 +327,3 @@ msgstr "Fertiggestellte Aufgaben ausblenden" #: tmainform.titlelbl.caption msgid "TitleLbl" msgstr "" - diff --git a/components/tvplanit/languages/demo.nl.po b/components/tvplanit/languages/demo.nl.po index e200015b7..69a74ba11 100644 --- a/components/tvplanit/languages/demo.nl.po +++ b/components/tvplanit/languages/demo.nl.po @@ -130,6 +130,10 @@ msgstr "Dinsdag" msgid "Wednesday" msgstr "Woensdag" +#: demomain.rsxmlfiles +msgid "XML files (*.xml)" +msgstr "" + #: tfrmreportsetup.button1.caption msgctxt "tfrmreportsetup.button1.caption" msgid "OK" @@ -250,6 +254,12 @@ msgid "Help" msgstr "Help" #: tmainform.menuitem3.caption +msgctxt "tmainform.menuitem3.caption" +msgid "-" +msgstr "" + +#: tmainform.menuitem4.caption +msgctxt "tmainform.menuitem4.caption" msgid "-" msgstr "" @@ -261,6 +271,10 @@ msgstr "Over Visual PlanIt" msgid "Edit print formats..." msgstr "" +#: tmainform.mnuloadprintformats.caption +msgid "Load print formats..." +msgstr "" + #: tmainform.mnumaintenance.caption msgctxt "TMAINFORM.MNUMAINTENANCE.CAPTION" msgid "Maintenance" diff --git a/components/tvplanit/languages/demo.po b/components/tvplanit/languages/demo.po index 4bbd9541a..ac02906d6 100644 --- a/components/tvplanit/languages/demo.po +++ b/components/tvplanit/languages/demo.po @@ -130,6 +130,10 @@ msgstr "" msgid "Wednesday" msgstr "" +#: demomain.rsxmlfiles +msgid "XML files (*.xml)" +msgstr "" + #: tfrmreportsetup.button1.caption msgctxt "tfrmreportsetup.button1.caption" msgid "OK" @@ -250,6 +254,12 @@ msgid "Help" msgstr "" #: tmainform.menuitem3.caption +msgctxt "tmainform.menuitem3.caption" +msgid "-" +msgstr "" + +#: tmainform.menuitem4.caption +msgctxt "tmainform.menuitem4.caption" msgid "-" msgstr "" @@ -261,6 +271,10 @@ msgstr "" msgid "Edit print formats..." msgstr "" +#: tmainform.mnuloadprintformats.caption +msgid "Load print formats..." +msgstr "" + #: tmainform.mnumaintenance.caption msgctxt "TMAINFORM.MNUMAINTENANCE.CAPTION" msgid "Maintenance" diff --git a/components/tvplanit/languages/demo.ru.po b/components/tvplanit/languages/demo.ru.po index 800647fcf..5b74dee59 100644 --- a/components/tvplanit/languages/demo.ru.po +++ b/components/tvplanit/languages/demo.ru.po @@ -140,6 +140,10 @@ msgstr "Вторник" msgid "Wednesday" msgstr "Среда" +#: demomain.rsxmlfiles +msgid "XML files (*.xml)" +msgstr "" + #: tfrmreportsetup.button1.caption msgctxt "tfrmreportsetup.button1.caption" msgid "OK" @@ -262,6 +266,12 @@ msgid "Help" msgstr "Справка" #: tmainform.menuitem3.caption +msgctxt "tmainform.menuitem3.caption" +msgid "-" +msgstr "" + +#: tmainform.menuitem4.caption +msgctxt "tmainform.menuitem4.caption" msgid "-" msgstr "" @@ -273,6 +283,10 @@ msgstr "О Visual PlanIt" msgid "Edit print formats..." msgstr "Редактор формата печати..." +#: tmainform.mnuloadprintformats.caption +msgid "Load print formats..." +msgstr "" + #: tmainform.mnumaintenance.caption msgctxt "TMAINFORM.MNUMAINTENANCE.CAPTION" msgid "Maintenance"