Constructs a DlxLeaderStyle object.

syntaxSyntax:
new DlxLeaderStyle()
new DlxLeaderStyle(name)
new DlxLeaderStyle(handle)
new DlxLeaderStyle(style)
new DlxLeaderStyle(penStyle, textStyle, shadowStyle, labelSizeX, labelSizeY, rounding, marginX, marginY, flags)

Parameters

Parameter Description
name A string containing the name of the style.
handle A string containing the handle of the style.
style A DlxLeaderStyle object from which to copy the style.
penStyle A DlxPenStyle object or a string containing the name or handle of the line style.
textStyle A DlxTextStyle object or a string containing the name or handle of the text style.
shadow A DlxShadowStyle object or a string containing the name or handle of the shadow style.
labelSizeX Specify the width of the label.
labelSizeY Specify the height of the label.
rounding Specifies the shape of the corners of the label body. A value of 0 produces a square label. The value 1 produces a round label.
marginX Specify the width of the horizontal margin.
marginY Specify the width of the vertical margin.
flags A string containing the handle of the style. Specify a combination of the following values:
DlxApp.LEADERSTYLEFLAGS_LABELCENTERED

Remarks

The style handle is a 27-character alphanumeric string and appears in the box at the bottom of the Style Manager dialog box.

Example

  Copy codeCopy code
var prj = DlxApp.GetJob().GetProject("Example Sch");
if (!prj.IsValid())
  prj = DlxApp.GetJob().NewProject("Example Sch");
var doc = prj.GetDocument("Examples Sch", DlxApp.DOCTYPE_SCHEMATIC);
if (!doc.IsValid())
{
  doc = prj.NewDocument("Examples Sch", DlxApp.DOCTYPE_SCHEMATIC);
  doc.SetPageFormat("A4", false);
}
if (doc.IsValid() && doc.Activate())
{
  var page = doc.GetActivePage();
  if (page.IsValid())
  {
    var layer = page.GetLayerFromType(DlxApp.LAYERTYPE_DRAWING);
    if (layer.IsValid())
    {
      var style = new DlxLeaderStyle(DlxApp.STYLE_DEFAULT);
      doc.SetStyle(style);
      var vertices = new Array();
      vertices[0] = new DlxPoint(30,30);
      vertices[1] = new DlxPoint(50,50);
      vertices[2] = new DlxPoint(70,50);
      layer.DrawLeader(vertices, "Hello, World.");     
    }
  }
}

See also