GraphPage::ArrangeLayers

Description

Arrange layers in mxn configuration.

Syntax

int ArrangeLayers(ArrangeLayersInfo& info)

Parameters

ArrangeLayersInfo
[input]arrange settings
struct ArrangeLayersInfo
{
        // matrix geometry
        int                rows;
        int                cols;

        int*  indices;
        int                count;

        // % of page width
        int                leftMargin;
        int                rightMargin;
        int                hGap;
        int                hMin;           // min layer width

        // % of page height
        int                topMargin;
        int                bottomMargin;
        int                vGap;
        int                vMin;           // min layer height

        int                nRepeat;        // repeat count of calls to improve visual, typically 3 times is good enough
        int                threshold;      // LP (positive) or 0.01% of page width/height (negative) threshold to allow arranging layers, 0 to disable
        int                nFixFactor;     // zero do not fix layer scale factors, otherwise % (100 means current sizes)
        DWORD   dwCntrl;        // ALICNTRL
};

Return

Returns number of arranged layer on successful exit and < 0 on failure.

Examples

EX1

void ArrangeLayers_ex()
{
        GraphPage gp = Project.Pages();
        if( !gp )
                return;
        ArrangeLayersInfo ali = {0};
        ali.rows = 2;
        ali.cols = 2;
        ali.dwCntrl = ALIC_UNDO;
        ali.leftMargin = 5;
        ali.topMargin = 5;
        ali.rightMargin = 5;
        ali.bottomMargin = 5;
        ali.hGap = 3;
        ali.vGap = 3;
        gp.ArrangeLayers(ali);
}

Remark

See Also

Header to Include

origin.h