IDE: designer: initialize FIsNonVisualComponent, bug #27502

git-svn-id: trunk@47898 -
This commit is contained in:
mattias 2015-02-19 12:07:14 +00:00
parent b04540dbcd
commit ef2ddfca01

View File

@ -606,12 +606,13 @@ begin
FIsTControl:=FPersistent is TControl; FIsTControl:=FPersistent is TControl;
FIsTWinControl:=FPersistent is TWinControl; FIsTWinControl:=FPersistent is TWinControl;
FDesignerForm:=GetDesignerForm(FPersistent); FDesignerForm:=GetDesignerForm(FPersistent);
GetIsNonVisualComponent;
FIsVisible:=FIsTComponent FIsVisible:=FIsTComponent
and (not ComponentIsInvisible(TComponent(APersistent))); and (not ComponentIsInvisible(TComponent(APersistent)));
end; end;
function TSelectedControl.GetIsNonVisualComponent: boolean; function TSelectedControl.GetIsNonVisualComponent: boolean;
//recalculate because FIsNonVisualCOmponent doesn't work properly for Non LCL //recalculate because FIsNonVisualComponent doesn't work properly for Non LCL
begin begin
FIsNonVisualComponent:=FIsTComponent and (not FIsTControl); FIsNonVisualComponent:=FIsTComponent and (not FIsTControl);
if (Owner.Mediator<>nil) and FIsTComponent then if (Owner.Mediator<>nil) and FIsTComponent then
@ -634,10 +635,12 @@ begin
FCachedHeight:=AHeight; FCachedHeight:=AHeight;
end else if FIsNonVisualComponent then begin end else if FIsNonVisualComponent then begin
if (Left<>ALeft) or (Top<>ATop) then begin if (Left<>ALeft) or (Top<>ATop) then begin
//debugln(['TSelectedControl.SetBounds Old=',Left,',',Top,' New=',ALeft,',',ATop]);
InvalidateNonVisualPersistent; InvalidateNonVisualPersistent;
Left:=ALeft; Left:=ALeft;
Top:=ATop; Top:=ATop;
InvalidateNonVisualPersistent; InvalidateNonVisualPersistent;
//debugln(['TSelectedControl.SetBounds Now=',Left,',',Top,' Expected=',ALeft,',',ATop]);
end; end;
end else if (Owner.Mediator<>nil) and FIsTComponent then begin end else if (Owner.Mediator<>nil) and FIsTComponent then begin
FCachedLeft:=ALeft; FCachedLeft:=ALeft;
@ -1359,8 +1362,9 @@ begin
if NewHeight<1 then NewHeight:=1; if NewHeight<1 then NewHeight:=1;
Item.SetFormRelativeBounds(NewLeft,NewTop,NewWidth,NewHeight); Item.SetFormRelativeBounds(NewLeft,NewTop,NewWidth,NewHeight);
{$IFDEF VerboseDesigner} {$IFDEF VerboseDesigner}
DebugLn(' i=',Dbgs(i),' ',DbgSName(Item.Persistent), DebugLn([' i=',i,' ',DbgSName(Item.Persistent),
' ',DbgS(Item.Left,Item.Top,Item.Width,Item.Height)); ' Expected=',NewLeft,',',NewTop,',',NewWidth,'x',NewHeight,
' Actual=',Item.Left,',',Item.Top,',',Item.Width,'x',Item.Height]);
{$ENDIF} {$ENDIF}
end; end;
InvalidateGuideLinesCache; InvalidateGuideLinesCache;
@ -1380,7 +1384,7 @@ begin
if FControls.Count>=1 then begin if FControls.Count>=1 then begin
Items[0].GetFormRelativeBounds(FRealLeft,FRealTop,FRealWidth,FRealHeight, Items[0].GetFormRelativeBounds(FRealLeft,FRealTop,FRealWidth,FRealHeight,
true); true);
//DebugLn(['TControlSelection.UpdateRealBounds ',FRealLeft,',',FRealTop]); //DebugLn(['TControlSelection.UpdateRealBounds ',FRealLeft,',',FRealTop,',',FRealWidth,'x',FRealHeight]);
for i:=1 to FControls.Count-1 do begin for i:=1 to FControls.Count-1 do begin
Items[i].GetFormRelativeBounds( Items[i].GetFormRelativeBounds(
NextRealLeft,NextRealTop,NextRealWidth,NextRealHeight,true); NextRealLeft,NextRealTop,NextRealWidth,NextRealHeight,true);