Carbon


TXNCanUndo

Header: MacTextEditor.h Carbon status: Supported

Returns whether the most recent action is undoable and provides a value that indicates the type of action than can be undone.

Boolean TXNCanUndo (
    TXNObject iTXNObject, 
    TXNActionKey *oTXNActionKey
);
Parameter descriptions
iTXNObject

A variable of type TXNObject. Pass the text object for the document you want to examine.

oTXNActionKey

Pass a pointer to a variable of type TXNActionKey. On return, TXNCanUndo sets the TXNActionKey parameter to an “Action Types” value that identifies the action that can be undone. You can use this information to customize the Undo menu item for the specific action to be undone. For example, if the value obtained by TXNCanUndo is kTXNTypingAction, you can map that value to a string that reads “Undo Typing” on a system localized for U.S. English. MLTE does not perform such a mapping; your program is responsible for mapping the key to the appropriate localized string you want displayed to the user. Pass NULL if you do not wish to obtain this information.

function result

A variable of type Boolean. If true, the last command is undoable; otherwise the last command cannot be undone.

DISCUSSION

You can call TXNCanUndo to determine whether the Undo item in the Edit menu should be enabled.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 7/17/2000)