MatrixLayer::MatrixLayer

Description

Constructor for the MatrixLayer class


Construct a MatrixLayer from a Layer object

Syntax

MatrixLayer( const char * MatrixName )

MatrixLayer( Layer & layer )

Parameters

MatrixName
[input] name of the matrix

layer
[input] the worksheet that is currently selected or active

Return

Examples

EX1

//Construct one matrixlayer using the defalut matrix constructor. 
void MatrixLayer_MatrixLayer_Ex2()
{
    MatrixPage mp = Project.MatrixPages(0);
    if(!mp)
        return;
    
    MatrixLayer ml(mp.GetName());
    if( ml )
    {
        Matrix ma(ml);
        printf("Found matrix %s\n", ma.GetName());
    }
}


EX2

// Matrix should be the active window
void MatrixLayer_MatrixLayer_Ex3()
{
    MatrixLayer mlay(Project.ActiveLayer());
    if(!mlay)
    {
        out_str("The active layer is not a matrix, or there is nothing in the project");
    }
    else
        printf("Matrix %s has %d columns\n",mlay.GetPage().GetName(),mlay.GetNumCols());
}

Remark

MatrixLayer is one of the wrapper objects that is a reference to the actual internal Origin object.

You can construct a new MatrixLayer from another layer object. The MatrixLayer will become invalid if the layer to construct with is actually not an object of Matrix class in Origin.

See Also

header to Include

origin.h