Unit 'Controls' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#lcl]


Applies layout changes using the specified policy and scaling proportions to the control.


Source position: controls.pp line 1533

protected procedure TControl.DoAutoAdjustLayout(

  const AMode: TLayoutAdjustmentPolicy;

  const AXProportion: Double;

  const AYProportion: Double

); virtual;




Identifies the auto-layout policy applied in the method.



Scaling factor for horizontal dimensions.



Scaling factor for vertical dimensions.


DoAutoAdjustLayout is a method which implements changes to control sizes for the AutoAdjustLayout method. These methods are called when High-DPI and scaling have been enabled in the project options for an application.

AMode indicates the automatic layout policy applied in the method. It is a value from the TLayoutAdjustmentPolicy enumeration, and determines whether horizontal / vertical / or both sizes are adjusted in the method. It generally reflects the constraints for the device type where the application is running.

AXProportion and AYProportion contain the scaling factors applied to the horizontal and/or vertical sizes.

DoAutoAdjustLayout ensures that new values for Height and Width in the control are calculated (when allowed and needed) using the scaling factors, Constraints, BorderSpacing and Anchors for the control. The SetBoundsKeepBase method is called to apply the newly calculated values to the control.

Font scaling is performed in AutoAdjustLayout (when needed) and occurs prior to calling DoAutoAdjustLayout.

DoAutoAdjustLayout, ScaleFontsPPI, and FixDesignFontsPPI are often overridden in descendent classes to perform additional actions needed for a control or its children.

See also



Applies an automatic adjustment layout policy to the control.



Indicates whether the height and/or width for a control can be automatically adjusted.



The set of anchor definitions for this control.



Determines the inner and outer border spacing for this control.



Contains the minimum and maximum Width and Height for the control.



Set the bounds, keeping the base values.

CT Web help

CodeTyphon Studio