Carbon


Text Feature Constants

Header: TextEdit.h

enum {
    teFAutoScroll = 0,
    teFTextBuffering = 1,
    teFOutlineHilite = 2,
    teFInlineInput = 3,
    teFUseWhiteBackground = 4,
    teFUseInlineInput = 5,
    teFInlineInputAutoScroll = 6
};

Constant descriptions

teFAutoScroll

Automatic scrolling. You can use the TEFeatureFlag function to turn automatic scrolling on and off as an alternative to calling TEAutoView. The effect is the same.

teFTextBuffering

Text buffering. The teFTextBuffering selector enables or disables text buffering for performance improvements of 2-byte scripts. This is a global buffer, as opposed to the TEKey function’s internal 2-byte buffer, and it is used across all active edit structures.

Exercise care when you enable the text-buffering capability in more than one active structure; otherwise, the bytes that are buffered from one edit structure may appear in another edit structure.

Ensure that buffering is not turned off in the middle of processing a 2-byte character. To guarantee the integrity of your structure, it is important that you wait for an idle event before you disable buffering or enable buffering in a second edit structure.

When text buffering is enabled, ensure that the TEIdle function is called before any pause of more than a few ticks—for example, before the Event Manager function WaitNextEvent. A possibility of a long delay before characters appear on the screen exists, especially in non-Roman systems. If you do not call TEIdle, the characters can end up in the edit structure of another application.

If text buffering is enabled on a non-Roman script system and the keyboard has changed, TextEdit flushes the text of the current script from the buffer before bringing characters of the new script into the buffer.

teFOutlineHilite

Outline highlighting. The teFOutlineHilite selector specifies outline highlighting as the feature for which an action is to be performed. If a highlighted region exists in an edit structure and the window is inactive, then the highlighted region is outlined or framed.

In the case that outline highlighting is enabled and the current selection range is an insertion point, the caret is then drawn in a gray pattern so that it appears dimmed. To do the framing and caret dimming, TextEdit temporarily replaces the current address in the highHook and caretHook fields of the edit structure, redraws the caret or the highlighted region, and then immediately restores the hooks to their previous addresses.

teFInlineInput

Inline input. You must deactivate an edit structure (using TEDeactivate) before changing the state of the feature bits or any fields in the edit structure.

In the future, other text services may use this same mechanism. If you follow the guidelines specified here, your application should also work with future text services. When an inline edit session begins, inline input also sets the teFInlineInput bit to provide the following features so that inline input works correctly with TextEdit: disabling font and keyboard synchronization, forcing a multiple-line selection to be highlighted line by line using a separate rectangle for each line rather than using a minimum number of rectangles for optimization, and highlighting a line only to the edge of the text rather than beyond the text to the edge of the view rectangle.

The teFInlineInput bit is cleared by inline input when an inline session ends. Use the teFInlineInput constant in the feature parameter of TEFeatureFlag to include these features in your application even when inline input is not installed. Be careful about changing the state of this bit if the teFUseTextServices bit is set. Again, the edit structure should always be deactivated before you change the state of the teFInlineInput bit. If you clear the teFUseTextServices bit and you set the teFInlineInput bit, inline input is disabled, but your application retains the features listed above.

teFUseWhiteBackground
teFUseInlineInput
teFInlineInputAutoScroll

To identify or adjust a feature, you specify one of these constants as the value of the feature parameter to the TEFeatureFlag function.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)