mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 02:59:15 +02:00
fixed anchoreditor setting RootComponent
git-svn-id: trunk@8021 -
This commit is contained in:
parent
2c645e2c5f
commit
c73cd33fff
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user