Sign in Join
FPDoc Onlineexperiment

TCustomLabel.CalcWordWrapLength function

Member of TCustomLabelprotectedIn unit StdCtrls

Calculates the maximum length of a word-wrapped line.

Declaration

pascal
function CalcWordWrapLength: Integer

Description

Helper function which calculates the maximum length that the label text can have before word-wrapping sets in. The calculation is based on several criteria:

  • when the text direction is horizontal (or flipped) and the label width is restricted by anchoring or Parent aligning, the maximum line length is determined by the control width.
  • when the text direction is vertical (or flipped) and the label height is restricted by anchoring or Parent aligning, the maximum line length is determined by the label's height.
  • If the WordWrapLength property has a positive value, the maximum line length is determined by this parameter.
  • In all other cases, the maximum line defaults to a very large value (cMaxLabelSize = 10000) so that the label can grow without being wrapped.

See also

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