Gets the text alignment mode.

syntaxSyntax:
DlxTable.GetCellAlignment(row, column, mode)

Parameters

Parameter Description
row Row index.
column Column index.
mode Specify which alignment. Enter one of the following values:
DlxApp.ALIGNMODE_ALL
DlxApp.ALIGNMODE_VERTICAL
DlxApp.ALIGNMODE_HORIZONTAL

Return Value

Returns the text alignment mode. Returns one of the following values:

Vertical
DlxApp.TEXTALIGN_TOP
DlxApp.TEXTALIGN_MIDDLE
DlxApp.TEXTALIGN_BASE
DlxApp.TEXTALIGN_BOTTOM
Horizontal
DlxApp.TEXTALIGN_LEFT
DlxApp.TEXTALIGN_CENTER
DlxApp.TEXTALIGN_RIGHT
DlxApp.TEXTALIGN_COMMA
DlxApp.TEXTALIGN_JUSTIFY

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 table = layer.DrawTable(new DlxRect(50,40,160,90), 4, 5);
      table.SetText(1, 0, "Hello World");

      var dlg = new DlxDialog(400, 110, "Alignment");
      if (dlg.IsValid())
      {
        dlg.AddStaticText(10, 33, 70, "Horizontal: ");
        var ctrl_cbl = dlg.AddComboBox(90, 30, 300);
        ctrl_cbl.AddString("Left", DlxApp.TEXTALIGN_LEFT, table.GetCellAlignment(1, 0, DlxApp.ALIGNMODE_HORIZONTAL)==DlxApp.TEXTALIGN_LEFT);
        ctrl_cbl.AddString("Center", DlxApp.TEXTALIGN_CENTER, table.GetCellAlignment(1, 0, DlxApp.ALIGNMODE_HORIZONTAL)==DlxApp.TEXTALIGN_CENTER);
        ctrl_cbl.AddString("Right", DlxApp.TEXTALIGN_RIGHT, table.GetCellAlignment(1, 0, DlxApp.ALIGNMODE_HORIZONTAL)==DlxApp.TEXTALIGN_RIGHT);
        dlg.AddOkButton(280, 70, 50, 25);
        dlg.AddCancelButton(340, 70, 50, 25);
        if (dlg.DoModal())
        {
          table.SetCellAlignment(ctrl_cbl.GetNumber(), DlxApp.ALIGNMODE_HORIZONTAL, 1, 0);
        }
      }
    }
  }
}

See also