2.2.4.37.7 PolyPolylineGraphObject::SetDrawOption


Description

Set polyline draw option.

Syntax

BOOL SetDrawOption( DWORD dwDrawOpt )

Parameters

dwDrawOpt
[input] if POLYPOLYLINE_DRAW_OPTION_NEED_TEXT it will show polyline number

Return

Returns TRUE on success and FALSE on error.

Examples

EX1

void SetDrawOption_ex1(bool bAdd)
{    
    GraphPage gp;
    gp.Create("origin");
    GraphLayer gl = gp.Layers(0);
    
    PolyPolylineGraphObject go;
    go = gl.CreateGraphObject(GROT_POLYPOLYGON, "PP");
    go.Attach = ATTACH_TO_SCALE;
    if(bAdd)
        go.SetDrawOption(POLYPOLYLINE_DRAW_OPTION_NEED_TEXT);
    
    vector<double> vx(4), vy(4); 
    int x1 = gl.X.From, x2 = gl.X.To;
    int y1 = gl.Y.From, y2 = gl.Y.To;
    vx[0] = vx[2] = x1 + (x2-x1) * 0.5;
    vx[1] = x1;
    vx[3] = x2;
    vy[0] = y1;
    vy[2] = y2;
    vy[1] = vy[3] = y1 + (y2-y1) * 0.5;;
    go.AddPolyline(vx, vy);
    
    Tree tr;
    tr.Root.Border.Color.nVal = SYSCOLOR_RED;
    tr.Root.Border.Width.dVal = 0.2;
    
    if(go.UpdateThemeIDs(tr.Root) == 0)
        go.ApplyFormat(tr, true, true);
}

Remark

See Also

PolyPolylineGraphObject::GetDrawOption

Header to Included

origin.h