Search
Item Placement

Measure unit

The MeasureUnit property specifies the unit of measure for all location and size -related values assigned to FlowChartX properties or passed as arguments to its methods.

Setting location of diagram nodes

Location and size of boxes and tables can be changed via several methods. Call SetRect to set the exact coordinates of the bounding rectangle of an object; that method allows you to both move and resize the object. The MoveTo method moves an object to the specified location without resizing it; the method arguments specify the new coordinates of the object's upper-left corner. To resize an object call SetSize, specifying new width and height as arguments. If object is moved or resized, all arrows connected to it are updated such as the arrows' ends stay linked with the object.

Resizing nodes to fit their contents

Calling the FitSizeToPicture method of a box or a table makes the size of the object the same as that of its Picture. Calling FitSizeToText resizes a box to ensure that all of its Text is visible. The ResizeToFitText method resizes the columns and rows of a table to show their text completely.

Arrows control points

Arrows have two or more control points, depending on their Style and number of Segments. The number of control points is returned by the read-only CtrlPtCount property. Their position can be set or get via the CtrlPtX and CtrlPtY indexed properties. You must call Update after moving control points of an arrow; that's needed in order to repaint the arrow and update its internal state variables. Another property of arrows, Dynamic, can be enabled to make the arrow automatically recalculate its end point positions if the nodes linked to the arrow are moved or resized; the end points are moved in such a way that the arrow points to the centers of the linked nodes.

Getting location

Getting the coordinates of box or table sides is done via the following properties:

Box.Left, Box.Top, Box.Right and Box.Bottom;

Table.Left, Table.Top, Table.Right and Table.Bottom;

Getting the four sides of the objects bounding rectangle:

Box.BoundingRect method;

Arrow.BoundingRect method;

Table.BoundingRect method;

Hit testing

Upon mouse click, FlowChartX performs hit testing to determine whether a diagram item should be selected. The order in which items are hit tested is specified via HitTestPriority. Some methods allow performing hit testing programmatically. Call GetBoxAt, GetTableAt, GetArrowAt or ObjectFromPoint to find out which item occupies a specified document location. To determine whether two nodes intersect, call NodesIntersect. To determine whether an arrow intersect a node, call the arrow's IntersectsNode method.

Z-order control

The Z-order defines how objects are ordered on the Z-axis - one looks above or below another. Following properties and methods manage the Z-order:

Box.ZIndex, Table.ZIndex and Arrow.ZIndex properties - sets / gets object Z-order position;

Box.ZBottom, Table.ZBottom and Arrow.ZBottom methods - place object at the bottom of the Z-order;

Box.ZLevelDown, Table.ZLevelDown and Arrow.ZLevelDown methods - move object one level down;

Box.ZLevelUp, Table.ZLevelUp and Arrow.ZLevelUp methods - move object one level up;

Box.ZTop, Table.ZTop and Arrow.ZTop methods - place box at top of the Z-order;