Sign in Join
FPDoc Onlineexperiment

TToolButton.GetPreferredSize procedure

Member of TToolButtonpublicIn unit ComCtrls

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

Arguments

PreferredWidth

Preferred width for the control used in auto-sizing algorithms.

PreferredHeight

Preferred height for the control used in auto-sizing algorithms.

RawTrue if the calculated values are used as is. False if the value can be adjusted by constraints or set to default values.
WithThemeSpaceTrue to reserve space for stacking and alignment provided in theme element details.

Description

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

When WithThemeSpace is True, additional space is reserved for stacking.

Calls the inherited method on entry. Values from the ButtonWidth and ButtonHeight properties in the parent tool bar may be used in the PreferredWidth and PreferredHeight arguments, depending on the orientation for the tool bar. No additional actions are performed in the method if the parent tool bar has not been assigned.

See also

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