Sign in Join
FPDoc Onlineexperiment

TToolBar.DoAutoAdjustLayout procedure

Member of TToolBarprotectedIn unit ComCtrls

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); override

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.

This description is the one of Controls.TControl.DoAutoAdjustLayout.

See also

  • AutoAdjustLayout
  • ShouldAutoAdjust
  • Anchors
  • BorderSpacing
  • Constraints
  • SetBoundsKeepBase

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