Important: The information in this document is obsolete and should not be used for new development.
TESetAlignment
TheTESetAlignmentprocedure sets the alignment of the specified text in an edit record so that it is centered, right aligned, or left aligned, or aligned according to the
line direction.
PROCEDURE TESetAlignment (align: Integer; hTE: TEHandle);
align- The alignment for the specified text.
hTE- A handle to the edit record containing the text.
DESCRIPTION
You can use the following constants to specify the text alignment through thealignparameter.
Constant Value Description teFlushDefault 0Align according to primary line direction teCenter 1Centered for all scripts teFlushRight -1Right aligned for all scripts teFlushLeft -2Left aligned for all scripts For compatibility, the previous names of these constants are still supported. They are
teJustLeft,teJustCenter,teJustRight, andteForceLeft.The default value of the
justfield of the edit record isteFlushDefault. This means that text alignment is based on the primary line direction which is set by default according to the system script.For languages that are read from right to left, text is right aligned by default. For languages that are read from left to right, text is left aligned by default. If you change the alignment, call the
InvalRectprocedure afterTESetAlignmentto redraw the text with the new alignment.TextEdit does not support justified alignment. To draw justified text, use the QuickDraw Text routines.
SEE ALSO
For more information about theInvalRectprocedure, see the chapter "Window Manager" in Inside Macintosh: Macintosh Toolbox Essentials. For more information about drawing justified text, see the chapter "QuickDraw Text" in this book.