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; CurComponent: TComponent;
CurControl: TControl; CurControl: TControl;
begin begin
Result:=nil;
Root:=GlobalDesignHook.LookupRoot; Root:=GlobalDesignHook.LookupRoot;
if not (Root is TComponent) then exit; if not (Root is TComponent) then exit;
RootComponent:=TComponent(Root); 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 for i:=0 to RootComponent.ComponentCount-1 do begin
CurComponent:=TComponent(RootComponent.Components[i]); CurComponent:=TComponent(RootComponent.Components[i]);
if CurComponent is TControl then begin if CurComponent is TControl then begin

View File

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