Sign in Join
FPDoc Onlineexperiment

TControl.DoAutoAdjustLayout procedure

Member of TControlprotectedIn unit Controls

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

Declaration

pascal
procedure DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy; 
 const AXProportion: Double; 
 const AYProportion: Double); virtual

Arguments

AMode

Identifies the auto-layout policy applied in the method.

AXProportion

Scaling factor for horizontal dimensions.

AYProportion

Scaling factor for vertical dimensions.

Description

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

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.