Important: The information in this document is obsolete and should not be used for new development.
A function identified as deprecated has been superseded and may become unsupported in the future.
Disposes of a universal procedure pointer (UPP) to a caret-hook callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void DisposeCaretHookUPP ( CaretHookUPP userUPP );
TextEdit.h
Disposes of a universal procedure pointer (UPP) to a draw-hook callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void DisposeDrawHookUPP ( DrawHookUPP userUPP );
TextEdit.h
Disposes of a universal procedure pointer (UPP) to an EOL-hook callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void DisposeEOLHookUPP ( EOLHookUPP userUPP );
TextEdit.h
Disposes of a universal procedure pointer (UPP) to a high-hook callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void DisposeHighHookUPP ( HighHookUPP userUPP );
TextEdit.h
Disposes of a universal procedure pointer (UPP) to a hit-test hook callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void DisposeHitTestHookUPP ( HitTestHookUPP userUPP );
TextEdit.h
Disposes of a universal procedure pointer (UPP) to a width-hook callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void DisposeNWidthHookUPP ( NWidthHookUPP userUPP );
TextEdit.h
Disposes of a universal procedure pointer (UPP) to a click-loop callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void DisposeTEClickLoopUPP ( TEClickLoopUPP userUPP );
TextEdit.h
Disposes of a universal procedure pointer (UPP) to a do-text callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void DisposeTEDoTextUPP ( TEDoTextUPP userUPP );
TextEdit.h
Disposes of a universal procedure pointer (UPP) to a find-word callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void DisposeTEFindWordUPP ( TEFindWordUPP userUPP );
TextEdit.h
Disposes of a universal procedure pointer (UPP) to a recaluclation callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void DisposeTERecalcUPP ( TERecalcUPP userUPP );
TextEdit.h
Disposes of a universal procedure pointer (UPP) to a text-width-hook callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void DisposeTextWidthHookUPP ( TextWidthHookUPP userUPP );
TextEdit.h
Disposes of a universal procedure pointer (UPP) to a post-update callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void DisposeTSMTEPostUpdateUPP ( TSMTEPostUpdateUPP userUPP );
TSMTE.h
Disposes of a universal procedure pointer (UPP) to a pre-update callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void DisposeTSMTEPreUpdateUPP ( TSMTEPreUpdateUPP userUPP );
TSMTE.h
Disposes of a universal procedure pointer (UPP) to a width-hook callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void DisposeWidthHookUPP ( WidthHookUPP userUPP );
TextEdit.h
Returns a TSM document ID for the specified dialog. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
TSMDocumentID GetTSMTEDialogDocumentID ( DialogRef dialog );
See the Text Services Manager documentation for a description of the TSMDocumentID data type.
TSMTE.h
Returns a handle to a TSM record for the specified dialog. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
TSMTERecHandle GetTSMTEDialogTSMTERecHandle ( DialogRef dialog );
See the description of the TSMTERecHandle data type.
TSMTE.h
Calls a caret-hook callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void InvokeCaretHookUPP ( const Rect *r, TEPtr pTE, CaretHookUPP userUPP );
You should not need to use this function, as the system invokes your callback for you.
TextEdit.h
Calls a draw-hook callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void InvokeDrawHookUPP ( unsigned short textOffset, unsigned short drawLen, void *textBufferPtr, TEPtr pTE, TEHandle hTE, DrawHookUPP userUPP );
You should not need to use this function, as the system invokes your callback for you.
TextEdit.h
Calls an EOL-hook callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
Boolean InvokeEOLHookUPP ( char theChar, TEPtr pTE, TEHandle hTE, EOLHookUPP userUPP );
See the Mac Types documentation for a description of the Boolean data type.
You should not need to use this function, as the system invokes your callback for you.
TextEdit.h
Calls a high-hook callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void InvokeHighHookUPP ( const Rect *r, TEPtr pTE, HighHookUPP userUPP );
You should not need to use this function, as the system invokes your callback for you.
TextEdit.h
Calls a hit-test hook callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
Boolean InvokeHitTestHookUPP ( unsigned short styleRunLen, unsigned short styleRunOffset, unsigned short slop, void *textBufferPtr, TEPtr pTE, TEHandle hTE, unsigned short *pixelWidth, unsigned short *charOffset, Boolean *pixelInChar, HitTestHookUPP userUPP );
See the Mac Types documentation for a description of the Boolean data type.
You should not need to use this function, as the system invokes your callback for you.
TextEdit.h
Calls a width-hook callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
unsigned short InvokeNWidthHookUPP ( unsigned short styleRunLen, unsigned short styleRunOffset, short slop, short direction, void *textBufferPtr, short *lineStart, TEPtr pTE, TEHandle hTE, NWidthHookUPP userUPP );
You should not need to use this function, as the system invokes your callback for you.
TextEdit.h
Calls a click-loop callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
Boolean InvokeTEClickLoopUPP ( TEPtr pTE, TEClickLoopUPP userUPP );
See the Mac Types documentation for a description of the Boolean data type.
You should not need to use this function, as the system invokes your callback for you.
TextEdit.h
Calls a do-text callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void InvokeTEDoTextUPP ( TEPtr pTE, unsigned short firstChar, unsigned short lastChar, short selector, GrafPtr *currentGrafPort, short *charPosition, TEDoTextUPP userUPP );
You should not need to use this function, as the system invokes your callback for you.
TextEdit.h
Calls a find-word callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void InvokeTEFindWordUPP ( unsigned short currentPos, short caller, TEPtr pTE, TEHandle hTE, unsigned short *wordStart, unsigned short *wordEnd, TEFindWordUPP userUPP );
You should not need to use this function, as the system invokes your callback for you.
TextEdit.h
Calls a recalculation callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void InvokeTERecalcUPP ( TEPtr pTE, unsigned short changeLength, unsigned short *lineStart, unsigned short *firstChar, unsigned short *lastChar, TERecalcUPP userUPP );
You should not need to use this function, as the system invokes your callback for you.
TextEdit.h
Calls a text-width-hook callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
unsigned short InvokeTextWidthHookUPP ( unsigned short textLen, unsigned short textOffset, void *textBufferPtr, TEPtr pTE, TEHandle hTE, TextWidthHookUPP userUPP );
You should not need to use this function, as the system invokes your callback for you.
TextEdit.h
Calls a post-update callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void InvokeTSMTEPostUpdateUPP ( TEHandle textH, long fixLen, long inputAreaStart, long inputAreaEnd, long pinStart, long pinEnd, long refCon, TSMTEPostUpdateUPP userUPP );
You should not need to use this function, as the system invokes your callback for you.
TSMTE.h
Calls a pre-update callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void InvokeTSMTEPreUpdateUPP ( TEHandle textH, long refCon, TSMTEPreUpdateUPP userUPP );
You should not need to use this function, as the system invokes your callback for you.
TSMTE.h
Calls a width-hook callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
unsigned short InvokeWidthHookUPP ( unsigned short textLen, unsigned short textOffset, void *textBufferPtr, TEPtr pTE, TEHandle hTE, WidthHookUPP userUPP );
You should not need to use this function, as the system invokes your callback for you.
TextEdit.h
Checks to see if the specified dialog is a TSMTE dialog. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
Boolean IsTSMTEDialog ( DialogRef dialog );
See the Mac Types documentation for a description of the Boolean data type.
TSMTE.h
Creates a new universal procedure pointer (UPP) to a caret-hook callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
CaretHookUPP NewCaretHookUPP ( CaretHookProcPtr userRoutine );
See the description of the CaretHookUPP data type.
TextEdit.h
Creates a new universal procedure pointer (UPP) to a draw-hook callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
DrawHookUPP NewDrawHookUPP ( DrawHookProcPtr userRoutine );
See the description of the DrawHookUPP data type.
TextEdit.h
Creates a new universal procedure pointer (UPP) to an EOL-hook callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
EOLHookUPP NewEOLHookUPP ( EOLHookProcPtr userRoutine );
See the description of the EOLHookUPP data type.
TextEdit.h
Creates a new universal procedure pointer (UPP) to a high-hook callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
HighHookUPP NewHighHookUPP ( HighHookProcPtr userRoutine );
See the description of the HighHookUPP data type.
TextEdit.h
Creates a new universal procedure pointer (UPP) to a hit-test hook callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
HitTestHookUPP NewHitTestHookUPP ( HitTestHookProcPtr userRoutine );
See the description of the HitTestHookUPP data type.
TextEdit.h
Creates a new universal procedure pointer (UPP) to a width-hook callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
NWidthHookUPP NewNWidthHookUPP ( NWidthHookProcPtr userRoutine );
See the description of the NWidthHookUPP data type.
TextEdit.h
Creates a new universal procedure pointer (UPP) to a click-loop callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
TEClickLoopUPP NewTEClickLoopUPP ( TEClickLoopProcPtr userRoutine );
See the description of the TEClickLoopUPP data type.
TextEdit.h
Creates a new universal procedure pointer (UPP) to a do-text callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
TEDoTextUPP NewTEDoTextUPP ( TEDoTextProcPtr userRoutine );
See the description of the TEDoTextUPP data type.
TextEdit.h
Creates a new universal procedure pointer (UPP) to a find-word callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
TEFindWordUPP NewTEFindWordUPP ( TEFindWordProcPtr userRoutine );
See TEFindWordUPP for a description of the TEFindWordUPP data type.
TextEdit.h
Creates a new universal procedure pointer (UPP) to a recalculation callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
TERecalcUPP NewTERecalcUPP ( TERecalcProcPtr userRoutine );
See the description of the TERecalcUPP data type.
TextEdit.h
Creates a new universal procedure pointer (UPP) to a text-width-hook callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
TextWidthHookUPP NewTextWidthHookUPP ( TextWidthHookProcPtr userRoutine );
See the description of the TextWidthHookUPP data type.
TextEdit.h
Creates a new universal procedure pointer (UPP) to a post-update callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
TSMTEPostUpdateUPP NewTSMTEPostUpdateUPP ( TSMTEPostUpdateProcPtr userRoutine );
See TSMTEPostUpdateUPP for a description of the TSMTEPostUpdateUPP data type.
TSMTE.h
Creates a new universal procedure pointer (UPP) to a pre-update callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
TSMTEPreUpdateUPP NewTSMTEPreUpdateUPP ( TSMTEPreUpdateProcPtr userRoutine );
See the description of the TSMTEPreUpdateUPP data type.
TSMTE.h
Creates a new universal procedure pointer (UPP) to a width-hook callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
WidthHookUPP NewWidthHookUPP ( WidthHookProcPtr userRoutine );
See the description of the WidthHookUPP data type.
TextEdit.h
Sets the document ID for the specified dialog. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void SetTSMTEDialogDocumentID ( DialogRef dialog, TSMDocumentID documentID );
TSMTE.h
Sets a handle to a TSMTE record for the specified dialog. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void SetTSMTEDialogTSMTERecHandle ( DialogRef dialog, TSMTERecHandle tsmteRecHandle );
TSMTE.h
Activates the specified edit structure. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void TEActivate ( TEHandle hTE );
A handle to the specified edit structure.
When your application receives notification of an activate event, it can call the TEActivate function, which activates an edit structure and highlights the selection range. If the selection range is an insertion point, TEActivate simply displays a caret there. Call this function every time the Event Manager function WaitNextEvent reports that the window containing the edit structure has become active.
If you do not call TEActivate before you call TEClick, TEIdle, or TESetSelect, the selection range is not highlighted, or, if the selection range is set to an insertion point, a caret is not displayed at the insertion point. However, if you have turned on outline highlighting through the TEFeatureFlag function for the edit structure, the text of the selection range is framed or a dimmed or an unblinking caret is displayed at the insertion point.
TextEdit.h
Enables and disables automatic scrolling of the text in the specified edit structure. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void TEAutoView ( Boolean fAuto, TEHandle hTE );
A flag indicating whether to enable or disable automatic scrolling. A value of TRUE enables automatic scrolling; a value of FALSE disables automatic scrolling.
A handle to the edit structure for which automatic scrolling is to be enabled or disabled.
The TEAutoView function does not actually scroll the text automatically: TESelView does. However, when fAuto is set to FALSE , a call to TESelView has no effect.
If there is a scroll bar associated with the edit structure, your application must manage scrolling of it. You can replace the default click loop function, which scrolls the text only, with a customized version that also updates the scroll bar.
You can also enable or disable automatic scrolling for an edit structure through the teFAutoScroll feature of the TEFeatureFlag function. For more information, see TEFeatureFlag.
TextEdit.h
Recalculates the beginnings of all lines of text in the specified edit structure. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void TECalText ( TEHandle hTE );
A handle to the edit structure whose text lines are to be recalculated.
The TECalText function updates elements of the lineStarts array in an edit structure. Call TECalText if you’ve changed the destination rectangle, the hText field, or any other property of the edit structure that pertains to line breaks and the number of characters per line—for example, font, size, style, and so on.
TextEdit.h
Controls placement and highlighting of the selection range as determined by mouse events. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void TEClick ( Point pt, Boolean fExtend, TEHandle h );
The mouse location in local coordinates at the time the mouse button was pressed, obtainable from the event structure (in global coordinates).
A flag denoting the state of the Shift key at the time of the click as indicated by the Event Manager. If the Shift key was held down at the time of the click to extend the selection, pass a value of TRUE.
A handle to the edit structure whose text is displayed in the view rectangle where the click occurred.
Call TEClick whenever a mouse-down event occurs in the view rectangle of the edit structure and the window associated with that edit structure is active. The TEClick function keeps control until the mouse button is released. Use the QuickDraw function GlobalToLocal to convert the global coordinates of the mouse location given in the event structure to the local coordinate system for pt.
The TEClick function removes highlighting of the old selection range unless the selection range is being extended. If the mouse moves, meaning that a drag is occurring, TEClick expands or shortens the selection range accordingly a character at a time. In the case of a double-click, the word where the cursor is positioned becomes the selection range.
TextEdit.h
Determines whether a given character attribute is continuous over the current selection range. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
Boolean TEContinuousStyle ( short *mode, TextStyle *aStyle, TEHandle hTE );
On input, a pointer to a selector specifying the attributes to be checked. On output, mode identifies only those attributes determined to be continuous over the selection range. Possible values for the mode parameter are defined in “Text Styling Constants.”
On input, a pointer to a text style structure. On output, this structure contains the values for the mode attributes determined to be continuous over the selection.
A handle to the edit structure containing the selected text whose attributes are to be checked. If the value of hTE is a handle to a monostyled edit structure, TEContinuousStyle returns the set of character attributes that are consistent for the entire structure.
TRUE if all of the attributes to be checked are continuous; FALSE if none or some are continuous. See the Mac Types documentation for a description of the Boolean data type.
This function does not modify the text selection. 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 structure is set if the corresponding bit in the mode parameter is set.
Note that fields in the text style structure specified by aStyle are only valid if the corresponding bits are set in the mode variable.
How the tsFace field of the aStyle structure is used requires some consideration. For example, if TEContinuousStyle returns a mode parameter that contains doFace and the text style structure 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.
TextEdit.h
Copies the text selection range from the edit structure, leaving the selection range intact. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void TECopy ( TEHandle hTE );
A handle to the edit structure containing the text to be copied.
The TECopy function copies the text to the private scrap. For text of a monostyled edit structure, the text is written to the private scrap only. For text of a multistyled edit structure, the text is written to the TextEdit private scrap, the character attribute information is written to the TextEdit style scrap, and both are written to the Scrap Manager’s desk scrap. Anything previously in the private scrap is deleted before the copied text is written to it.
For both multistyled and monostyled text, if the selection range is an insertion point, TECopy empties the TextEdit private scrap. When the selection range is an insertion point and the text is multistyled, TECopy has no effect on the null scrap, the style scrap, or the Scrap Manager’s desk scrap.
TextEdit.h
Replaces a default TextEdit hook function with a customized function and returns the address of the replaced function. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void TECustomHook ( TEIntHook which, UniversalProcPtr *addr, TEHandle hTE );
The hook whose default function is to be replaced.
On input, the address of your customized function.
On output, the addr parameter contains the address of the function that was previously installed in the field identified by the which parameter. This address is returned so that you can daisy-chain functions.
A handle to the edit structure to be modified.
The TECustomHook function lets you alter the behavior of TextEdit to better suit your application’s requirements and those of the script systems installed. If you replace a default hook function with a customized version that you write in a high-level language, such as Pascal or C, you need to provide assembly-language glue code that utilizes the registers for your high-level language function.
The end-of-line hook, width measurement hook, new width measurement hook, text width measurement hook, draw hook, and hit test hook fields are hook fields in the TextEdit dispatch structure. The which parameter identifies the hook whose default function is to be replaced. You use the constants described in “Text Custom Hook Constants” to specify a value for this parameter.
Certain precautions are critical in replacing default functions. Before placing the address of your function in the TextEdit dispatch structure, strip the addresses, using the Operating System Utilities StripAddress function, to guarantee that your application is 32-bit clean.
Before replacing a TextEdit function with a customized one, determine whether more than one script system is installed, and if so, ensure that your customized function accommodates all of the installed script systems. This avoids the problem of your customized function producing results that are incompatible with the Script Manager.
TextEdit.h
Removes the current selection range from the text of the designated edit structure, redrawing the text as necessary. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void TECut ( TEHandle hTE );
A handle to the edit structure containing the text to be cut.
For monostyled text, the TECut function writes the cut text to the private scrap.
For multistyled text, TECut writes the cut text to the private scrap and its character attributes to the style scrap it also writes both to the Scrap Manager’s desk scrap. For multistyled text, the TECut function removes the character attributes from the style structure’s style table when the text is cut.
For both monostyled and multistyled text, if the selection range is an insertion point, TextEdit deletes everything from the private scrap. When the selection range is an insertion point and the text is multistyled, TECut has no effect on the style scrap or the Scrap Manager’s desk scrap.
TextEdit.h
Deactivates the specified edit structure. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void TEDeactivate ( TEHandle hTE );
A handle to the specified edit structure.
When the activate event flag is set to deactivate the window, your application can call the TEDeactivate function, which changes an edit structure’s status from active to inactive and removes the selection range highlighting or the caret.
However, if you turned on outline highlighting through the TEFeatureFlag function for the edit structure, the text of the selection range is framed or a dimmed or an unblinking caret is displayed at the insertion point when the structure is deactivated.
Call this function every time the Event Manager function WaitNextEvent reports that the window containing the edit structure has become inactive.
TextEdit.h
Removes the selected range of text from the designated edit structure, redrawing the remaining text as necessary. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void TEDelete ( TEHandle hTE );
A handle to the edit structure containing the text to be deleted.
When the TEDelete function deletes a selected range of text, it does not transfer the text to either the private scrap or the Scrap Manager’s desk scrap.
For multistyled structures, when you use TEDelete to delete a selected range of text, the associated character attributes are saved in the null scrap to be applied to characters entered after the text is deleted. When the user clicks in some other area of the text, the character attributes are removed from the null scrap. You can use TEDelete to implement the Clear command. The TEDelete function recalculates line starts and line heights.
TextEdit.h
Removes a specified edit structure and releases all memory associated with it. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void TEDispose ( TEHandle hTE );
A handle to the edit structure for which the allocated memory should be released.
Call the TEDispose function only when you’re completely through with an edit structure.
Note that if your program retains a handle to text associated with the edit structure that you are destroying with TEDispose , the handle becomes invalid because the TEDispose function disposes of it, as well as the dispatch structure handle. If the structure is multistyled, TEDispose also disposes all of the style-related handles: STHandle, LHHandle, STScrpHandle, nullSTHandle, and TEStyleHandle.
To continue to refer to the text after you’ve destroyed the edit structure, you need to make a copy of the handle in the hText field of the edit structure using the Operating System Utilities HandToHand function before you call TEDispose.
In addition to disposing of the edit structure, the edit structure handle, and the dispatch structure handle, the TEDispose function destroys the null scrap associated with the edit structure and releases the memory used for it.
TextEdit.h
Turns a specified feature on or off or returns the current status of that feature. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
short TEFeatureFlag ( short feature, short action, TEHandle hTE );
The feature for which the action is to be performed. See “Text Feature Constants” for a description of the available values.
A selector stipulating that the feature, specified by the feature parameter, is to be turned on or off, or that the current status of the feature is to be returned. See “Text Feature Action Constants” for a description of the available values.
A handle to the edit structure for which the action should be performed.
The status of the specified feature (if the selector is set to teBitTest).
You can use the TEFeatureFlag function to check the status of additional TextEdit features—automatic scrolling, outline highlighting, and text buffering—and to enable or disable the feature. You can also use this function to disable inline input in a particular edit structure and to enable several features that have been provided so that inline input works correctly with TextEdit.
TextEdit.h
Copies the contents of the desk scrap to the TextEdit private scrap. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
OSErr TEFromScrap ( void );
A result code. See “TextEdit Result Codes.”
You use this function to move monostyled text across applications or between an application and a desk accessory.
TextEdit.h
Obtains a universal procedure pointer to your do-text-hook callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
TEDoTextUPP TEGetDoTextHook ( void );
See the description of the TEDoTextUPP data type.
TextEdit.h
Obtains a universal procedure pointer to your set-find-word-hook callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
TEFindWordUPP TEGetFindWordHook ( void );
See the description of the TEFindWordUPP data type.
TextEdit.h
Returns the total height of all of the lines in the text between and including the specified starting and ending lines. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
long TEGetHeight ( long endLine, long startLine, TEHandle hTE );
The number of the last line of text whose height is to be included in the total height. You can specify a value that is greater than or equal to 1 for this parameter.
The number of the first line of text whose height is to be included in the total height. You can specify a value that is greater than or equal to 1 for this parameter.
A handle to the edit structure containing the lines of text whose height is to be returned.
The total height of all of the designated text lines.
For monostyled text, the TEGetHeight function uses the value of the edit structure’s lineHeight field. For multistyled text, it uses the line height element (LHElement) of the line height table (LHTable). Note that TEGetHeight does not take into account the height of any blank lines at the end of the text. You need to consider this when scrolling text.
TextEdit.h
Obtains the highlight region for the specified edit structure. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
OSErr TEGetHiliteRgn ( RgnHandle region, TEHandle hTE );
A result code. See “TextEdit Result Codes.”
TextEdit.h
Finds the byte offset of a character in an edit structure’s text that corresponds to the specified point. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
short TEGetOffset ( Point pt, TEHandle hTE );
A point in the displayed text of the specified edit structure.
A handle to the edit structure containing the text.
The byte offset of the character at the specified point. In the case of a 2-byte character, the function returns the byte offset of the first byte.
The TEGetOffset function works for both monostyled and multistyled edit structures.
TextEdit.h
Determines the point that corresponds to the specified byte offset of a character and returns the coordinates of that point. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
Point TEGetPoint ( short offset, TEHandle hTE );
A byte offset into the text buffer of an edit structure.
A handle to the edit structure containing the text.
The coordinates of the point that corresponds to the specified byte offset. The TEGetPoint function returns a valid result even when the edit structure does not contain any text. The point returned is based on the values in the structure’s destination rectangle.
In the case of an offset being equal to a line end, which is also the start of the next line, TEGetPoint returns a point corresponding to the line start of the next line. In the case of a dual caret, the primary caret position, the one corresponding to the primary line direction, is returned.
See the Mac Types documentation for a description of the Point data type.
The line height, taken either from the lineHeight field for a monostyled edit structure or from the line-height array, LHElement , for a multistyled edit structure, is also used to determine the vertical component. Both the text direction and the primary line direction are used to determine the horizontal component.
The TEGetPoint function works for both monostyled and multistyled edit structures.
TextEdit.h
Obtains a universal procedure pointer to your recalculation callback. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
TERecalcUPP TEGetRecalcHook ( void );
See the description of the TERecalcUPP data type.
TextEdit.h
Returns a handle to the TextEdit private scrap. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
Handle TEGetScrapHandle ( void );
See the Mac Types documentation for a description of the Handle data type.
TextEdit.h
Returns the size of the TextEdit private scrap, in bytes. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
long TEGetScrapLength ( void );
The size of the TextEdit private scrap, in bytes.
TextEdit.h
Gets character attributes for the specified text. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
void TEGetStyle ( short offset, TextStyle *theStyle, short *lineHeight, short *fontAscent, TEHandle hTE );
The offset to the text whose character attributes you want to obtain.
On output, points to a structure of type TextStyle that contains the character attributes for the current selection range.
A pointer to a value that specifies the line height.
A pointer to a value that specifies the font ascent.
A handle to the multistyled edit structure containing the text whose character attributes you want to obtain.
TextEdit.h
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. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
TEStyleHandle TEGetStyleHandle ( TEHandle hTE );
A handle to the multistyled edit structure containing the style handle to be returned.
A handle to the style structure contained in the specified edit structure (of type TEStyleRec). Because only multistyled edit structures have style structures, TEGetStyleHandle returns NULL when used with a monostyled edit structure. See the description of the TEStyleHandle data type.
To ensure future compatibility, your application should always use this function rather than manipulate the fields of the edit structure directly.
TextEdit.h
Creates a style scrap structure, copies the character attributes associated with the current selection range into it, and returns a handle to it. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
StScrpHandle TEGetStyleScrapHandle ( TEHandle hTE );
The handle to the edit structure containing the text selection range whose character attributes are to be copied.
A handle to the created style scrap structure, or NULL if called with a handle to a monostyled structure. See the description of the StScrpHandle data type.
The TEGetStyleScrapHandle function creates a style scrap structure of type StScrpRec and copies the character attributes associated with the current selection range of the designated edit structure into it. If the current selection range is an insertion point, TEGetStyleScrapHandle first checks the null scrap. If the null scrap contains character attributes, they are written to the newly created style scrap structure. If the null scrap is empty, the attributes associated with the character preceding the insertion point are copied to the style scrap structure.
The TEGetStyleScrapHandle function has no impact on the Scrap Manager’s desk scrap.
TextEdit.h
Returns a handle to the text of the specified edit structure. (Deprecated in Mac OS X v10.4. Use Multilingual Text Engine instead; see Handling Unicode Text Editing With MLTE.)
CharsHandle TEGetText ( TEHandle hTE );
A handle to the edit structure containing the text whose handle you want returned. You pass this handle as an input parameter.
A handle to the text contained in the specified edit structure. See page 82 for a description of the CharsHandle data type.
Given an edit structure that contains text, you can use the TEGetText function to get a handle to the text itself. The TEGetText function doesn’t make a copy of the text. Rather, it returns the handle to the text which is stored as a packed array of characters. (This handle belongs to TextEdit your application must not destroy it.) The teLength field of the edit structure contains the length of the text whose handle is returned.
The handle of type CharsHandle