2.2.4.45.1 UndoBlock::UndoBlock

Description

constructor

Syntax

UndoBlock( int nNameID = 0, BOOL bUndo = TRUE )

Parameters

nNameID
[input] the name ID
[input] Block all undo settings if TRUE

Return

Examples

EX1

void UndoBlock_UndoBlock_ex1()
{
    // get format from Graph1 page
    GraphPage pageSrc("Graph1");
    Tree tree;
    tree = pageSrc.GetFormat();
    if( tree )
    {
        // get undo block ID before any changes
        int nIDbefore = Project.UndoBlockId();
 
        // better to limit scope of undo block
        {
            // start new undo block and save all changes there
            UndoBlock block;
 
            // apply format to Graph2 page
            GraphPage pageDst1("Graph2");
            BOOL bb = pageDst1.ApplyFormat(tree,true,false,true);
 
            // apply format to Graph3 page
            GraphPage pageDst2("Graph3");
            bb = pageDst2.ApplyFormat(tree,true,false,true);
        }
 
        // get undo block ID after all changes
        int nIDafter = Project.UndoBlockId();
 
        // undo all changes from the added undo block
        Project.Undo();
    }
}

Remark

See Also

Header to Include

origin.h