mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-25 15:19:14 +02:00
* Child band can be used only for one parent band (bug ID #33284)
git-svn-id: trunk@57448 -
This commit is contained in:
parent
95b16c02a9
commit
f327ba8d52
@ -73,6 +73,8 @@ Type
|
|||||||
{ TReportBandPropertyEditor }
|
{ TReportBandPropertyEditor }
|
||||||
|
|
||||||
TReportBandPropertyEditor = class(TReportComponentPropertyEditor)
|
TReportBandPropertyEditor = class(TReportComponentPropertyEditor)
|
||||||
|
protected
|
||||||
|
function BandAllowed(B: TFPReportCustomBand): Boolean; virtual;
|
||||||
Public
|
Public
|
||||||
Function BandTypes : TFPReportBandTypes; virtual;
|
Function BandTypes : TFPReportBandTypes; virtual;
|
||||||
procedure GetValues(Proc: TGetStrProc); override;
|
procedure GetValues(Proc: TGetStrProc); override;
|
||||||
@ -83,6 +85,7 @@ Type
|
|||||||
|
|
||||||
TChildBandPropertyEditor = Class(TReportBandPropertyEditor)
|
TChildBandPropertyEditor = Class(TReportBandPropertyEditor)
|
||||||
Public
|
Public
|
||||||
|
function BandAllowed(B: TFPReportCustomBand): Boolean; override;
|
||||||
Function BandTypes : TFPReportBandTypes; override;
|
Function BandTypes : TFPReportBandTypes; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -281,6 +284,29 @@ end;
|
|||||||
|
|
||||||
{ TChildBandPropertyEditor }
|
{ TChildBandPropertyEditor }
|
||||||
|
|
||||||
|
function TChildBandPropertyEditor.BandAllowed(B: TFPReportCustomBand): Boolean;
|
||||||
|
|
||||||
|
Var
|
||||||
|
P : TFPReportCustomPage;
|
||||||
|
CB : TFPReportCustomBand;
|
||||||
|
I : Integer;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Result:=inherited BandAllowed(B);
|
||||||
|
CB:=TFPReportCustomBand(GetComponent(0));
|
||||||
|
If Result then
|
||||||
|
begin
|
||||||
|
P:=GetPage;
|
||||||
|
I:=P.BandCount-1;
|
||||||
|
While Result and (I>=0) do
|
||||||
|
begin
|
||||||
|
Result:=(P.Bands[i]=CB) or (P.Bands[i].ChildBand<>B);
|
||||||
|
Dec(I)
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TChildBandPropertyEditor.BandTypes: TFPReportBandTypes;
|
function TChildBandPropertyEditor.BandTypes: TFPReportBandTypes;
|
||||||
begin
|
begin
|
||||||
Result:=[btChild];
|
Result:=[btChild];
|
||||||
@ -293,24 +319,27 @@ begin
|
|||||||
Result:=[]
|
Result:=[]
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Function TReportBandPropertyEditor.BandAllowed(B : TFPReportCustomBand) : Boolean;
|
||||||
|
|
||||||
|
Var
|
||||||
|
BT : TFPReportBandTypes;
|
||||||
|
|
||||||
|
begin
|
||||||
|
BT:=BandTypes;
|
||||||
|
Result:=(B.Name<>'') and (B<>GetComponent(0));
|
||||||
|
if Result and (BT<>[]) then
|
||||||
|
Result:=B.ReportBandType in BT;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TReportBandPropertyEditor.GetValues(Proc: TGetStrProc);
|
procedure TReportBandPropertyEditor.GetValues(Proc: TGetStrProc);
|
||||||
|
|
||||||
Var
|
Var
|
||||||
P : TFPReportCustomPage;
|
P : TFPReportCustomPage;
|
||||||
I : Integer;
|
I : Integer;
|
||||||
BT : TFPReportBandTypes;
|
|
||||||
|
|
||||||
Function BandAllowed(B : TFPReportCustomBand) : Boolean;
|
|
||||||
|
|
||||||
begin
|
|
||||||
Result:=(B.Name<>'') and (B<>GetComponent(0));
|
|
||||||
if Result and (BT<>[]) then
|
|
||||||
Result:=B.ReportBandType in BT;
|
|
||||||
end;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
P:=GetPage;
|
P:=GetPage;
|
||||||
BT:=BandTypes;
|
|
||||||
proc(oisNone);
|
proc(oisNone);
|
||||||
if Assigned(P) then
|
if Assigned(P) then
|
||||||
For I:=0 to P.BandCount-1 do
|
For I:=0 to P.BandCount-1 do
|
||||||
|
Loading…
Reference in New Issue
Block a user