From c73cd33fff703a7520bf7dc831cc51accccc4c3a Mon Sep 17 00:00:00 2001 From: mattias Date: Tue, 1 Nov 2005 15:03:32 +0000 Subject: [PATCH] fixed anchoreditor setting RootComponent git-svn-id: trunk@8021 - --- designer/anchoreditor.pas | 6 ++++++ lcl/controls.pp | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/designer/anchoreditor.pas b/designer/anchoreditor.pas index 1fecf84c78..7f1750421a 100644 --- a/designer/anchoreditor.pas +++ b/designer/anchoreditor.pas @@ -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 diff --git a/lcl/controls.pp b/lcl/controls.pp index 576d690e41..a28de197dc 100644 --- a/lcl/controls.pp +++ b/lcl/controls.pp @@ -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;