diff --git a/lcl/forms.pp b/lcl/forms.pp index 8da2a35dbc..cafc46077d 100644 --- a/lcl/forms.pp +++ b/lcl/forms.pp @@ -180,6 +180,7 @@ type function AutoScrollEnabled: Boolean; virtual; procedure CalculateAutoRanges; virtual; procedure CreateWnd; override; + procedure DestroyWnd; override; function GetClientScrollOffset: TPoint; override; function GetLogicalClientRect: TRect; override;// logical size of client area procedure DoOnResize; override; diff --git a/lcl/include/custommemo.inc b/lcl/include/custommemo.inc index f967663c7a..f8b65162db 100644 --- a/lcl/include/custommemo.inc +++ b/lcl/include/custommemo.inc @@ -142,6 +142,8 @@ begin DebugLn('[TCustomMemo.FinalizeWnd] END ',DbgSName(Self),' ',FLines.ClassName,' FLines.Count=',dbgs(FLines.Count)); {$endif} end; + if FHorzScrollBar <> nil then FHorzScrollBar.InvalidateScrollInfo; + if FVertScrollBar <> nil then FVertScrollBar.InvalidateScrollInfo; inherited FinalizeWnd; end; diff --git a/lcl/include/scrollingwincontrol.inc b/lcl/include/scrollingwincontrol.inc index fd62d5c128..3461d7f07a 100644 --- a/lcl/include/scrollingwincontrol.inc +++ b/lcl/include/scrollingwincontrol.inc @@ -35,6 +35,13 @@ begin end; end; +procedure TScrollingWinControl.DestroyWnd; +begin + inherited DestroyWnd; + if FHorzScrollBar <> nil then FHorzScrollBar.InvalidateScrollInfo; + if FVertScrollBar <> nil then FVertScrollBar.InvalidateScrollInfo; +end; + function TScrollingWinControl.GetClientScrollOffset: TPoint; begin if (HorzScrollBar <> nil) and (VertScrollBar <> nil) then @@ -75,8 +82,7 @@ begin //debugln(['TScrollingWinControl.DoOnResize ',DbgSName(Self),' ',dbgs(BoundsRect),' ',dbgs(ClientRect),' ',dbgs(GetLogicalClientRect)]); end; -procedure TScrollingWinControl.GetPreferredSizeClientFrame(out aWidth, - aHeight: integer); +procedure TScrollingWinControl.GetPreferredSizeClientFrame(out aWidth, aHeight: Integer); // return frame width independent of scrollbars (i.e. as if scrollbars not shown) begin if AutoScroll and (VertScrollBar<>nil) then