Glade Reference


label class

The label class is derived from a shape. This class is normally created in a cellView using the dbCreateLabel function.

 

char * name = l.theLabel()

Gets the label name

 

l.theLabel(char *name)

Sets the label name.

 

Rect box = l.bBox

Gets the bounding box of the label. Note that as a label does not have a 'real' bounding box - the box is approximately the size of the displayed text of the label.

 

l.bBox(Rect box)

Sets the label's bounding box. This is not used and will throw an exception if called.

 

double h = l.height()

Gets the label's height attribute

 

l.height(double h)

Sets the label's height

 

double w = l.width()

Gets the label's width

 

l.width(double w)

Sets the label's width. This is not used.

 

db_Orient o = l.orient()

Gets the label orientation.

 

l.orient(db_Orient o)

Sets the label orientation

 

Point p = l.origin()

Gets the label's origin

 

l.origin(int x, int y)

Sets the label's origin

 

l.origin(Point p)

Sets the label's origin

 

db_TextAlign a = l.align()

Gets the label's alignment.

 

l.align(db_TextAlign a)

Sets the label's alignment.

 

l.objType()

Get the object type (TEXT)

 

char *name = l.objName()

Gets the object name ("LABEL")

 

int dist = l.getNearestEdge(Point p, segment edge)

Gets the nearest edge of the label's bounding box to a Point p. The function returns the distance to the edge.

 

l.transform(dbTransform trans)

Transform a label by some transform trans.

 

l.Move(cellView *cv, Point delta, bool opt = True)

Moves a label by distance delta. If opt is True then the database is re-optimised for the new label position. If there are a lot of objects to move it makes sense to turn this off and instead use the cellView update() function after moving them all.

 

dbObj *obj = l.Copy(cellView *cv, Point delta, int layer=-1)

Copy the label to cellView cv, with offset delta. If layer is non-negative the label will be copied to the new layer.

 

dbObj *obj = l.Flatten(cellView *cv, dbTransform trans)

Flatten the label into cellView cv with some transform trans.

 

l.bias(int bias, double grid)

Bias the label. As the label is really just a point, this does nothing useful.

 

l.scale(double scale, double grid)

Scale the label. As the label is really just a point, this does nothing useful.

 

Contents|Index

Copyright © Peardrop Design 2016.