[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
CalculatePreferredSize - calculates the default/preferred width and height for a TWinControl, which is used by the LCL autosizing algorithms as default size
Source position: controls.pp line 1736
protected procedure TWinControl.CalculatePreferredSize( |
var PreferredWidth: Integer; |
var PreferredHeight: Integer; |
WithThemeSpace: Boolean |
); override; |
procedure TWinControl.CalculatePreferredSize(var PreferredWidth, PreferredHeight: integer; WithThemeSpace: Boolean);
Calls the inherited method to calculate the default/preferred width and height for a TWinControl, which is used by the LCL autosizing algorithms as default size. Only positive values are valid. Negative or 0 are treated as undefined and the LCL uses other sizes instead.
TWinControl overrides this:
For example the preferred size of a TButton is the size, where the label fits exactly. This depends heavily on the current theme and widgetset.
This value is independent of constraints and siblings, only the inner parts are relevant.
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 it is passed as a parameter to the widgetset.
|
CalculatePreferredSize - find default/preferred height and width |
lazarus-ccr.sourceforge.net |