TEReplaceStyle
TEReplaceStyle
Replace style characteristics in currently selected text short mode ; a bit-coded style-operation mode; a Style Mode
TextStyle *oldStyle ; address of structure with style attributes to change TextStyle *newStyle ; address of structure with desired attributes currently-selected text. It may be preferable to TESetStyle, since you can pick exactly which characteristic-combinations to replace.
mode specifies a style operation mode (see Style Mode). Bits of this
value specify which characteristics of the selected text you wish to
modify. The bits are defined as Text Styles, with the following changes:
addSize 0x10 (no meaning with this function)
doToggle 0x20 (no meaning with this function)
oldStyle and ...
newStyle are addresses of 12-byte TextStyle structures. Fields in oldStyle indicate which attribute-combinations to replace; fields of newStyle
specify what to replace them with. Depending upon the value of mode,
some fields of these structures may be ignored.
redraw specifies whether or not to redraw the text (update the screen to
reflect the changes). It is one of:
FALSE (0) don't redraw now; wait for an update event and TEUpdate TRUE (1) redraw immediately hTE is a handle obtained via TENew (old style TextEdit record) or TEStylNew (new style TextEdit record). It leads to a variable-length TERec structure and identifies the edit record to be affected by this change.
All styles in the current selection range with the exact attribute
combination identified in oldStyle (and specified in mode ) are replaced by
the values in newStyle.
For example, if the selected text is:
some Bold and some ÏUnderlined Bold
then:
oldStyle.tsFace = bold;
newStyle.tsFace = outline;
the text will be redrawn as:
some ÈBold and some ÏUnderlined Bold
Note that this example affected the bold-only text exclusively; it did not
affect the bold-and- underlined text
TextStyle record describing a specified character. The System 6.0 complexity of the style runs in a selection range.