Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Text /
Chapter 2 - TextEdit / TextEdit Reference
Routines / Checking, Setting, and Replacing Styles


TEContinuousStyle

The TEContinuousStyle function determines whether a given character attribute is continuous over the current selection range.

FUNCTION TEContinuousStyle (VAR mode: Integer; 
                            VAR aStyle: TextStyle; 
                            hTE: TEHandle): Boolean;
mode
On input, a selector specifying the attributes to be checked. On output, mode identifies only those attributes determined to be continuous over the selection range.
aStyle
On input, a text style record. On output, this record contains the values for the mode attributes determined to be continuous over the selection.
hTE
A handle to the edit record containing the selected text whose attributes are to be checked.
DESCRIPTION
This function does not modify the text selection. Possible values for the mode parameter are defined by the following constants.
ConstantValueDescription
doFont1Specifies the font family ID
doFace2Specifies the character style
doSize4Specifies the type size
doColor8Specifies the color
doAll15Specifies all the attributes

The TEContinuousStyle function returns TRUE if all of the attributes to be checked are continuous and returns FALSE if none or some are continuous.

If the current selection range is an insertion point, TEContinuousStyle first checks the null scrap. If the null scrap contains character attributes, then they are used based on the value of the mode parameter. Otherwise, if the null scrap is empty, TEContinuousStyle returns the attributes of the character preceding the insertion point. The TEContinuousStyle function always returns TRUE in this case, and each field of the text style record is set if the corresponding bit in the mode parameter is set.

If the value of hTE is a handle to a monostyled edit record, TEContinuousStyle returns the set of character attributes that are consistent for the entire record.

Note that fields in the text style record specified by aStyle are only valid if the corresponding bits are set in the mode variable.

How the tsFace field of the aStyle record is used requires some consideration. For example, if TEContinuousStyle returns a mode parameter that contains doFace and the text style record tsFace field is bold, it means that the selected text is all bold, but may contain other text styles, such as italic, as well. Italic does not apply to all of the selected text, or it would have been included in the tsFace field. If the tsFace field is an empty set, then all of the selected text is plain.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996