Important: The information in this document is obsolete and should not be used for new development.
TESetAlignment
TheTESetAlignment
procedure 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 thealign
parameter.
Constant Value Description teFlushDefault 0
Align according to primary line direction teCenter 1
Centered for all scripts teFlushRight -1
Right aligned for all scripts teFlushLeft -2
Left 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
just
field 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
InvalRect
procedure afterTESetAlignment
to 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 theInvalRect
procedure, 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.