2.2.4.25.1 Layout::Layout

Description

Constructor which constructs a Layout object given the name of a layout window. The object will be valid if the layout window with the given name exists.


Copy constructor which constructs a Layout object from an existing Layer object. The member function IsValid() of the base class OriginObject can be used to determine if the object is valid (attached to an internal Origin layout object).

Syntax

Layout( LPCSTR layoutname )


Layout( Layer & layer )

Parameters

layoutname
the name of a layout window in Origin


layer
[input] the source Layer object in a layout window

Return

Examples

EX1

//Construct a layout with syntax Layout( LPCSTR layoutname ).
void    Layout_Layout_ex1()
{
    LayoutPage lp;
    lp.Create("layout");
    
    Layout la(lp.GetName());
    // We can check if the object la is valid (attached to 
    // an internal Origin layout) by calling the method "IsValid)"
    if (la.IsValid())
        out_str("Object is valid");        // it should be valid
    else
        out_str("Object is not valid");    
}


EX2

//Construct a layout with syntax Layout( Layer & layer ).
void    Layout_Layout_ex2()
{
    LayoutPage lp;
    lp.Create("layout");
    
    // Create an attach a source Layout object:
    Layout    lay = Project.ActiveLayer();
    
    Layout    la(lay);
    
    // We can check if the object la is valid (attached to 
    // an internal Origin layout) by calling the method "IsValid)"
    if (la.IsValid())
        out_str("Object is valid");
    else
        out_str("Object is not valid");    // it should be invalid
}

Remark

See Also

Header to Include

origin.h