L_AnnAddUndoNode
#include "l_bitmap.h"
L_LTANN_API L_INT L_AnnAddUndoNode(hObject);
HANNOBJECT hObject; |
/* handle to the automation object */ |
Manually adds an undo node to the automation object.
This function is available in the Document and Medical Imaging toolkits.
Parameter |
Description |
hObject |
Handle to the automation object. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
This function allows you to programmatically add a node to the undo stack maintained by the automation object hObject. This function can only be called for automation objects.
This function should be called before making any changes programmatically to the objects inside the container linked to the automation object. That way, these changes can be reversed using the Undo menu brought up by the automation or by calling L_AnnUndo.
The number of actions that can be undone should be set with L_AnnSetUndoDepth before calling this function.
Calling L_AnnSetAutoUndoEnable(FALSE) disables the undo mechanism of the automation object. Therefore the automation object cannot change the undo stack until the undo mechanism is enabled by calling L_AnnSetAutoUndoEnable(TRUE).
ERROR_NO_UNDO_STACK will be returned if L_AnnSetUndoDepth has not been called before this function or if L_AnnSetUndoDepth has been called with uUndoLevels set to 0;
ERROR_UNDO_DISABLED will be returned if the undo has been disabled by calling L_AnnSetAutoUndoEnable(hObject, FALSE).
Basically, the process is as follows:
1. |
Call L_AnnSetUndoDepth to set the number of undo actions that can take place. |
2. |
Call L_AnnAddUndoNode to add an undo node to the automation object. |
3. |
Disable the undo feature by calling L_AnnSetAutoUndoEnable (FALSE). |
4. |
Perform the operations to be combined into one undo. |
5. |
Re-enable the undo feature by calling L_AnnSetAutoUndoEnable (TRUE). |
Now, all three operations can be undone with one call to L_AnnUndo instead of three calls to L_AnnUndo.
Required DLLs and Libraries
LTANN For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
Platforms
Windows 2000 / XP/Vista.
See Also
Functions: |
L_AnnSetAutoUndoEnabled, L_AnnGetAutoUndoEnabled, L_AnnGetUndoDepth, L_AnnSetUndoDepth, L_AnnUndo |
Topics: |
|
|
Annotation Functions (Document/Medical only): Implementing Automation |
Example
For an example, refer to L_AnnSetAutoDefaults.