Skip to main content
Pie
ra0

TcxCanvas.AlignMultiLineTextRectVertically(TRect,string,TcxAlignmentVert,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean) Method

Adjusts the rectangle rectangle to fit text according to the specified settings.

Declaration

procedure AlignMultiLineTextRectVertically(var R: TRect; const AText: string; AAlignmentVert: TcxAlignmentVert; AWordBreak: Boolean; AShowPrefix: Boolean; AEnabled: Boolean = True; ADontBreakChars: Boolean = False; AEndEllipsis: Boolean = False; AExpandTabs: Boolean = False);

Parameters

Name Type
R TRect
AText string
AAlignmentVert TcxAlignmentVert
AWordBreak Boolean
AShowPrefix Boolean
AEnabled Boolean
ADontBreakChars Boolean
AEndEllipsis Boolean
AExpandTabs Boolean

Remarks

Call this procedure and pass a text string and the target rectangle as the AText and R parameters. The AlignMultiLineTextRectVertically procedure expands the rectangle if its area is not sufficient to fit text according to other parameter values:

  • The AWordBreak parameter specifies if the procedure can break the source text string into multiple lines to fit them into the R rectangle.
  • The AShowPrefix parameter specifies if the procedure treats prefix characters as special characters. If this parameter is set to True, the “&” character underscores the next character. Otherwise, the “&” character is displayed as is.
  • The optional AEnabled parameter specifies how the procedure treats the text string’s state in an application UI, that is, enabled or disabled. “Disabled” can cast a shadow, and thus require more space.
  • The optional ADontBreakChars parameter defines if the procedure truncates the last characters of the last word if they do not fit into the rectangle. This parameter is ignored if the AWordBreak parameter accepts False.
  • The optional AEndEllipsis parameter specifies if the procedure shows an ellipsis instead of the characters that do not fit into the target rectangle.

Note

Call the AlignMultiLineextRectVertically and GetTextStringsBounds procedures to calculate the UI space required to fit text drawn by the overloaded DrawTexT procedures.

See Also