software products and customization
Contact: support@xuebrothers.net Home page

The OCNode Interface of ActiveOC


Methods

Add
Purpose: Add a child node
Arguments:
Return Value: OCNode object
Example:
var root=new ActiveXObject("ActiveOC.OCNode");
var a=root.Add();
Remove
Purpose: Remove a child node
Arguments: OCNode
Return Value:
Example:
var root=new ActiveXObject("ActiveOC.OCNode");
var a=root.Add();
root.Remove(a);
GetSubNode
Purpose: Retrieve a child node
Arguments: number (zero based index of the child node to retrieve)
Return Value: OCNode
Example:
var a=root.GetSubNode(0);
Save
Purpose: Save the tree to a string which can be used to restore the tree the Load method
Arguments:
Return Value: String
Example:
var s=root.Save();
Load
Purpose: Restore a tree that has been saved by the Save method
Arguments: String
Return Value: true(success)/false(failure)
Example:
var root=new ActiveXObject("ActiveOC.OCNode");
//reading the saved tree from a file or database to string s
root.Load(s);
SetProperty
Purpose: Store application specific information
Arguments: 1.name(string), 2.value(string)
Return Value:
Example:
var root=new ActiveXObject("ActiveOC.OCNode");
root.SetProperty("id", "12345");
GetProperty
Purpose: Retrieve what has been stored by the SetProperty method
Arguments: name(string)
Return Value: String
Example:
var id=root.GetProperty("id");
CleanUp
Purpose: Release children nodes and other resources
Arguments:
Return Value:
Example:
root.CleanUp();
CreateMatrix
Purpose: Convert the tree to 2-dim array OCMatrix
Arguments:
  • maxCols: maximum number of children nodes can be put in a row. The value must be zero or a number larger than 2. A none-zero value overrides the 'SubNodesHorizontal' property.
  • autoReorderSubNodes, true/false, allow ActiveOC to reorder children nodes for saving space. Ignored if maxCols is zero.
Return Value: OCMatrix
Example:
var mat=root.CreateMatrix(0, false);

Properties

SubNodesVisible
Type: true/false
Notes: Show / hide children nodes. If set to false, the children nodes will not be listed in OCMatrix
SubNodesHorizontal
Type: true/false
Notes: true = lay out children node horizontally; false = vertically
SubNodesCount
Type: number, read only
Notes: The number of children node
ImageName
Type: String, read only
Notes: May be empty or contains one or more characters from 'A' to 'Q' as defined by this picture: Image Name Convention
Parent
Type: OCNode
Notes: The parent object.
OuterLeft, OuterTop, OuterWidth, OuterHeight, InnerLeft, InnerTop, InnerWidth, InnerHeight
Type: number
Notes: Node Size and Positions

These properties describe positions and sizes of a node image as illustrated by picture on the right;

OCMatrix.CalculateLayout() must be called before reading these values correctly.

License
Type: String
Notes: License information about the current copy of ActiveOC.
LastError
Type: String
Notes: The information of last error. ActiveOC does not throw an exception when error occurs. Check this value when a method returns false or a value not expected.