Important: The information in this document is obsolete and should not be used for new development.
TESetStyle
TheTESetStyleprocedure sets new character attributes for the current selection range in the specified edit record.
PROCEDURE TESetStyle (mode: Integer; newStyle: TextStyle; redraw: Boolean; hTE: TEHandle);
mode- A selector that specifies which character attributes are to be changed. The value for
modecan be any additive combination of themodeconstants for font, style, type size, color, and so forth.newStyle- A record of type
TextStylethat specifies the new attributes to be set. This record contains the character attributes to be applied to the current selection range based on the value ofmode.redraw- A flag that specifies whether or not TextEdit should immediately redraw the affected text to reflect the new character attribute changes. A value of
TRUEcauses the text to be redrawn immediately. Line breaks, line heights, and line ascents are recalculated. A value ofFALSEdelays redrawing until another event forces the update.hTE- A handle to the multistyled edit record containing the selected text.
DESCRIPTION
TheTESetStyleprocedure has no effect on a monostyled record. You can use any combination of the following constants to specify a value for themodeparameter. The value ofmodespecifies which existing character attributes are to be changed to the new character attributes specified bynewStyle.
Constant Value Description doFont 1 Sets the font family ID doFace 2 Sets the character style doSize 4 Sets the type size doColor 8 Sets the color doAll 15 Sets all attributes addSize 16 Increases or decreases the current type size doToggle 32 Modifies the mode If
doToggleis specified along withdoFaceand if an attribute specified in the givennewStyleparameter exists across the entire selected range of text, thenTESetStyleremoves that attribute. Otherwise, if the attribute doesn't exist across the entire selection range, all of the selected text is set to include that character attribute.If the
redrawparameter is set toTRUE, TextEdit redraws the current selection range using the new character attributes, recalculating line breaks, line heights, and line ascents. If theredrawparameter is set toFALSE, TextEdit does not redraw the text or recalculate line breaks, line heights, and line ascents. Consequently, when you call a routine that uses any of this information, such asTEGetHeight(which returns a total height between two specified lines), it does not reflect the new character attributes set withTESetStyle. Instead, the routine uses the information that was available beforeTESetStylewas called. To update this information, call theTECalTextprocedure. (See "TECalText" on page 2-84 for more information.) To be certain that the new information is always reflected, call theTESetStyleprocedure with theredrawparameter set toTRUE.If you call the
TESetStyleroutine when the value of theselStartfield of an edit record equals the value of theselEndfield (specifying an insertion point), TextEdit stores the input character attributes in the null scrap record pointed to by the null
style handle.