"setAlignment"

This function allows you to define an alignment for an item in a column within the tree widget.

Synopsis

void shape.setAlignment(string id, int column, string alignment);

Parameters

Parameter Description
id ID of the item.
column The addressed column.
alignment

The alignment which will be used for the item. Possible values are:

  • AlignNone
  • AlignLeft (AlignLeading)
  • AlignRight (AlignTrailing)
  • AlignHCenter
  • AlignTop
  • AlignBottom
  • AlignVCenter
  • AlignTop | AlignLeft
  • AlignTop | AlignHCenter
  • AlignTop | AlignRight
  • AlignVCenter | AlignLeft
  • AlignVCenter | AlignHCenter (AlignCenter)
  • AlignVCenter | AlignRight
  • AlignBottom | AlignLeft
  • AlignBottom | AlignHCenter
  • AlignBottom | AlignRight

Example

This example adds a column and three items to a tree and then sets an alignment for them.

main()
{
  TREE1.addColumn("B-----C-----A");
  TREE1.appendItem("","ADJ","A");
  TREE1.appendItem("","REG","B");
  TREE1.appendItem("","NO","C");
  this.setAlignment("ADJ",0,"AlignRight");
  this.setAlignment("REG",0,"AlignVCenter");
  this.setAlignment("NO",0,"AlignCenter");
  DebugN(this.getAlignment("ADJ",0));
  DebugN(this.getAlignment("REG",0));
  DebugN(this.getAlignment("NO",0));
}

The used alignments are retrieved with "getAlignment" and displayed in the logviewer:

WCCOAui1:["AlignRight|AlignTrailing"]
WCCOAui1:["AlignVCenter"]
WCCOAui1:["AlignCenter"]

Assignment

Tree Widget