LAutomation::AddUndoNode

#include "ltwrappr.h"

L_INT LAutomation::AddUndoNode(dwFlags);

L_UINT32 dwFlags;

/* reserved */

Manually adds an undo node to the automation object.

Parameter

Description

dwFlags

Reserved for future use. Use 0.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This function adds an undo node to the automation object. When used with LAutomation::SetUndoEnabled, a lengthy operation, consisting of multiple steps, can be combined into one undo call to LAutomation::Undo. To accomplish this, use the following steps:

1.

Call LAutomation::AddUndoNode to add an undo node to the automation handle.

2.

Disable the undo feature by calling LAutomation::SetUndoEnabled (FALSE).

3.

Perform the operations to be combined into one undo.

4.

Re-enable the undo feature by calling LAutomation::SetUndoEnabled (TRUE).

Required DLLs and Libraries

LTAUT

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions:

LAutomation::SetUndoEnabled, LAutomation::SetUndoLevel, LAutomation::Undo, LAutomation::Redo

Topics:

Undoing and Redoing Automation Operations

Example

This example shows how to group several vector operations into a single undo node.

L_INT LAutomation_AddUndoNodeExample(LAutomation  &Automation)
{
   L_INT nRet;
   // Add an undo node manually 
   nRet = Automation.AddUndoNode(0);
   if(nRet != SUCCESS)
      return nRet;
   
   // Disable the undo feature */
   nRet = Automation.SetUndoEnabled (FALSE);
   if(nRet != SUCCESS)
      return nRet;
   
   // Do multiple operations on the automation object 
   
   // Re-enable the undo feature 
   nRet = Automation.SetUndoEnabled(TRUE);
   if(nRet != SUCCESS)
      return nRet;
   return SUCCESS;
}