Important: The information in this document is obsolete and should not be used for new development.
TECalText
TheTECalText
procedure recalculates the beginnings of all lines of text in the specified edit record.
PROCEDURE TECalText (hTE: TEHandle);
hTE
- A handle to the edit record whose text lines are to be recalculated.
DESCRIPTION
TheTECalText
procedure updates elements of thelineStarts
array in an edit record. CallTECalText
if you've changed the destination rectangle, thehText
field, or any other property of the edit record that pertains to line breaks and the number of characters per line--for example, font, size, style, and so on.ASSEMBLY-LANGUAGE INFORMATION
The low-memory global variableTERecal
contains the address of the routine called byTECalText
to recalculate the line starts and set the first and last characters that need to be redrawn. TheTERecal
default hook routine calls the Text UtilitiesStyledLineBreak
function. If you replace the defaultTERecal
hook routine with a customized version and your application supports non-Roman script systems, make sure that your customized hook routine is script-aware. The registers on entry and exit for this hook routine are:
Registers on entry A3 Pointer to the locked edit record D7 Change in the length of the record (word)
Registers on exit D2 Line start of the line containing the first character to be redrawn (word) D4 Position of last character to be redrawn (word) TextEdit uses the low-memory global variable
WordRedraw
widely, but primarily for line calculations and to determine how much of a line to redraw after the user types in a character. TextEdit sets the correct value forWordRedraw
inTEInit
based upon the installed script systems. If a 2-byte script is installed,TEInit
performs an OR operation onWordRedraw
with a 1; if a right-to-left script is installed,TEInit
performs an OR operation onWordRedraw
with an $FF. The size of this global is one byte.TextEdit interprets the final value of
WordRedraw
as follows:
Value Description 0 Redraws the character before the entered character. 1 Redraws the word before the entered character. $FF Redraws the whole line.