fixed anchoreditor setting RootComponent

git-svn-id: trunk@8021 -
This commit is contained in:
mattias 2005-11-01 15:03:32 +00:00
parent 2c645e2c5f
commit c73cd33fff
2 changed files with 10 additions and 3 deletions

View File

@ -694,9 +694,15 @@ var
CurComponent: TComponent;
CurControl: TControl;
begin
Result:=nil;
Root:=GlobalDesignHook.LookupRoot;
if not (Root is TComponent) then exit;
RootComponent:=TComponent(Root);
if (RootComponent is TControl)
and (CompareText(Sibling,ControlToStr(TControl(RootComponent)))=0) then begin
Result:=TControl(RootComponent);
exit;
end;
for i:=0 to RootComponent.ComponentCount-1 do begin
CurComponent:=TComponent(RootComponent.Components[i]);
if CurComponent is TControl then begin

View File

@ -2734,6 +2734,7 @@ procedure TAnchorSide.SetControl(const AValue: TControl);
procedure RaiseOwnerCircle;
begin
DebugLN('RaiseOwnerCircle AValue=',DbgSName(AValue),' FOwner=',DbgSName(FOwner));
raise Exception.Create('TAnchorSide.SetControl AValue=FOwner');
end;
@ -2744,13 +2745,13 @@ begin
if FControl=AValue then exit;
OldControl:=FControl;
FControl:=nil;
FControl:=AValue;
if OldControl<>nil then
OldControl.ForeignAnchorSideChanged(Self,ascoRemove);
//debugln('TAnchorSide.SetControl A ',DbgSName(FOwner));
FOwner.AnchorSideChanged(Self);
FControl:=AValue;
//debugln('TAnchorSide.SetControl A ',DbgSName(FOwner),' FControl=',DbgSName(FControl));
if FControl<>nil then
FControl.ForeignAnchorSideChanged(Self,ascoAdd);
FOwner.AnchorSideChanged(Self);
end;
function TAnchorSide.IsSideStored: boolean;