mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 20:29:32 +02:00
* Add AllocateName
git-svn-id: trunk@38362 -
This commit is contained in:
parent
1568e68c95
commit
72bbfe34e9
@ -321,6 +321,7 @@ type
|
||||
procedure EndRender; virtual;
|
||||
|
||||
public
|
||||
Function AllocateName : String;
|
||||
procedure WriteElement(AWriter: TFPReportStreamer; AOriginal: TFPReportElement = nil); virtual;
|
||||
procedure ReadElement(AReader: TFPReportStreamer); virtual;
|
||||
// called when the designer starts editing this component .
|
||||
@ -5497,6 +5498,21 @@ begin
|
||||
FReportState := rsDesign;
|
||||
end;
|
||||
|
||||
function TFPReportComponent.AllocateName: String;
|
||||
|
||||
Var
|
||||
BaseName : String;
|
||||
I : Integer;
|
||||
|
||||
begin
|
||||
BaseName:=ClassName;
|
||||
I:=1;
|
||||
Repeat
|
||||
Result:=BaseName+IntToStr(I);
|
||||
Inc(I);
|
||||
Until (Owner=Nil) or (Owner.FindComponent(Result)=Nil);
|
||||
end;
|
||||
|
||||
procedure TFPReportComponent.StartDesigning;
|
||||
begin
|
||||
SetDesigning(True,True);
|
||||
|
Loading…
Reference in New Issue
Block a user