2.1.14.2.2 matobj_move


Description

Move a MatrixObject to replace another one.


Move a MatrixObject to end of a specified MatrixLayer

Syntax

bool matobj_move( MatrixObject & moSrc, MatrixObject & moDest )


bool matobj_move( MatrixObject & moSrc, MatrixLayer & mlDest )

Parameters

moSrc
[input] the source MatrixObject to move
moDest
[input] the MatrixObject to be replaced with moSrc


moSrc
[input] the MatrixObject to be moved
mlDest
[modify] the MatrixLayer which moSrc will be moved to

Return

return true on success, else return false


return true on success, else return false

Examples

EX1

void    matobj_move_ex1()
{
    //make sure an active matrixlayer with two matrixobject exists before run this code
    MatrixLayer ml = Project.ActiveLayer();
    if ( ml )
    {
        MatrixObject moSrc(ml, 0);
        MatrixObject moDest(ml, 1);
        if ( matobj_move(moSrc, moDest) )
            printf("Move MatrixObject successfully!");
        else
            printf("Fail to move MatrixObject!");
    }
}


EX2

void    matobj_move_ex2()
{
    //make sure the is active matrixpage with at least two layers exists in current project
    MatrixLayer ml = Project.ActiveLayer();
    if ( ml )
    {
        MatrixPage mp(ml.GetPage());
        MatrixLayer ml1 = mp.Layers(0);
        MatrixLayer ml2 = mp.Layers(1);
        if ( ml1 && ml2 )
        {
            MatrixObject moSrc(ml1, 0);
            if ( matobj_move(moSrc, ml2) )
                printf("Move MatrixObject to another layer successfully!");
            else
                printf("Fail to move MatrixObject");
        }
    }
}

Remark

See Also

Header to Included

origin.h

Reference