page_insert_label

 

Contents

Description

insert a text label to a graph layer

Syntax

bool page_insert_label( Layer & gl, const string & strLabel, LPCSTR lpcszName = NULL, int x = 10, int y = 5 )

Parameters

gl
the layer to insert the label
strLabel
the Label to be inserted
lpcszName
optional name of the label object. If given, and object already exited, will simply update the text, if name not given, new label will always be created
x
location in percent of layer bounding box, 0 = left, 100 = right
y
location in percent of layer bounding box, 0 = top, 100 = bottom

Return

Examples

EX1

void page_insert_label_ex1()
{
    GraphLayer gl = Project.ActiveLayer();
    string str = "Test";
    page_insert_label(gl, str);
    page_insert_label(gl, str, NULL, 10, 50); // call without name will create new one
    str = "Only One";
    page_insert_label(gl, str, "MyLabel", 20, 30);
    page_insert_label(gl, str, "MyLabel", 80, 30); // this sholuld be the final location
}

Remark

See Also

header to Include

origin.h

Reference