diff --git a/lcl/include/control.inc b/lcl/include/control.inc index 2f34ba7bb0..368cfcee06 100644 --- a/lcl/include/control.inc +++ b/lcl/include/control.inc @@ -56,8 +56,9 @@ begin if (Parent=nil) and (not (cfAutoSizeNeeded in FControlFlags)) and (Self is TCustomForm) then begin DebugLn(['TControl.Adjustsize ',DbgSName(Self)]); - if Name='SearchResultsView' then begin - debugln(GetStackTrace(true)); + if Name='SearchResults' then begin + //debugln(GetStackTrace(true)); + DebugLn(['TControl.Adjustsize AAA1']); end; end; {$ENDIF} @@ -365,7 +366,7 @@ begin PosChanged := (FLeft <> ALeft) or (FTop <> ATop); if (not SizeChanged) and (not PosChanged) then Exit; - //DebugLn('TControl.ChangeBounds A ',Name,':',ClassName); + //DebugLn('TControl.ChangeBounds A ',DbgSName(Self),' Old=',dbgs(BoundsRect),' New=',dbgs(NewBounds)); if (not (csLoading in ComponentState)) and (not (Self is TWinControl)) then InvalidateControl(IsControlVisible, False, true); @@ -2392,7 +2393,9 @@ end; procedure TControl.DoAutoSize; begin //Handled by TWinControl, or other descendants + {$IFNDEF OldAutoSize} Exclude(FControlFlags,cfAutoSizeNeeded); + {$ENDIF} end; {------------------------------------------------------------------------------ diff --git a/lcl/include/customlabel.inc b/lcl/include/customlabel.inc index 65a9c2e84f..070d74b8fd 100644 --- a/lcl/include/customlabel.inc +++ b/lcl/include/customlabel.inc @@ -84,6 +84,7 @@ var NewWidth, NewHeight: integer; CurAnchors: TAnchors; begin + inherited DoAutoSize; //debugln('TCustomLabel.DoAutoSize ',DbgSName(Self),' AutoSizing=',dbgs(AutoSizing),' AutoSize=',dbgs(AutoSize),' Parent=',DbgSName(Parent),' csLoading=',dbgs(csLoading in ComponentState),' Parnet.HandleAllocated=',dbgs((Parent<>nil) and (Parent.HandleAllocated))); if OptimalFill and (not AutoSize) then begin @@ -298,7 +299,9 @@ end; procedure TCustomLabel.Loaded; begin inherited Loaded; + {$IFNDEF OldAutoSize} AdjustSize; + {$ENDIF} end; procedure TCustomLabel.UpdateSize;