From a94d290c94c7dd9d7f3baef20838007a54a3855c Mon Sep 17 00:00:00 2001 From: mattias Date: Sat, 17 May 2014 15:20:25 +0000 Subject: [PATCH] LCL: docs git-svn-id: trunk@45060 - --- docs/xml/lcl/controls.xml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/docs/xml/lcl/controls.xml b/docs/xml/lcl/controls.xml index 557abba707..d551f0b8e7 100644 --- a/docs/xml/lcl/controls.xml +++ b/docs/xml/lcl/controls.xml @@ -1,4 +1,4 @@ - + Notification handler for a resize of the control. - -

This event is triggered after the Width, Height, ClientWidth or ClientHeight of the control has changed. +

This event is triggered after the Width, Height, ClientWidth or ClientHeight of the control has changed, and before the LCL sends the new size to the widgetset. +The size of the underlying widget (e.g. unit LCLIntf function GetWindowSize and GetClientRect) may differ from the control's Width/Height/ClientRect during OnResize. During autosize the size can change multiple times, but only the last change triggers the OnResize. -

-

Use OnResize to react on size changes. +

Use OnResize to react on size changes. To also react on moves, use the OnChangeBounds event. -

-

If you want to customize the resize behaviour, use OnConstrainedResize instead. -

-

Common mistake: +

If you want to customize the resize behaviour, use OnConstrainedResize instead. +

Common mistake: Keep in mind that ClientWidth and ClientHeight can change even when Width, Height stays the same. For example when the theme changes, the Width and Height remain the same, but the changed frame reduces the ClientWidth and ClientHeight. This does not happen that often under Windows, but it happens quite often on other platforms. -

-

Especially it is not sufficient to write only a TForm.OnResize handler to resize all controls on the form. This is a common bug in Delphi applications. +

Especially it is not sufficient to write only a TForm.OnResize handler to resize all controls on the form. This is a common bug in Delphi applications.