Functions


Activating and Deactivating an Edit Structure

TEActivate Activates the specified edit structure.
TEDeactivate Deactivates the specified edit structure.

Additional TextEdit Features

TEFeatureFlag Turns a specified feature on or off or returns the current status of that feature. Features supported are automatic scrolling, text buffering, outline highlighting, inline input, and text services.

Checking, Setting, and Replacing Styles

TEContinuousStyle Determines whether a given character attribute is continuous over the current selection range.
TEGetStyleScrapHandle Creates a style scrap structure, copies the character attributes associated with the current selection range into it, and returns a handle to it.
TENumStyles Returns the number of character attribute changes contained in the specified range, counting one for the start of the range.
TEReplaceStyle Replaces any character attributes in the current selection range that match the specified existing character attributes with the specified new character attributes.
TESetStyle Sets new character attributes, in the specified edit structure, for the current selection range.
TEStyleInsert Inserts the specified text immediately before the selection range or the insertion point in the edit structure’s text and applies the specified character attributes to the text, redrawing the text if necessary.
TEUseStyleScrap Assigns new character attributes to the specified range of text in the designated edit structure.

Customizing TextEdit

TECustomHook Replaces a default TextEdit hook function with a customized function and returns the address of the replaced function.
TESetClickLoop Installs the address of the application-supplied click loop function in the clikLoop field of the edit structure.
TESetWordBreak Installs the address of a customized word-selection break function in the wordBreak field of the specified edit structure.

Displaying and Scrolling Text

TEAutoView Enables and disables automatic scrolling of the text in the specified edit structure.
TECalText Recalculates the beginnings of all lines of text in the specified edit structure.
TEGetHeight Returns the total height of all of the lines in the text between and including the specified starting and ending lines.
TEPinScroll Scrolls the text within the view rectangle of the specified edit structure by the designated number of pixels. Scrolling stops when the last line of text is scrolled into view.
TEScroll Scrolls the text within the view rectangle of the specified edit structure by the designated number of pixels.
TESelView Ensures, once automatic scrolling has been enabled by a call to the TEAutoView function or through the TEFeatureFlag function, that the selection range is visible, scrolling it into the view rectangle if necessary.
TESetAlignment Sets the alignment of the specified text in an edit structure so that it is centered, right aligned, or left aligned, or aligned according to the line direction.
TETextBox Draws the indicated text in a given rectangle, with the specified alignment.
TEUpdate Draws the specified text within a given update rectangle.

Initializing TextEdit, Creating an Edit Structure, and Disposing of an Edit Structure

TEDispose Removes a specified edit structure and releases all memory associated with it.
TEInit Initializes TextEdit.
TENew Creates and initializes a monostyled edit structure and allocates a handle to it.
TEStyleNew Creates a multistyled edit structure and allocates a handle to it.

Managing the TextEdit Private Scrap

TEGetScrapLength Returns the size of the TextEdit private scrap, in bytes.
TEScrapHandle Returns a handle to the TextEdit private scrap.
TESetScrapLength Sets the size of the TextEdit private scrap to the specified number of bytes.

Modifying the Text of an Edit Structure

TECopy Copies the text selection range from the edit structure, leaving the selection range intact.
TECut Removes the current selection range from the text of the designated edit structure, redrawing the text as necessary.
TEDelete Removes the selected range of text from the designated edit structure, redrawing the remaining text as necessary.
TEFromScrap Copies the contents of the desk scrap to the TextEdit private scrap.
TEInsert Inserts the specified text immediately before the selection range or the insertion point in the text of the designated edit structure, redrawing the text as necessary.
TEPaste Replaces the edit structure’s selected text with the contents of the private scrap and leaves an insertion point after the inserted text. If the selection range is an insertion point, TEPaste inserts the contents of the private scrap there.
TEStylePaste Pastes text and its associated character attribute information from the desk scrap into the edit structure’s text at the insertion point—if the current selection range is an insertion point—or it replaces the current selection range.
TEToScrap Copies the contents of the TextEdit private scrap to the desk scrap.

