LAutomation::SetUndoEnabled

#include "ltaut.h"

L_INT LAutomation::SetUndoEnabled (bEnabled=TRUE);

L_BOOL bEnabled;

/* flag */

Disables or re-enables the undo feature of the automation handle.

Parameter

Description

bEnabled

Flag that indicates whether to enable or disable the undo feature of the automation handle. By enabling or disabling the undo feature, the internal undo counter is incremented or decremented. Possible values are:

 

Value

Meaning

 

TRUE

Enable the undo feature and increment the internal undo counter by one.

 

FALSE

Disable the undo feature and decrement the internal undo counter by one.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This function sets an internal automation counter that determines whether the undo feature should be displayed. The undo feature is on only if this counter is greater than or equal to 0. The initial value is 0.

Use this function along with LAutomation::AddUndoNode to combine multiple operations into a single undo call. For more information on this process, refer to LAutomation::AddUndoNode.

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::SetUndoLevel, LAutomation::AddUndoNode, LAutomation::Undo, LAutomation::Redo

Topics:

Undoing and Redoing Automation Operations

Example

This example shows how enable/disable the undo stack.

L_INT LAutomation_SetUndoEnabledExample(LAutomation  &Automation)
{
   L_INT nRet;
   //check the validity of the automation handle 
   nRet = Automation .IsValid ();
   if ( SUCCESS == nRet )
   {
      // Disable recording of undo operations 
     nRet = Automation.SetUndoEnabled(FALSE);
     if(nRet != SUCCESS)
        return nRet;
     // Do any vector operations that will not be added to the undo stack 
     // Enable recording of undo operations 
     nRet = Automation.SetUndoEnabled();
     if(nRet != SUCCESS)
        return nRet;
   }
   else
   {
      return nRet;
   }
     return SUCCESS;
}