Important: The information in this document is obsolete and should not be used for new development.
TESetStyle
TheTESetStyle
procedure 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
mode
can be any additive combination of themode
constants for font, style, type size, color, and so forth.newStyle
- A record of type
TextStyle
that 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
TRUE
causes the text to be redrawn immediately. Line breaks, line heights, and line ascents are recalculated. A value ofFALSE
delays redrawing until another event forces the update.hTE
- A handle to the multistyled edit record containing the selected text.
DESCRIPTION
TheTESetStyle
procedure has no effect on a monostyled record. You can use any combination of the following constants to specify a value for themode
parameter. The value ofmode
specifies 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
doToggle
is specified along withdoFace
and if an attribute specified in the givennewStyle
parameter exists across the entire selected range of text, thenTESetStyle
removes 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
redraw
parameter is set toTRUE
, TextEdit redraws the current selection range using the new character attributes, recalculating line breaks, line heights, and line ascents. If theredraw
parameter 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 beforeTESetStyle
was called. To update this information, call theTECalText
procedure. (See "TECalText" on page 2-84 for more information.) To be certain that the new information is always reflected, call theTESetStyle
procedure with theredraw
parameter set toTRUE
.If you call the
TESetStyle
routine when the value of theselStart
field of an edit record equals the value of theselEnd
field (specifying an insertion point), TextEdit stores the input character attributes in the null scrap record pointed to by the null
style handle.