Setting and Getting an Edit Structure’s Text and Character Attribute Information

TEGetStyleHandle Returns the style handle stored in the designated edit structure’s txFont and txFace fields. The style handle points to the associated style structure, not to a copy of it.
TEGetText Returns a handle to the text of the specified edit structure.
TEKey Replaces the selection range in the text of the specified edit structure with the input character and positions the insertion point just past the inserted character.
TESetStyleHandle Sets an edit structure’s style handle, which is stored in the txFont and txFace fields.
TESetText Incorporates a copy of the specified text into the designated edit structure.

Setting the Caret and Selection Range

TEClick Controls placement and highlighting of the selection range as determined by mouse events.
TEIdle When called repeatedly, displays a blinking caret at the insertion point, if any exists, in the text of the specified edit structure of an active window.
TESetSelect Sets the selection range (or denotes the insertion point) within the text of the specified edit structure.

Using Byte Offsets and Corresponding Points

TEGetOffset Finds the byte offset of a character in an edit structure’s text that corresponds to the specified point.
TEGetPoint Determines the point that corresponds to the specified byte offset of a character and returns the coordinates of that point.

Miscellaneous

CallCaretHookProc
CallDrawHookProc
CallEOLHookProc
CallHighHookProc
CallHitTestHookProc
CallNWidthHookProc
CallTEClickLoopProc
CallTEDoTextProc
CallTEFindWordProc
CallTERecalcProc
CallTSMTEPostUpdateProc
CallTSMTEPreUpdateProc
CallTextWidthHookProc
CallWidthHookProc
CallWordBreakProc
DisposeCaretHookUPP
DisposeDrawHookUPP
DisposeEOLHookUPP
DisposeHighHookUPP
DisposeHitTestHookUPP
DisposeNWidthHookUPP
DisposeTEClickLoopUPP
DisposeTEDoTextUPP
DisposeTEFindWordUPP
DisposeTERecalcUPP
DisposeTSMTEPostUpdateUPP
DisposeTSMTEPreUpdateUPP
DisposeTextWidthHookUPP
DisposeWidthHookUPP
DisposeWordBreakUPP
GetTSMDialogDocumentID
GetTSMDialogPtr
GetTSMDialogTextEditHandle
GetTSMTEDialogDocumentID
GetTSMTEDialogTSMTERecHandle
InvokeCaretHookUPP
InvokeDrawHookUPP
InvokeEOLHookUPP
InvokeHighHookUPP
InvokeHitTestHookUPP
InvokeNWidthHookUPP
InvokeTEClickLoopUPP
InvokeTEDoTextUPP
InvokeTEFindWordUPP
InvokeTERecalcUPP
InvokeTSMTEPostUpdateUPP
InvokeTSMTEPreUpdateUPP
InvokeTextWidthHookUPP
InvokeWidthHookUPP
InvokeWordBreakUPP
IsTSMTEDialog
NewCaretHookUPP
NewDrawHookUPP
NewEOLHookUPP
NewHighHookUPP
NewHitTestHookUPP
NewNWidthHookUPP
NewTEClickLoopUPP
NewTEDoTextUPP
NewTEFindWordUPP
NewTERecalcUPP
NewTSMTEPostUpdateUPP
NewTSMTEPreUpdateUPP
NewTextWidthHookUPP
NewWidthHookUPP
NewWordBreakUPP
SetTSMDialogDocumentID
SetTSMDialogTextEditHandle
SetTSMTEDialogDocumentID
SetTSMTEDialogTSMTERecHandle
TEGetDoTextHook
TEGetFindWordHook
TEGetHiliteRgn
TEGetRecalcHook
TEGetScrapHandle
TEGetStyle
TESetDoTextHook
TESetFindWordHook
TESetRecalcHook
TESetScrapHandle
teclick

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