IDE: paste components: update TControl.Caption

git-svn-id: trunk@37640 -
This commit is contained in:
mattias 2012-06-13 16:26:29 +00:00
parent 082541ea2d
commit d91e9ccb16
2 changed files with 14 additions and 0 deletions

View File

@ -1129,11 +1129,13 @@ var
if (NewComponents.IndexOf(OverlappedControl)<0)
and (OverlappedControl.Left=P.X)
and (OverlappedControl.Top=P.Y) then begin
// overlaps with an old control => move
inc(P.X,NonVisualCompWidth);
inc(P.Y,NonVisualCompWidth);
if (P.X>AParent.ClientWidth-AControl.Width)
or (P.Y>AParent.ClientHeight-AControl.Height) then
break;
// restart check
i:=AParent.ControlCount-1;
end else
dec(i);

View File

@ -1398,7 +1398,19 @@ begin
end;
procedure TJITComponentList.ReadComponentsProc(AComponent: TComponent);
var
aControl: TControl;
aCaption: TCaption;
begin
if (AComponent.Name<>'') and (AComponent is TControl) then begin
aControl:=TControl(AComponent);
aCaption:=aControl.Caption;
if (aCaption<>'') and (fRenameList[aCaption]=AComponent.Name) then begin
// caption is the old name of the component
// component was renamed => change caption too
aControl.Caption:=AComponent.Name;
end;
end;
if fReadComponents<>nil then
fReadComponents.Add(AComponent);
end;