L_AutSetUndoLevel

#include "ltaut.h"

L_LTAUT_API L_INT L_AutSetUndoLevel(pAutomation, uLevel)

pAUTOMATIONHANDLE pAutomation;

/* pointer to an automation handle */

L_UINT uLevel;

/* undo level */

Sets the automation undo level.

Parameter

Description

pAutomation

Pointer to an automation handle.

uLevel

An integer value that represents the maximum number of undo operations that can be performed in each container associated with the automation handle. The default value is DEF_AUTOMATION_UNDO_LEVEL [16].

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

The undo level determines the number of automation operations that can be done within an automation container. If the undo level is set to 16, then each container associated with the automation handle has an undo level of 16.

To determine the current undo level, call L_AutGetUndoLevel.

To undo an automation operation, call L_AutUndo.

To determine whether an automation operation can be undone, call L_AutCanUndo.

For information about grouping multiple operations into a single undo process, refer to L_AutAddUndoNode.

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:

L_AutGetUndoLevel, L_AutUndo, L_AutCanUndo

Topics:

Undoing and Redoing Automation Operations

Example

This example shows how to Get/Set the automation undo level.

 L_INT AutSetUndoLevelExample(pAUTOMATIONHANDLE pAutomation)
{
   L_INT nRet;
   nRet =L_AutIsValid ( pAutomation ); 
   if ( SUCCESS ==  nRet) /* check the validity of the automation handle */
   {
      L_UINT uAutUndoLevel ;

      /* get the current automation undo level */
      nRet = L_AutGetUndoLevel( pAutomation, &uAutUndoLevel ) ;
      if(nRet != SUCCESS)
         return nRet;

      if ( 32 != uAutUndoLevel )
      {
         /* set the automation undo level to 32 */
         nRet = L_AutSetUndoLevel ( pAutomation, 32 ) ;

         if(nRet != SUCCESS)
            return nRet;

      }

      return SUCCESS ;
   }
   else
   {
      return nRet ;
   }
}