From b2991baa90c4aafc2dccf7ddef3778aa33ba8903 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Mon, 3 Oct 2022 17:06:43 +0000 Subject: [PATCH] tvplanit: Some improvements in VpEdFmtLst. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8508 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../tvplanit/examples/fulldemo/demomain.lfm | 4 +-- .../tvplanit/examples/fulldemo/demomain.pas | 2 ++ components/tvplanit/languages/vpsr.de.po | 5 ++- components/tvplanit/source/vpedfmtlst.lfm | 15 +++++---- components/tvplanit/source/vpedfmtlst.lrj | 2 +- components/tvplanit/source/vpedfmtlst.pas | 32 ++++++++----------- 6 files changed, 29 insertions(+), 31 deletions(-) diff --git a/components/tvplanit/examples/fulldemo/demomain.lfm b/components/tvplanit/examples/fulldemo/demomain.lfm index 352ff34c4..3b2a17e7c 100644 --- a/components/tvplanit/examples/fulldemo/demomain.lfm +++ b/components/tvplanit/examples/fulldemo/demomain.lfm @@ -807,8 +807,8 @@ object MainForm: TMainForm object VpControlLink1: TVpControlLink LocalizationFile = '../../source/vplocalize.xml' Printer.BottomMargin = 5 - Printer.DayStart = h_08 - Printer.DayEnd = h_16 + Printer.DayStart = h_00 + Printer.DayEnd = h_23 Printer.Granularity = gr30Min Printer.LeftMargin = 5 Printer.MarginUnits = imPercent diff --git a/components/tvplanit/examples/fulldemo/demomain.pas b/components/tvplanit/examples/fulldemo/demomain.pas index 843d628ac..e8627d256 100644 --- a/components/tvplanit/examples/fulldemo/demomain.pas +++ b/components/tvplanit/examples/fulldemo/demomain.pas @@ -776,9 +776,11 @@ begin t1 := StartOfTheWeek(now); t2 := t1 + 7 - VpDayView1.NumDays mod 7; // + 7; fmt.DayInc := VpDayView1.NumDays; + { VpControlLink1.Printer.Granularity := gr30Min; VpControlLink1.Printer.DayStart := h_08; VpControlLink1.Printer.DayEnd := h_18; + } end; 1: begin // current week in WeekView t1 := StartOfTheWeek(now); diff --git a/components/tvplanit/languages/vpsr.de.po b/components/tvplanit/languages/vpsr.de.po index d3bea7f6e..c6908d59a 100644 --- a/components/tvplanit/languages/vpsr.de.po +++ b/components/tvplanit/languages/vpsr.de.po @@ -581,7 +581,7 @@ msgstr "Markierte Einträge importieren" #: vpsr.rsimporticalevent msgid "Import ICalendar Event" -msgstr "iCalendar-Termin importieren" +msgstr "ICalendar-Termin importieren" #: vpsr.rsimporticaltask msgid "Import ICalendar Task" @@ -1095,7 +1095,7 @@ msgstr "Druckformat-Designer" msgid "Print order" msgstr "" "Druck-\n" -"Reihenfolge\n" +"Reihenfolge" #: vpsr.rsprintprvcancel msgctxt "vpsr.rsprintprvcancel" @@ -1813,4 +1813,3 @@ msgstr "Unbekannte Achsen-Spezifikation: %s" #: vpsr.sxmldecnotatbeg msgid "The XML declaration must appear before the first element" msgstr "Die XML-Deklaration muss vor dem ersten Element erscheinen" - diff --git a/components/tvplanit/source/vpedfmtlst.lfm b/components/tvplanit/source/vpedfmtlst.lfm index 7716849a2..0f2ccadc7 100644 --- a/components/tvplanit/source/vpedfmtlst.lfm +++ b/components/tvplanit/source/vpedfmtlst.lfm @@ -72,13 +72,13 @@ object frmPrnFormat: TfrmPrnFormat AnchorSideLeft.Control = Owner AnchorSideLeft.Side = asrCenter AnchorSideBottom.Control = btnMoveElementUp - Left = 318 - Height = 15 - Top = 390 - Width = 58 + Left = 332 + Height = 30 + Top = 375 + Width = 30 Alignment = taCenter Anchors = [akLeft, akBottom] - Caption = 'Print Order' + Caption = 'Print'#13#10'Order' Color = clDefault ParentColor = False WordWrap = True @@ -272,16 +272,17 @@ object frmPrnFormat: TfrmPrnFormat object btnOk: TButton AnchorSideRight.Control = ButtonPanel AnchorSideRight.Side = asrBottom - Left = 646 + Left = 613 Height = 25 Top = 4 - Width = 42 + Width = 75 Anchors = [akTop, akRight] AutoSize = True BorderSpacing.Top = 4 BorderSpacing.Right = 6 BorderSpacing.Bottom = 4 Caption = 'OK' + Constraints.MinWidth = 75 OnClick = btnOkClick TabOrder = 3 end diff --git a/components/tvplanit/source/vpedfmtlst.lrj b/components/tvplanit/source/vpedfmtlst.lrj index e8c473ca4..9dc65885b 100644 --- a/components/tvplanit/source/vpedfmtlst.lrj +++ b/components/tvplanit/source/vpedfmtlst.lrj @@ -2,7 +2,7 @@ {"hash":99728530,"name":"tfrmprnformat.caption","sourcebytes":[80,114,105,110,116,32,70,111,114,109,97,116,32,68,101,115,105,103,110,101,114],"value":"Print Format Designer"}, {"hash":110338490,"name":"tfrmprnformat.lblformats.caption","sourcebytes":[38,70,111,114,109,97,116,115,58],"value":"&Formats:"}, {"hash":222337306,"name":"tfrmprnformat.lblelements.caption","sourcebytes":[69,108,101,38,109,101,110,116,115,58],"value":"Ele&ments:"}, -{"hash":102832786,"name":"tfrmprnformat.lblprintorder.caption","sourcebytes":[80,114,105,110,116,32,79,114,100,101,114],"value":"Print Order"}, +{"hash":145723266,"name":"tfrmprnformat.lblprintorder.caption","sourcebytes":[80,114,105,110,116,13,10,79,114,100,101,114],"value":"Print\r\nOrder"}, {"hash":177351,"name":"tfrmprnformat.btnnewformat.caption","sourcebytes":[38,78,101,119],"value":"&New"}, {"hash":2800388,"name":"tfrmprnformat.btneditformat.caption","sourcebytes":[38,69,100,105,116],"value":"&Edit"}, {"hash":179055749,"name":"tfrmprnformat.btndeleteformat.caption","sourcebytes":[38,68,101,108,101,116,101],"value":"&Delete"}, diff --git a/components/tvplanit/source/vpedfmtlst.pas b/components/tvplanit/source/vpedfmtlst.pas index 4fc103137..96dd9c40e 100644 --- a/components/tvplanit/source/vpedfmtlst.pas +++ b/components/tvplanit/source/vpedfmtlst.pas @@ -384,12 +384,20 @@ procedure TfrmPrnFormat.DoEditFormat; var AFormat: TVpPrintFormatItem; frmEditFormat: TfrmEditFormat; + oldFormatName: String; begin if lbFormats.ItemIndex > -1 then begin Application.CreateForm(TfrmEditFormat, frmEditFormat); AFormat := TVpPrintFormatItem(lbFormats.Items.Objects[lbFormats.ItemIndex]); + oldFormatName := AFormat.FormatName; if frmEditFormat.Execute(AFormat) then begin IsDirty := True; + if AFormat.FormatName <> oldFormatName then + begin + lbFormats.Items.Delete(lbFormats.ItemIndex); + lbFormats.Items.AddObject(AFormat.FormatName, AFormat); + lbFormats.ItemIndex := lbFormats.Items.IndexOf(Aformat.FormatName); + end; end; frmEditFormat.Free; @@ -542,27 +550,15 @@ end; procedure TfrmPrnFormat.FormCloseQuery(Sender: TObject; var CanClose: Boolean); -var - Rslt: Integer; begin + CanClose := True; if IsDirty then begin - Rslt := DirtyPrompt; - case Rslt of - ID_YES: - begin - DoSave; - CanClose := True; - end; - ID_NO: - CanClose := True; - ID_CANCEL: - begin - CanClose := False; - Exit; - end; + case DirtyPrompt of + mrYes: DoSave; + mrNo: ; + mrCancel: CanClose := false; end; - end else - CanClose := True; + end; end; function TfrmPrnFormat.GetControlLink: TVpControlLink;