![]() |
TESetStyle |
||||
Header: | TextEdit.h | Carbon status: | Not Recommended | |
Sets new character attributes, in the specified edit structure, for the current selection range.
void TESetStyle ( SInt16 mode, const TextStyle *newStyle, Boolean fRedraw, TEHandle hTE );
A selector that specifies which character attributes are to be changed. The value for mode can be any additive combination of the mode constants for font, style, type size, color, and so forth. It corresponds to any additive combination of the
The value of mode specifies which existing character attributes are to be changed to the new character attributes specified by newStyle. If doToggle is specified along with doFace and if an attribute specified in the given newStyle parameter exists across the entire selected range of text, then TESetStyle removes that attribute. Otherwise, if the attribute doesnt exist across the entire selection range, all of the selected text is set to include that character attribute.
A pointer to a structure of type TextStyle that specifies the new attributes to be set. This structure contains the character attributes to be applied to the current selection range based on the value of mode.
A flag that specifies whether or not TextEdit should immediately redraw the affected text to reflect the new character attribute changes. A value of TRUE causes the text to be redrawn immediately. Line breaks, line heights, and line ascents are recalculated. A value of FALSE delays redrawing until another event forces the update.
If the fRedraw parameter is set to TRUE, TextEdit redraws the current selection range using the new character attributes, recalculating line breaks, line heights, and line ascents.
If the fRedraw parameter is set to FALSE, TextEdit does not redraw the text or recalculate line breaks, line heights, and line ascents. Consequently, when you call a function that uses any of this information, such as TEGetHeight (which returns a total height between two specified lines), it does not reflect the new character attributes set with TESetStyle. Instead, the function uses the information that was available before TESetStyle was called. To update this information, call the TECalText function. To be certain that the new information is always reflected, call TESetStyle with the fRedraw parameter set to TRUE.
A handle to the multistyled edit structure containing the selected text.
The TESetStyle function has no effect on a monostyled structure.
If you call the TESetStyle function when the value of the selStart field of an edit structure equals the value of the selEnd field (specifying an insertion point), TextEdit stores the input character attributes in the null scrap structure pointed to by the null style handle.
Not recommended in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)