diff --git a/components/lazreport/doc/contributors.txt b/components/lazreport/doc/contributors.txt index aaa5b38d67..b1138c2737 100644 --- a/components/lazreport/doc/contributors.txt +++ b/components/lazreport/doc/contributors.txt @@ -4,6 +4,7 @@ Aleksey Lagunov (ru) Andrey Gusev (ru) Christian Ulrich (de) Domingo Alvarez Duarte( ) +Gabor Boros ( ) German Basisty (ar) Javier Villarroya (es) Jesus Reyes A. (mx) @@ -11,6 +12,7 @@ Joerg Braun (de) Junior Goncalves (br) Julio Jiménez B. (es) Luiz Americo (br) +Lutz Mändle ( ) Mattias Gaertner (de) Michel Gawrycki ( ) Olivier Guilbaud (fr) diff --git a/components/lazreport/source/languages/lr_const.de.po b/components/lazreport/source/languages/lr_const.de.po index d8aeaa69ae..4f27653c49 100644 --- a/components/lazreport/source/languages/lr_const.de.po +++ b/components/lazreport/source/languages/lr_const.de.po @@ -1571,6 +1571,10 @@ msgstr "\"%s\" ist kein gültiger Variablenname." msgid "Keep aspect ratio" msgstr "Seitenverhältnis beibehalten" +#: lr_const.skeepchild +msgid "Keep child together with parent" +msgstr "Nachfolger zusammen mit Elternband drucken" + #: lr_const.slazformfile msgid "LazReport form" msgstr "LazReport-Formular" diff --git a/components/lazreport/source/languages/lr_const.po b/components/lazreport/source/languages/lr_const.po index 4950e1f816..c85ed2ee0b 100644 --- a/components/lazreport/source/languages/lr_const.po +++ b/components/lazreport/source/languages/lr_const.po @@ -1556,6 +1556,10 @@ msgstr "" msgid "Keep aspect ratio" msgstr "" +#: lr_const.skeepchild +msgid "Keep child together with parent" +msgstr "" + #: lr_const.slazformfile msgid "LazReport form" msgstr "" diff --git a/components/lazreport/source/lr_class.pas b/components/lazreport/source/lr_class.pas index 9a2fb7da17..bb7b5fbce8 100644 --- a/components/lazreport/source/lr_class.pas +++ b/components/lazreport/source/lr_class.pas @@ -47,6 +47,7 @@ const flBandOnLastPage = $20; flBandRepeatHeader = $40; flBandPrintChildIfNotVisible = $100; + flBandKeepChild = $200; flPictCenter = 2; flPictRatio = 4; @@ -578,6 +579,7 @@ type procedure P5Click(Sender: TObject); procedure P6Click(Sender: TObject); procedure P7Click(Sender: TObject); + procedure P8Click(Sender: TObject); function GetTitleRect: TRect; function TitleSize: Integer; procedure CalcTitleSize; @@ -5379,6 +5381,15 @@ begin m.Checked := (Flags and flBandPrintChildIfNotVisible) <> 0; Popup.Items.Add(m); end; + + if not (BandType in [btChild, btPageFooter]) then + begin + m := TMenuItem.Create(Popup); + m.Caption := sKeepChild; + m.OnClick := @P8Click; + m.Checked := (Flags and flBandKeepChild) <> 0; + Popup.Items.Add(m); + end; end; procedure TfrBandView.P1Click(Sender: TObject); @@ -5477,6 +5488,16 @@ begin end; end; +procedure TfrBandView.P8Click(Sender: TObject); +begin + frDesigner.BeforeChange; + with Sender as TMenuItem do + begin + Checked := not Checked; + Flags := (Flags and not flBandKeepChild) + Word(Checked) * flBandKeepChild; + end; +end; + function TfrBandView.GetTitleRect: TRect; begin if BandType in [btCrossHeader..btCrossFooter] then @@ -7152,6 +7173,15 @@ begin CalculatedHeight := dy; if Stretched then Result := CalcHeight; end; + if (Flags and flBandKeepChild) <> 0 then + begin + b := Self.ChildBand; + while Assigned(b) do + begin + Result := Result + b.CalcHeight; + b := b.ChildBand; + end; + end; end; function TfrBand.Draw: Boolean; diff --git a/components/lazreport/source/lr_const.pas b/components/lazreport/source/lr_const.pas index 6ef43a787b..1ce50a3fab 100644 --- a/components/lazreport/source/lr_const.pas +++ b/components/lazreport/source/lr_const.pas @@ -226,6 +226,7 @@ resourcestring sPrintIfSubsetEmpty = 'Print if detail empty'; sPrintChildIfNotVisible = 'Print child if not visible'; sBreaked = 'Breaked'; + sKeepChild = 'Keep child together with parent'; sPictureCenter = 'Center picture'; sKeepAspectRatio = 'Keep aspect ratio';