mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 17:29:31 +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;
|
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
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user