Sign in Join
FPDoc Onlineexperiment

TCustomForm.GetPreferredSize procedure

Member of TCustomFormpublicIn unit Forms

Returns default/preferred height and width, for use in auto-sizing.

Declaration

pascal
procedure GetPreferredSize(var PreferredWidth: Integer; 
 var PreferredHeight: Integer; 
 Raw: Boolean=False; 
 WithThemeSpace: Boolean=True); override

Description

Called during AutoSize calculations. Only positive values are valid. Negative or 0 are treated as undefined and the LCL uses other sizes instead.

WithThemeSpace: If True, adds space for stacking.

For example: TRadioButton has a minimum size. But for stacking multiple TRadioButtons there should be some space around. This space is theme dependent, so the parameter is passed to the widgetset

TWinControl overrides this and asks the interface for theme dependent values. See CalculatePreferredSize for more information.

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

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