From 0e2597658169e86bb86f3432171f4640e91b0f84 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Fri, 5 Aug 2016 22:07:34 +0000 Subject: [PATCH] tvplanit: DPI-aware report setup dialog of fulldemo. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5075 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../examples/fulldemo/ExVpRptSetup.lfm | 18 ++++------ .../examples/fulldemo/ExVpRptSetup.pas | 35 +++++++++++++++++++ components/tvplanit/languages/demo.de.po | 21 +---------- components/tvplanit/languages/demo.nl.po | 24 ------------- components/tvplanit/languages/demo.po | 20 ----------- components/tvplanit/languages/demo.ru.po | 22 ------------ 6 files changed, 43 insertions(+), 97 deletions(-) diff --git a/components/tvplanit/examples/fulldemo/ExVpRptSetup.lfm b/components/tvplanit/examples/fulldemo/ExVpRptSetup.lfm index d25ecf81b..d9ccdfddf 100644 --- a/components/tvplanit/examples/fulldemo/ExVpRptSetup.lfm +++ b/components/tvplanit/examples/fulldemo/ExVpRptSetup.lfm @@ -2,11 +2,11 @@ object frmReportSetup: TfrmReportSetup Left = 380 Height = 138 Top = 138 - Width = 254 + Width = 291 BorderStyle = bsDialog Caption = 'Report Setup' ClientHeight = 138 - ClientWidth = 254 + ClientWidth = 291 Color = clBtnFace Font.Color = clWindowText OnCreate = FormCreate @@ -41,7 +41,7 @@ object frmReportSetup: TfrmReportSetup ParentColor = False end object btnOK: TButton - Left = 90 + Left = 128 Height = 25 Top = 104 Width = 75 @@ -51,7 +51,7 @@ object frmReportSetup: TfrmReportSetup TabOrder = 3 end object btnCancel: TButton - Left = 170 + Left = 208 Height = 25 Top = 104 Width = 75 @@ -64,7 +64,7 @@ object frmReportSetup: TfrmReportSetup Left = 76 Height = 23 Top = 72 - Width = 169 + Width = 207 ItemHeight = 15 Sorted = True TabOrder = 2 @@ -73,10 +73,8 @@ object frmReportSetup: TfrmReportSetup Left = 76 Height = 23 Top = 12 - Width = 171 + Width = 207 CalendarDisplaySettings = [dsShowHeadings, dsShowDayNames] - OKCaption = 'OK' - CancelCaption = 'Cancel' DateOrder = doNone ButtonWidth = 23 NumGlyphs = 1 @@ -87,10 +85,8 @@ object frmReportSetup: TfrmReportSetup Left = 76 Height = 23 Top = 36 - Width = 171 + Width = 207 CalendarDisplaySettings = [dsShowHeadings, dsShowDayNames] - OKCaption = 'OK' - CancelCaption = 'Cancel' DateOrder = doNone ButtonWidth = 23 NumGlyphs = 1 diff --git a/components/tvplanit/examples/fulldemo/ExVpRptSetup.pas b/components/tvplanit/examples/fulldemo/ExVpRptSetup.pas index 7bae67769..efde388a1 100644 --- a/components/tvplanit/examples/fulldemo/ExVpRptSetup.pas +++ b/components/tvplanit/examples/fulldemo/ExVpRptSetup.pas @@ -123,8 +123,23 @@ procedure TfrmReportSetup.PositionControls; var w: Integer; delta: Integer = 8; + vdist: Integer = 4; + editHeight: Integer; + buttonHeight: Integer; begin delta := ScaleX(8, DesignTimeDPI); + vdist := ScaleY(4, DesignTimeDPI); + buttonHeight := ScaleY(btnOK.Height, DesignTimeDPI); + + with TEdit.Create(nil) do + try + Parent := self; + editHeight := Height; + finally + Free; + end; + + // horizontal w := Maxvalue([GetLabelWidth(lblStartDate), GetLabelWidth(lblEndDate), GetLabelWidth(lblFormat)]); edStartDate.Left := delta + w + delta; lblStartDate.Left := edStartDate.Left - delta - GetLabelWidth(lblStartDate); @@ -139,6 +154,26 @@ begin btnCancel.Width := w; btnCancel.Left := ClientWidth - delta - w; btnOK.Left := btnCancel.Left - delta - w; + + // vertical + edStartdate.Height := editHeight; + edEndDate.Height := editHeight; + edStartDate.ButtonWidth := editHeight; + edEndDate.ButtonWidth := editHeight; + + edEndDate.Top := BottomOf(edStartDate) + vdist; + lblStartDate.Top := edStartDate.Top + (edStartDate.Height - lblStartDate.Height) div 2; + lblEndDate.Top := edEndDate.Top + (edEndDate.Height - lblEndDate.Height) div 2; + + VpPrintFormatCombobox1.Top := Bottomof(edEndDate) + 2*vdist; + lblFormat.Top := VpPrintFormatCombobox1.Top + (VpPrintFormatCombobox1.Height - lblFormat.Height) div 2; + + btnOK.Top := BottomOf(VpPrintFormatCombobox1) + 2*vdist; + btnCancel.Top := btnOK.Top; + btnOK.Height := buttonHeight; + btnCancel.Height := buttonHeight; + + ClientHeight := BottomOf(btnOK) + delta; end; procedure TfrmReportSetup.SaveData(out ReportData: TReportDataRec); diff --git a/components/tvplanit/languages/demo.de.po b/components/tvplanit/languages/demo.de.po index 1e24ab1f2..d8f7ea12f 100644 --- a/components/tvplanit/languages/demo.de.po +++ b/components/tvplanit/languages/demo.de.po @@ -159,26 +159,6 @@ msgstr "OK" msgid "Report Setup" msgstr "Ausdruck einrichten" -#: tfrmreportsetup.edenddate.cancelcaption -msgctxt "tfrmreportsetup.edenddate.cancelcaption" -msgid "Cancel" -msgstr "Abbrechen" - -#: tfrmreportsetup.edenddate.okcaption -msgctxt "tfrmreportsetup.edenddate.okcaption" -msgid "OK" -msgstr "OK" - -#: tfrmreportsetup.edstartdate.cancelcaption -msgctxt "tfrmreportsetup.edstartdate.cancelcaption" -msgid "Cancel" -msgstr "Abbrechen" - -#: tfrmreportsetup.edstartdate.okcaption -msgctxt "tfrmreportsetup.edstartdate.okcaption" -msgid "OK" -msgstr "OK" - #: tfrmreportsetup.lblenddate.caption msgctxt "tfrmreportsetup.lblenddate.caption" msgid "End Date:" @@ -322,3 +302,4 @@ 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 dae45093e..ef0821cd8 100644 --- a/components/tvplanit/languages/demo.nl.po +++ b/components/tvplanit/languages/demo.nl.po @@ -150,30 +150,6 @@ msgstr "OK" msgid "Report Setup" msgstr "Overzicht Instellingen" -#: tfrmreportsetup.edenddate.cancelcaption -#, fuzzy -msgctxt "tfrmreportsetup.edenddate.cancelcaption" -msgid "Cancel" -msgstr "Annuleren" - -#: tfrmreportsetup.edenddate.okcaption -#, fuzzy -msgctxt "tfrmreportsetup.edenddate.okcaption" -msgid "OK" -msgstr "OK" - -#: tfrmreportsetup.edstartdate.cancelcaption -#, fuzzy -msgctxt "tfrmreportsetup.edstartdate.cancelcaption" -msgid "Cancel" -msgstr "Annuleren" - -#: tfrmreportsetup.edstartdate.okcaption -#, fuzzy -msgctxt "tfrmreportsetup.edstartdate.okcaption" -msgid "OK" -msgstr "OK" - #: tfrmreportsetup.lblenddate.caption #, fuzzy msgctxt "tfrmreportsetup.lblenddate.caption" diff --git a/components/tvplanit/languages/demo.po b/components/tvplanit/languages/demo.po index 036dc7cb8..f06f37d05 100644 --- a/components/tvplanit/languages/demo.po +++ b/components/tvplanit/languages/demo.po @@ -148,26 +148,6 @@ msgstr "" msgid "Report Setup" msgstr "" -#: tfrmreportsetup.edenddate.cancelcaption -msgctxt "tfrmreportsetup.edenddate.cancelcaption" -msgid "Cancel" -msgstr "" - -#: tfrmreportsetup.edenddate.okcaption -msgctxt "tfrmreportsetup.edenddate.okcaption" -msgid "OK" -msgstr "" - -#: tfrmreportsetup.edstartdate.cancelcaption -msgctxt "tfrmreportsetup.edstartdate.cancelcaption" -msgid "Cancel" -msgstr "" - -#: tfrmreportsetup.edstartdate.okcaption -msgctxt "tfrmreportsetup.edstartdate.okcaption" -msgid "OK" -msgstr "" - #: tfrmreportsetup.lblenddate.caption msgctxt "tfrmreportsetup.lblenddate.caption" msgid "End Date:" diff --git a/components/tvplanit/languages/demo.ru.po b/components/tvplanit/languages/demo.ru.po index edb5e0489..a98e54292 100644 --- a/components/tvplanit/languages/demo.ru.po +++ b/components/tvplanit/languages/demo.ru.po @@ -159,28 +159,6 @@ msgstr "" msgid "Report Setup" msgstr "Параметры отчёта" -#: tfrmreportsetup.edenddate.cancelcaption -#, fuzzy -msgctxt "tfrmreportsetup.edenddate.cancelcaption" -msgid "Cancel" -msgstr "Отмена" - -#: tfrmreportsetup.edenddate.okcaption -msgctxt "tfrmreportsetup.edenddate.okcaption" -msgid "OK" -msgstr "" - -#: tfrmreportsetup.edstartdate.cancelcaption -#, fuzzy -msgctxt "tfrmreportsetup.edstartdate.cancelcaption" -msgid "Cancel" -msgstr "Отмена" - -#: tfrmreportsetup.edstartdate.okcaption -msgctxt "tfrmreportsetup.edstartdate.okcaption" -msgid "OK" -msgstr "" - #: tfrmreportsetup.lblenddate.caption #, fuzzy msgctxt "tfrmreportsetup.lblenddate.caption"