AddFlow

Welcome to AddFlow 5 and its extensions

AddFlow ActiveX control

LayoutFlow ActiveX controls

Free Extensions

For free support or purchasing information, see http://www.lassalle.com

AddFlow™. Copyright © 1997-2005 Lassalle Technologies. All rights reserved.


Installation

You can find the installation package at our web site or on some other web sites from authorized AddFlow distributors.
You have just to launch the setup program and follow the instructions given in the installation program.
The list of installed components is the following:

Component | Description | To be purchased? | Support provided? | Source provided?
AddFlow5.ocx | AddFlow ActiveX control | Yes | Yes | Can be purchased
XMLFlow.ocx | Load/Save a diagram in XML | No (1) | No | Yes (2)
PrnFlow5.ocx | Print/preview of AddFlow diagrams | No (1) | No | Yes (2)
HFlow2.ocx | Hierarchic layout algorithm | Yes (3) | Yes | Can be purchased
OFlow.ocx | Orthogonal layout algorithm | Yes (3) | Yes | Can be purchased
SFlow2.ocx | Symmetric layout algorithm | Yes (3) | Yes | Can be purchased
TFlow2.ocx | Tree layout algorithm | Yes (3) | Yes | Can be purchased

(1) XMLFlow and PrnFlow can be used freely.
(2) The source code (written in C++/MFC) of PrnFlow and XMLFlow is available free of charge for AddFlow 5 registered users.
(3) Included in the LayoutFlow license. (HFlow, SFlow, TFlow and OFlow cannot be purchased separately.)

Remarks

a) The setup program should register the ActiveX files. Anyway you can do it yourself with the regsrv32 tool program. For instance, to register AddFlow 5, the command is the following:

REGSVR32 ADDFLOW5.OCX.

b) The installation program may install the Microsoft shared DLLs used by ActiveX controls, if not already installed on your machine. Those DLLs are:

  • MFC42.DLL
  • MSVCRT.DLL
  • OLEPRO32.DLL

c) When you create and distribute applications that use AddFlow, you could install the ActiveX files in the same directory as the application.


Installation

License: Key points

· You can use the evaluation version of AddFlow and LayoutFlow only during a period of 60 days.

· The only difference between the evaluation and the full (purchased) version of AddFlow or LayoutFlow is that the registered version will stamp every application you compile so a nag screen (banner or dialog box) will not appear when your users run the applications.

· AddFlow and each component of LayoutFlow (HFlow, OFlow, SFlow, TFlow) are runtime royalty free.

· You do not have the right in any case to distribute the license files or divulge the license keys

· PrnFlow 5 and XMLFlow are free. No support is provided for these 2 extensions. However, the source code of PrnFlow and XMLFlow is available for the AddFlow 5 registered users.


License Agreement

License Agreement for Lassalle Technologies AddFlow ActiveX and LayoutFlow ActiveX

Important: Please Read Carefully

This is a legal License Agreement between you and Lassalle Technologies. Carefully read all the terms and conditions of this agreement prior to using this product. By using this product, you are agreeing to be bound by the following terms and conditions:

1. DEFINITIONS

a) the Software is one of the following softwares from Lassalle Technologies: AddFlow ActiveX and LayoutFlow ActiveX. LayoutFlow ActiveX is a set of several components: HFlow, OFlow, SFlow, TFlow.

b) the Free Extensions are the ocx files that are provided for free as AddFlow extensions, for instance XMLFlow and PrnFlow.

c) the Evaluation Version is the evaluation version of the Software. It displays a dialog box ("nag screen") indicating that it is an evaluation version.

d) the Redistributables are the OCX files provided in the Software.

e) the License Number is a kind of unlock key you obtain if you purchase a license of the Software. The Evaluation Version is turned into the full retail product by use of this electronic unlock key.

2. OWNERSHIP

The Software and accompanying written materials are owned by Lassalle Technologies and are protected by copyright law and international treaties. The Software is licensed, not sold. Therefore, you must treat the Software as copyrighted, proprietary material, and shall not use or copy the Software except as provided for in this License Agreement.

3. PERMITTED USES

a) The Software is licensed per individual developer. You may make copies on more than one computer, as long as the Software is used by the same developer. If you have purchased a "multi-pack" license, you may use a copy of the Software identified in the multi-pack on the number of computers associated with the multi-pack.

b) You have the royalty-free right to distribute the Redistributables as a runtime component in your executable applications.

c) You may use the Evaluation Version of the Software for up to 60 days for trials and design-time evaluation purposes only.

4. PROHIBITED USES

You may not, without the prior written permission of Lassalle Technologies:

a) reverse engineer, decompile, disassemble or unlock the Software or make any attempt to reconstruct or discover any source code or underlying algorithms of the Software.

b) transfer, rent, lease or sublicense the Software.

c) repackage the Software for sale as a competing product.

d) distribute the Software for use in design time. If you wish to distribute our components as part of a design environment, that requires a special OEM license and does involve the payment of royalties.

e) divulge the License Number. You agree to treat the License Number as strictly confidential except to Lassalle Technologies or your authorized AddFlow distributor and you have not the right to distribute the license file.

f) use or rely on the Evaluation Version for any business purpose, or any other purpose beyond evaluation of the Software.

5. SUPPORT

You have the right to a technical support via email for a period of 12 months from the date of purchase of the license. No support is provided for the Free Extensions. However, the C++ source code of the Free Extensions is available for AddFlow customers.

6. DISCLAIMER OF WARRANTY

THIS SOFTWARE AND THE ACCOMPANYING FILES ARE SOLD "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
Good data processing procedure dictates that any program be thoroughly tested with non-critical data before relying on it. The user must assume the entire risk of using the program.


Installation

License: How it works

  • When you install AddFlow, you install in fact an evaluation version of AddFlow. You install also an evaluation version of HFlow, OFlow, SFlow and TFlow.

  • If you generate ("compile") an application that uses this evaluation version of AddFlow, then any attempt to use this application will display a dialog box (nag screen) explaining that it has been generated only with an evaluation version of AddFlow (same thing for HFlow, OFlow, SFlow and TFlow).

  • To get a full version of AddFlow, you have to purchase an AddFlow license.
    To get a full version of HFlow, OFlow, SFlow and TFlow, you have to purchase a LayoutFlow license.

  • If you purchase a license of AddFlow or LayoutFlow, you will receive a license key (also called serial number or license number).

  • The LicenseManager.exe program, provided with AddFlow, allows generating a license file from this license key. It is created in the same directory as the LicenseManager application. The name of the AddFlow license file is addflow5.lic whereas HFlow, OFlow, SFlow and TFlow use the same license file: layoutflow.lic.

  • When developing your application, the license file must be in the same directory as the corresponding ocx file.


Technical support

Getting Support

You can receive technical support for our products from our web site or via email.

FAQ

This help file contains a FAQ and we suggest that you try that first before anything else.

Email

When contacting us, please provide the following information:

  • your AddFlow license number (indicated in the About box).
  • your AddFlow version number (indicated in the About box).
  • your working environment (operating system, development tool, etc).
  • a description of how to reproduce the problem.

Maintenance releases

Maintenance releases can be downloaded from our Internet Web site at http://www.lassalle.com/download.htm


AddFlow FAQ

Frequently asked questions

Questions

User Interface

  • Is it possible to select nodes and links with the mouse?
  • Is it possible to create "hot" spots (like hypertext) for the node? (tip)
  • How to set the MousePointer property for individual nodes? (tip)
  • How to transform mouse coordinates into AddFlow coordinates?
  • Can the creation of nodes/links be disabled from your control?
  • How to make a link start at the side of a node rather than at its center? (tip)
  • How to use AddFlow to draw a database diagram? (tip)
  • Is it possible to give a node a number of visual input points and output points? (tip)

Data Association and keys

  • How to associate application data to a node or a link?
  • How to store multiple values in Tag? (tip)
  • How to store an integer in the Key property? (tip)
  • How to perform a quick check on Nodes collection key? (tip)
  • How do I identify the node I wish to remove?

Saving/Loading

  • What is the difference between the SaveImage and the SaveFile methods?
  • How to save an AddFlow diagram in a Database?
  • How to save the BackPicture with the SaveFile method? (tip)
  • How to save an AddFlow diagram in a bitmap? (tip)

Printing

  • I want to print a diagram but I can’t see any AddFlow method for that. Why?
  • To print AddFlow diagrams, should I use VSView or PrnFlow?

Collection

  • Why there is not the equivalent of the Nodes collection for the links?

Grouping

  • Can a node contain other nodes?
  • How to implement new shapes, for instance UML shapes?
  • How to implement a moving label for a node or a link (tip)

Limits

  • Is there a maximum number of nodes and links that can be created?
  • Is there some drawing limits for an AddFlow diagram?

Compatibility

  • Under what development tools has AddFlow been tested?
  • Can AddFlow be used under .NET ?
  • How to associate a picture to a node under .NET ?
  • Under .NET, how to set the FillColor property for a node?

Internet

  • How to use AddFlow in a web page?
  • Is AddFlow digitally signed?

C++

  • How to use the ExportPicture method in VC++ ?

Installation

  • I have installed a licensed copy but the nag screen is keeping on appearing. Why?
  • What shared DLLs are required for AddFlow to work?

General

  • How is the license policy for AddFlow?
  • Is AddFlow royalty-free?
  • What programming language is used to develop AddFlow?
  • Can I purchase the source code of AddFlow?

Known problems

  • Tooltips and wrapping control
  • Scrollbars and FoxPro
  • Node does not resize when its font is changed

Graph Layout ActiveX Controls

  • What is a graph layout?
  • Can we use HFlow, OFlow, SFlow or TFlow without AddFlow?
  • Are HFlow, OFlow, SFlow, TFlow runtime royalty free?
  • Does HFlow find the optimum solution?
  • How to keep the link styles during the layout? (tip)
  • How to call the Layout method?

Answers

Is it possible to select nodes and links with the mouse?

You can select several objects (nodes or links) by clicking them with the mouse and simultaneously pressing the shift or control key.
But you can also select objects by drawing a rectangle with the mouse and then selecting everything that falls within the rectangle.
For doing that you have to enter in selection mode with the SelectMode property.
This is demonstrated in the Editor sample (and also in the Demo sample): pulldown menu "Edit" and menu item "Select Mode".

Is it possible to create "hot" spots (like hypertext) for the node? (tip)

It is possible to create HotSpot with the PointedNode and PointedLink properties. These properties return the object pointed by the mouse. This is illustrated in the following VB6 sample:
http://www.lassalle.com/download/complex.zip

How to set the MousePointer property for individual nodes? (tip)

You can add such a feature using the PointedNode and MousePointer properties. For instance, in the following VB code portion, we decide that if there is a pointed node and if its UserData property is 1, then the mouse pointer is a cross, otherwise it is the default cursor. (Instead of using UserData, we could also use the Key or the Tag property)

Private Sub AddFlow1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  With AddFlow1
    If .PointedNode Is Nothing Then
      .MousePointer = afDefault
    Else
      If .PointedNode.UserData = 1 Then
        .MousePointer = afCross
      Else
        .MousePointer = afDefault
      End If
    End If
  End With
End Sub

How to transform mouse coordinates into AddFlow coordinates?

You have to take account of the scroll position and the zoom factor. Under VB, you may write:

xLog = (x * 100 / AddFlow1.xZoom) + AddFlow1.xScroll
yLog = (y * 100 / AddFlow1.yZoom) + AddFlow1.yScroll

Under VC++, you will need before to convert pixels to twips.

Can the creation of nodes/links be disabled from your control?

Yes, it can be disabled with the CanDrawNode and CanDrawLink properties. If for instance, CanDrawNode is false, then the user cannot create a node interactively with the mouse. But the creation of a node is still possible programmaticaly, under your control.

How to make a link start at the side of a node rather than at its center? (tip)

When receiving the
        MouseUp event, you may set the AdjustOrg and AdjustDst
        properties and adjust the first and last points of the
        link you are creating:

Private Sub
        AddFlow1_MouseUp(Button As Integer, Shift As Integer, x
        As Single, y As Single)
Dim link As afLink
Dim pt As afLinkPoint
Dim Action As Long
Action =
        AddFlow1.LastUserAction()
If Action = afLinkCreation Then
Set link =
            AddFlow1.SelectedLink

link.AdjustOrg = True
Set pt = link.ExtraPoints.Item(0)
pt.x = link.Org.Left + link.Org.Width
pt.y = link.Org.Top + link.Org.Height / 2
Set link.ExtraPoints.Item(0) = pt

link.AdjustDst = True
Set pt = link.ExtraPoints.Item(1)
pt.x = link.Dst.Left
pt.y = link.Dst.Top + link.Dst.Height / 2
Set link.ExtraPoints.Item(1) = pt
End If
End Sub

How to use AddFlow to draw a database diagram? (tip)

This is illustrated in the "table" VB6 sample provided with AddFlow.

Is it possible to give a node a number of visual input points and output points? (tip)

This is illustrated in the following VB6 sample:
http://www.lassalle.com/download/pins.zip

How to associate data to a node or a link?

Following properties allow associating user data to a node or a link:

  • UserData: this property allows associating a numeric (long integer) value to a node or a link.
  • Tag: this property allows associating a string to a node or a link.
    This string may be a comment, a help tip, an URL or anything you need for your application.
  • Marked: this property allows associating a flag to a node or a link. This flag may be used with the DeleteMarked method. But you can also use this flag for your own purpose.
  • Key: this property allows associating a unique key to a node or a link.
    This key can be used to identify a node or a link.
  • VariantTag: this property allows associating an object to a node or a link.

How to store multiple values in Tag? (tip)

(This is a tip I have found in the 101 Tech Tips, 11th Edition of Visual basic Programmer's Journal. This tip shows you how to store multiple values in the Tag property. Of course, this tip can be used in other context than AddFlow. However, it is very useful if you need to associate multiple values to a node or a link. You have just to use the Tag property of the node or the link.)

It would often be convenient to store multiple values in the Tag property. Here are two simple functions that help you do that. The first function stores the value in the control’s Tag, tagging the new value with a key value of your choice:

Public Function SetTag(ctl As Control, ByVal  Key As String, NewValue As String) As String
  Dim myArry() As String
  Dim i As Integer, k As Integer
  Dim yTag As String, yValue As String

  k = -1
  Key = UCase$(Key)
  If ctl.Tag = "" Then
     ctl.Tag = ctl.Tag & "|" & Key & "=" & NewValue
  Else
     myArry = Split(ctl.Tag, "|")
     For i = LBound(myArry) To UBound(myArry)
       If UCase$(Left$(myArry(i), Len(Key))) = Key Then k = i
     Next
     If k > -1 Then
       myArry(k) = Key & "=" & NewValue
       ctl.Tag = Join(myArry, "|")
     Else
       ctl.Tag = ctl.Tag & "|" & Key & "=" & NewValue
     End If
  End If
  SetTag = ctl.Tag
End Function

You can store the Tag value easily using a statement like this:

Call SetTag(myCtrl, "ID", LoginID)

A complementary function allows you to retrieve the stored value:

Public Function GetTag(ctl As Control, Key As String) As String
  Dim myArry() As String,
  Dim i As Integer, k As Integer
  Dim yPoze As String, yValue As String

  k = -1
  If ctl.Tag = "" Then
     yValue = ""
  Else
     myArry = Split(ctl.Tag, "|")
     For i = LBound(myArry) To UBound(myArry)
       If UCase$(Left$(myArry(i), Len(Key))) = UCase$(Key) Then k = i
     Next i
     If k > -1 Then
       yPoze = InStr(myArry(k), "=")
       yValue = Mid$(myArry(k), yPoze + 1)
     Else
       yValue = ""
     End If
  End If
  GetTag = yValue
End Function

You can retrieve the code using a statement like this:

LoginID = GetTag(myCtrl, "ID")

As written, these functions are case-insensitive with the key names. If you want case-sensitive key values, remove all UCase calls.

—Enrico Di Cesare, Arese, Italy

How to store an integer in the Key property? (tip)

The Key property cannot be a pure number because in such a case, it is considered as an index. There is the same constraint with the TreeView or ListView controls. Anyway, you have a solution if you need to have a numeric key: append for instance the string "key" to your numeric key and use the Val function to retrieve its value.

Dim lKey as long
lKey = 5
node.Key = Str$(lKey ) & "key"
To retrieve the key:

lKey = Val(node.Key)

How to perform a quick check on Nodes collection key? (tip)

If you need to determine whether a certain key is in the collection of nodes, you may use this function:

Public Function IsKeyInNodesCollection(AddFlow1 As Control, sKey As String) As Boolean
  Dim node As afNode

  On Error Resume Next
  Set node = AddFlow1.Nodes(sKey)
  IsKeyInNodesCollection = (Err.Number = 0)
End Function

How do I identify the node I wish to remove?

You can identify a node by its index or by its key.
A node has allways an index (Index property) which is in fact its position in the Nodes collection. For instance, if you create 3 nodes A, B and C, the index of C is 3. If you delete B, then the index of C becomes 2.
You can identify a node with its key (Key property) which is a unique string that can be associated to a node. To use a key, you have to associate a unique string to each node you create. For instance, you associate respectively "keyA", "keyB" and "keyC" to nodes A, B and C.
To remove the node, you can use the Remove method of the Nodes collection. The Remove method accepts either an index or a key. For instance, to remove node B:

AddFlow1.Nodes.Remove 2
or
AddFlow1.Nodes.Remove "keyB"

What is the difference between the SaveImage and the SaveFile methods?

The SaveImage method allows saving an image of the diagram, not the diagram itself.
It is not a reversible action. You cannot reload this image to display the diagram in an AddFlow control.
But you can reload this image with a software able to load and display metafiles (standard or enhanced) pictures.
The SaveImage method allows also copying the diagram to the clipboard.
How to save a diagram and reload it? AddFlow offers 2 methods for that purpose: SaveFile and LoadFile.
SaveFile save all the diagram (including, text, pictures, fonts, user data) in a file and LoadFile allows reloading it.
You can also save and load your diagram using XML with the ActiveX control XMLFlow.OCX provided with AddFlow 5.

How to save an AddFlow diagram in a Database?

You may save the diagram in a file (SaveFile method) and then save this file in a binary field of a table.
Or you may save each property value of each node and links. You have to retrieve all the property values of each node of the Nodes collection and for each node, retrieve all the property values of each link of the OutLinks collection of the node.

How to save the BackPicture with the SaveFile method? (tip)

The properties attached to the control are not saved with SaveFile. Only nodes and links properties are saved. If you need to save some control properties (like BackPicture, BackColor, xGrid, yGrid, with the diagram, then you may use the following tip. Just before saving the diagram in a file, create a hidden node with the following property assignment:

Dim diagramNode As afNode
‘ Create a node used to store Control informations
‘ The position and size of the node are not important
Set diagramNode = AddFlow1.Nodes.Add(0, 0, 100, 100)
diagramNode.Hidden = True
Set diagramNode.Picture = AddFlow1.BackPicture
diagramNode.Key = "Diagram"
‘ Save the file
AddFlow1.SaveFile FileName

When loading the file, we check the "diagram" node and we do the opposite action.: affecting to the control the properties of the node.Then we remove the diagram node:

‘ Load the file
AddFlow1.LoadFile FileName
‘ Find the "diagram" node
Dim diagramNode As afNode
Set diagramNode = AddFlow1.Nodes.Item("Diagram")
‘ Assign the node picture to the control BackPicture
Set AddFlow1.BackPicture = diagramNode.Picture
‘ Delete the "diagram" node
AddFlow1.Nodes.Remove "Diagram"

How to save an AddFlow diagram in a bitmap? (tip)

AddFlow allows you to export a diagram in a metafile. To save it in a bitmap, you can use a Picture box.

Dim pic As IPictureDisp
Set pic = AddFlow1.ExportPicture(afAllItems, False, False)
Picture1.Picture = pic
SavePicture Picture1.Image, "image.bmp"

Can a node contain other nodes?

A node cannot be a container for other nodes but anyway, you can emulate such a behaviour with the Rigid property.
This property allows defining a kind of ownership between 2 nodes. If there is a rigid link from node A to node B, then if the user drags A, B follows it.
We may say that A owns B. When an owner node is moved, all its owned nodes are also moved. (see help file)

How to create new flowchart shapes, for instance UML shapes?

There are 3 methods.

First method: using custom shapes

see Custom shapes

Second method: using metafiles

You can create new shapes with the Picture property. You can associate a picture to a node and this picture may be a metafile (standard or enhanced). If you use a transparent rectangular node:

            node.Shape =
            afRectangle
node.DrawStyle = afTransparent
node.Transparent = True
Set node.Picture = LoadPicture("xxx.wmf")

then the shape of this picture will be the metafile itself.

Third method: using Rigid property

If you create a link from node A to node B and if the Rigid property of this link is True, then if you move the node A, then the node B will follow it. Now you can symetrically create a rigid link from B to A and now, A and B move together as if they were 2 parts of the same object. You can emphasize that effect by making the rigid links hidden and not selectable. The VB Editor sample illustrates this nodes grouping ("Group" item menu in the "Edit" pulldown menu).
This is also illustrated in the "tables" sample provided with AdDFlow and also in the following VB6 samples:
http://www.lassalle.com/download/pins.zip
http://www.lassalle.com/download/complex.zip

How to implement a moving label for a node or a link?

Use a transparent node containing the text. You may try the little program Labels (written in VB6, provided in the installation package) to see how to do that.

I want to print a diagram but I can’t see any AddFlow method for that. Why?

This is because this task printing is accomplished by another ActiveX control which can be VSView (from VideoSoft) or PrnFlow (from Lassalle Technologies).

To print AddFlow diagrams, should I use VSView or PrnFlow?

First of all, it depends on your programming environment. For instance, if you use Delphi, then you cannot use VSView. In fact, PrnFlow has been created for Delphi users. However it can be used also under VB or VC++.
Another element of decision is the price: PrnFlow is free for AddFlow registered users whereas you have to purchase VSView.
Finaly, it depends also of your printing requirements: PrnFlow is a small ActiveX control, just dedicated to AddFlow diagrams printing. VSView is more powerful and it can be used in other context than AddFlow diagrams.
And finally, there is another element of decision: the source code of PrnFlow 5, which works with AddFlow 5, is available free of charge for AddFlow registered users.

Why there is not the equivalent of the Nodes collection for the links?

There is not a Links collection. To access all the links, you have to access all nodes and for each node, access all links of its InLinks or OutLinks collection. For instance:

Dim node as afNode, link as afLink

For Each node In AddFlow1.Nodes
  For Each link In node.OutLinks
    link.DrawColor = vbRed
  Next
Next

Is there a maximum number of nodes and links that can be created?

There is no maximum for the number of nodes or links. You can create a diagram with 30000 nodes and links if you need (a powerful processor is necessary in this case).

Is there some drawing limits for an AddFlow diagram?

If your diagram is too big, you may receive a "outside allowed area" error message. The drawing limits depend on the operating system:
Under Windows 95 or Windows 98, coordinates are restricted to 0 to 32767 pixels (*). This is in fact an operating system limit: under Windows 95 or 98, coordinate values are restricted to -32 768 to 32 767. Although coordinates values appear to be 32-bit values, only the lower 16 bits are used in W95 or W98.
Under Windows NT or Windows 2000, the full 32-bit values are used. Therefore in that case, the limitation disappears. However, note that this is true only with AddFlow release 3.00.021 or higher.

(*) Under VB, you may use the methods Screen.TwipsPerPixelX and Screen.TwipsPerPixelY.to convert pixels in twips.

Under what development tools has AddFlow been tested?

AddFlow has been tested under Visual Basic (VB5, VB6, VB.NET), Visual C++ (versions 5 and 6), Delphi (versions 3, 4 and 5) and IE5.
VB, VC++ and Delphi samples are provided in the AddFlow installation package.
If you project to use AddFlow with another development tool, then you should be very careful and make all the needed tests before purchasing the control.

Can AddFlow be used under .NET?

Yes, it is possible to use AddFlow as a COM component in the .NET environment.

How to associate a picture to a node under .NET?

Add a reference to the Microsoft.VisualBasic.Compatibility.dll assembly. In that you will find the following functions that allow converting from stdPicture to a .Net image object and vice versa:
Microsoft.VisualBasic.Compatibility.VB6.Support.IPictureToImage()
Microsoft.VisualBasic.Compatibility.VB6.Support.ImageToIPicture()

For instance:

node.Picture = Microsoft.VisualBasic.Compatibility.VB6.Support.ImageToIPicture(PictureBox1.Image)

Under .NET, how to set the FillColor property for a node?

node.FillColor = System.Convert.ToUInt32(RGB(0, 255, 0))

How to use AddFlow in a web page?

AddFlow can be incorporated in a web page. Your HTML code needs to reference the control as an object. The CODEBASE tag tells the browser where to find the control. You can use a CAB file here.
Since you can't distribute the license file, you need to create a run-time license using LPK_TOOL.
See the "Internet application" topic in the help file for more informations.

Is AddFlow digitally signed?

Yes AddFlow is digitally signed, using Microsoft Authenticode technology and Verisign as the certifying authority.

How to use the ExportPicture method in VC++ ?

For instance, the following portion of code copies the picture to the clipboard.

void
    CAfEditView::OnEditExportaspicture()
{
if (OpenClipboard())
{
CPicture pic =
    m_AddFlow.ExportPicture(0, false, false);

// Obtain an IPicture pointer
IPicture *iPict = NULL;
pic.m_lpDispatch->QueryInterface(IID_IPicture, (void
    **)&iPict);

// Obtain the GDI handle
HENHMETAFILE hEmf = NULL;
OLE_HANDLE* pHandle = (OLE_HANDLE*)&hEmf;
iPict->get_Handle(pHandle);

// Copy the enhanced metafile to the clipboard
if (hEmf)
{
EmptyClipboard();
SetClipboardData(CF_ENHMETAFILE, hEmf);
CloseClipboard();
}
}
}

I have installed a licensed AddFlow version but the nag screen is keeping on appearing. Why?

First remark:
Even if you have installed a licensed version of AddFlow, the executables that have been created before with the evaluation version, will keep on displaying a nag screen. To remove the nag screen, you have to regenerate them with the licensed version.

Remark if you use VC++:
If your development environment is VC++, then there are two cases to consider:
- if you use AddFlow in a dialog box, then, with the Resource editor, you should remove the AddFlow control and place a new AddFlow control again (for each window dialog box AddFlow).
- if you use AddFlow in a view, see the Microsoft KnowledgeBase Q151771 and see the CAfEditView::OnCreate function if the afEditView.cpp module of the C++ afEdit sample provided with AddFlow.

Remark if you use AddFlow in IE5:
To avoid the license nag screen, see the AddFlow help file: click on "Tutorial" then on "Internet Application" and read the "License File" paragraph.

If the previous remarks do not help you, then we suggest:
- uninstall AddFlow,
- remove all addflow5.ocx and addflow5.lic files from your PC.
- reinstall AddFlow again (do not forget to enter your AddFlow serial number)
Then you should check that:
- the license file addflow5.lic has been created in your windows\system directory.
- the ocx file (addflow5.ocx) is in the same directory as the license file.
- the ocx file has been registered by the installation program.
If it is not the case, you can do that yourself with the following command:
REGSVR32 ADDFLOW5.OCX

And finaly, your problem may be also due to a corrupted serial number. In such a case, you may email us.

What shared DLLs are required for AddFlow to work?

AddFlow is a MFC (Microsoft Foundation Class) based ActiveX control, compiled with Microsoft VC++ 6.0.
It requires the 3 following Microsoft shared DLLs:
- MFC42.DLL
- MSVCRT.DLL
- OLEPRO32.DLL
Those 3 DLLs are provided in the AddFlow installation package.

How is the license policy for AddFlow?

One license per developer machine is required.

Is AddFlow royalty-free?

AddFlow is runtime royalty-free. If you purchase the product, you will have the royalty-free right to distribute executable applications that use AddFlow as a runtime component.
See the ADDFLOW ACTIVEX CONTROL LICENSE AGREEMENT in the help file for more informations.

What programming language is used to develop AddFlow?

AddFlow has been developed in C++ with the Microsoft Foundation Class (MFC). The versions 5 has been generated with Microsoft Visual C++ 6.0.

Can I purchase the source code of AddFlow?

Yes you can. Email us if you are interested.

Tooltips and wrapping control

A tooltip attached to a node or a link will not be displayed over an AddFlow control that is wrapped inside another ActiveX control. In such a case, the tooltip is displayed behind the control. This is not an AddFlow bug: this bug can be reproduced with a small dummy ocx created with the VC6 ActiveX control wizard.
There is a workaround. It uses the TooTipText property of the AddFlow control (this property is added by VB). In the wrapping control, you have first to set the ShowToolTip property to false.
Then, in the MouseUp event, you add the following code:

With mAddFlow
 .ToolTipText = ""
 If .PointedNode Is Nothing And .PointedLink Is Nothing Then
  ' Nothing to do
 ElseIf .PointedLink Is Nothing Then
  .ToolTipText = .PointedNode.ToolTip
 Else
  .ToolTipText = .PointedLink.ToolTip
 End If
End With

Scrollbars and FoxPro

If you use an AddFlow control is used inside a FoxPro application, you may a problem with scrollbars: if you click on the scrollbar with the left button, and then release the mouse button, the control is keeping on scroling and you have to click again to stop the scrolling.
If you face this problem, email us and we will send you a special version of AddFlow that fixes the problem (which occurs only in the FoxPro environment).

Node does not resize when its font is changed

If the AutoSize property of the node is set to afAdjustNodeSizetoText and if you change the font of the node (thereby changing the text size) the node does not resize automatically.

There is a workaround: each time you change the font of a node, change also the Autosize property as follows:

node.Font.Size = 16
node.AutoSize = afNoAutoSize
node.AutoSize = afAdjustNodeSizetoText

What is a graph layout?

The primary purpose of those tools is to offer a way to display graphs or flow charts in a reasonable manner, following some aesthetic rules.

Can we use HFlow, OFlow, SFlow or TFlow without AddFlow?

Currently, HFlow, OFlow, SFlow and TFlow are AddFlow extensions and you cannot use them without AddFlow. Typically, you can first create your nodes and links inside AddFlow, using the AddFlow API, giving each node a random or a (0,0) position. Then you call the layout method of the graph layout control of your choice. This method will position the nodes and the links in a reasonable manner in the AddFlow control, following some aesthetic rules that depend on the choosen control (hierarchical with HFlow, symmetric with SFlow, orthogonal with OFlow...)
If you just want to perform a layout on a graph without displaying them in an AddFlow control (for instance because you have already a way to display the diagram), then you can use both a hidden AddFlow control and the graph layout control, for instance HFlow, to do that. In such a case, AddFlow is just used to store the logical structure of the graph and to retrieve via its API, the resulting positions of its nodes and links.

Are HFlow, OFlow, SFlow, TFlow runtime royalty free?

Yes. As AddFlow.

How to keep the link styles during the layout? (tip)

The link styles are lost during the layout. For instance, if the link Style is afVHF (3 segments vertical, horizontal, vertical) before the layout, it will be afPolyline after. This is a side effect of our Graph Layout ActiveX Controls HFlow, OFlow, SFlow and TFlow. To avoid it, you have to save those link styles before the execution of the layout, then restore them. For instance, you can store them in the UserData property:

Dim node As afNode, link As afLink

' SAVE LINK STYLES
For Each node In AddFlow1.Nodes
  For Each link In node.OutLinks
    link.UserData = link.LinkStyle
  Next
Next

' EXECUTE THE LAYOUT
On Error Resume Next
TFlow1.LayerDistance = 1000
TFlow1.Layout AddFlow1
If Err.Number <> 0 Then MsgBox Err.Description

' RESTORE LINK STYLES
For Each node In AddFlow1.Nodes
  For Each link In node.OutLinks
    link.LinkStyle = link.UserData
  Next
Next

How to call the Layout method?

in a VB Program

HFlow1.Layout AddFlow1

in a VC++ Program

LPUNKNOWN pUnk =
    m_AddFlow.GetControlUnknown();
IDispatch *pDispatch = NULL;
HRESULT hr = pUnk->QueryInterface(IID_IDispatch, (void**)&pDispatch);
pUnk->Release();
if (pDispatch)
m_HFlow.Layout(pDispatch);

in a Delphi Program

HFlow1.Layout(AddFlow1.ControlInterface);

in a C++ Builder program

HFlow1->Layout(AddFlow1->OleObject);

in an Access program

HFlow1.Layout AddFlow1.Object

Does HFlow find the optimum solution?

No it does not. It just produces a reasonable solution, not the optimum solution. It is the same thing for SFlow or OFlow. Only TFlow provides optimum solutions but it works only with trees.


What is AddFlow?

AddFlow is a general purpose Flowcharting/Diagramming ActiveX control.

Each time you need to graphically display data, you should consider using AddFlow:

  • workflow diagrams
  • database diagrams
  • communication networks
  • organizational charts
  • process flows
  • state transitions diagrams
  • CTI applications
  • expert systems
  • graph theory
  • quality control diagrams
  • ...

Short description

AddFlow is an ActiveX control that lets you quickly build flowchart-enabled applications. Features such as distinct colors, fonts, shapes, styles, pictures, text, and so on for each object of the diagram (node or link) are available. Nodes stay connected when moved. Metafiles support, serialization, printing, undo/redo, zooming, Bezier curves, reflexive links, multiselection, scrolling, user data association, navigation in the graph, custom shapes. Runtime distribution is royalty free.

AddFlow provides two ways to build diagrams:

  1. interactive way. AddFlow lets you create a diagram interactively without programming any line of code. Moreover, AddFlow provides support for saving, loading, cutting, pasting and printing diagrams. And it provides also a very powerful multi-level undo/redo feature.
  2. programmatic way. The AddFlow API (Application Programmatic Interface), based upon OLE automation and collections, is very easy to use. It is a set of properties, events and methods that allow manipulating Node and Link objects and to customize your application.

Environments

AddFlow can be used in many environments such as Microsoft's Visual Basic, Visual C++, Access, Internet Explorer, Inprise's Delphi, C++ Builder and other environments capable of hosting ActiveX controls. Note however that we provide technical support only for the following environments: Visual Basic, Visual C++, Internet Explorer, and Delphi.


AddFlow features

AddFlow is an ActiveX control. It has been written with Visual C++ 6.0 and it is a MFC (Microsoft Foundation Class) based ActiveX control.

An AddFlow diagram is a set of objects that can be linked each other. The objects are called nodes and the lines that connect objects are called links.

Following is a list of the main AddFlow features. Note that all those features are encapsulated in a small (370 Ko only), robust, fast and easy to use ActiveX control.

General

  • Runtime-royalty free
  • Digitally signed
  • Interactive and programmatic drawings
  • Navigation (You can access every nodes and links of a diagram with just 5 properties).
  • Collections support (nodes, links, selected nodes, selected links)
  • Customization: many properties allowing customizing the control (CanDrawNode, CanMoveNode, ReadOnly, etc...)

Input/output

  • Metafiles support (WMF, EMF)
  • Serialization of diagrams
  • Clipboard management
  • Printing and print previewing

Interactivity

  • Scrolling
  • Autoscrolling
  • Selection and Multiselection of nodes and links.
  • Nodes stay connected when moved or resized.
  • Object property pages available at runtime
  • Multi-level Undo/Redo
  • Link autorouting
Display facilities
  • Back picture
  • Zooming
  • Grid support (ShowGrid, SnapToGrid, GridColor, GridStyle, xGrid, yGrid properties)
  • OwnerDraw events

Data

  • Ability to associate a text, a unique key, a tooltip and a tag or a variant to a node or a link.

Nodes and links

  • Change painting order of objects (ZOrderIndex property)
  • Distinct colors for each object (FillColor, ForeColor, DrawColor)
  • Distinct fonts for each object
  • Distinct drawing styles (DrawStyle property)
  • Hidden objects

Links

  • Stretchable links. A link can be composed of many segments.
  • Curved links (Bezier curves and Cubic Spline curves)
  • Rigid links. If a link is rigid, it follows (without being stretched) its origin node when this origin node is being dragged.
  • Reflexive links
  • Links having only vertical and horizontal segments
  • Ability to adjust the position of the first and last point of a link
  • 20 arrow styles for links
  • Jumps displayed at the intersection of links.
  • Rounded corners for polyline links

Nodes

  • Ability to associate a picture (bitmap, EMF, WMF, icon, GIF, JPEG) to a node
  • 46 distinct shapes for nodes
  • Custom shapes
  • Shadow
  • Transparent nodes
  • Text alignment
  • Autosize options for nodes
  • Gradient color


Compatibility

AddFlow 5 is fully compatible with AddFlow 3 and AddFlow 4 on a source-code level.

The files created with AddFlow 3 and AddFlow 4 (with the SaveFile method) can be read with AddFlow 5.

Most of the changes made consist of new properties, events, methods, and settings to existing properties. These changes do not affect your existing code.


Enhancements

AddFlow 5 enhancements

AddFlow 5 offers the following new features.

  • Custom shapes
  • Custom drawing with OwnerDraw events
  • Link autorouting
  • Gradient color for nodes
  • Rounded corners for polyline links
  • JumpSize and RoundCornerSize properties allowing selecting the size of the link jumps and link rounded corners.
  • CanChangeOrg and CanChangeDst properties
  • UndoNode, RedoNode, UndoLink, RedoLink properties
  • BeforeChangeOrg and BeforeChangeDst events
  • XMLFlow.ocx: a ocx control allowing loading/saving diagrams in XML. The C++ source code of XMLFlow is available for AddFlow customers.
  • PrnFlow5.ocx: a new version of PrnFlow, a control allowing the printing and the previewing of the AddFlow diagrams. The C++ source code of PrnFlow is available for AddFlow customers.
  • OFlow.ocx: an orthogonal graph layout control. It is a part of LayoutFlow, the set of AddFlow graph autolayout ActiveX controls: HFlow, OFlow, SFlow, TFlow.


Quick Start under Visual Basic

In order to add the AddFlow ActiveX control in your project, follow these steps:

  1. install AddFlow in your system by running its setup program
  2. start Visual Basic and create a new Visual basic project or open an existing one.
  3. right click over the Toolbox and choose the Components… option in the popup menu (another way to do that is to select the menu item Components... from the Visual Basic's Project menu.)
  4. search Lassalle AddFlow 5 ActiveX Control in the list of the available controls and select the corresponding checkbox
  5. click OK to leave the "Components..." dialog. This causes the AddFlow icon [image] to appear in the toolbox.
  6. click on this icon and drag an AddFlow control from the toolbox to your form.
  7. you can now modify the properties of this control with the Visual basic Properties Window (press F4 if it is not visible).
  8. you can run the program by selecting Start from the Run menu (or press F5).
  9. without any programmation, you can already draw interactively a full diagram:
    • create nodes
    • create links between nodes
    • change each property of each node or each link (it is necessary that the ShowPropertyPages property is set to "afShowAll")


Visual C

Visual C++ environment

AddFlow can be used under Visual C++. For instance, let us build a SDI application using AddFlow.

  1. Start Visual C++.
  2. Select New from the File Menu.
  3. On the New dialog, click the Projects tab and select MFC AppWizard (exe).
  4. In the Project Name edit box, type the name for your application (for instance Edit)
    Click ok.
  5. On the Step 1 dialog of the AppWizard, click the Single document radio button.
    Click Next.
  6. Click Next on the Step 2, Step 3, Step 4, step 5.
  7. Click Finish and click Ok in the New Project Information dialog box.
  8. In the Project pulldown menu, activate the Add to project... item menu and the Component and controls... submenu. The Components And Controls Gallery dialog will appear.
  9. Double-click the Registered ActiveX Controls folder.
    Select AddFlow 5 ActiveX Control from the list.
  10. Click Insert.
    Click Ok when prompted Insert this component?
    Click Ok on the Confirm Classes dialog to insert the AddFlow classes in your application.
    Click Close.
  11. In the View pulldown menu, activate the Class Wizard... item menu.
  12. In the MFC Class Wizard dialog box, make sure that Message maps tab is selected and that the CEditView class (if your application name is Edit) is selected in the Class name list box.
  13. In the Messages list, double-click the WM_CREATE and WM_SIZE items. Two member functions (OnCreate and OnSize) will be added to your view class. Now, edit these functions. They should look like this:

void CEditView::OnSize(UINT nType, int cx, int cy)
{
    CView::OnSize(nType, cx, cy);

    if (m_AddFlow.GetSafeHwnd() != NULL)
        m_AddFlow.MoveWindow(0, 0, cx, cy);
}

int CEditView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    if (CView::OnCreate(lpCreateStruct) == -1)
        return -1;

    if (!m_AddFlow.Create(NULL, WS_VISIBLE, CRect(0,0,400,400), this, IDC_ADDFLOW))
    {
        AfxMessageBox("Error creating AddFlow.", MB_OK);
        return -1;
    }

    return 0;
}

  14. The previous code is using a new constant (IDC_ADDFLOW) and a new variable (m_AddFlow). You may define them as following. At the beginning of the editview.cpp module, add the following line:

#define IDC_ADDFLOW 501

And in the editview.h file, in the definition of the CEditView class, add the following declaration in the Attributes section just after the line: "CEditDoc* GetDocument();"

CAddFlow m_AddFlow;

The type CAddFlow, defined in the addflow.h header file, is not know unless you include the necessary headers. Therefore add the following lines at the beginning of the editview.h file:

#include "picture.h"
#include "font.h"
#include "Links.h"
#include "Link.h"
#include "Nodes.h"
#include "Node.h"
#include "Selnodes.h"
#include "Sellinks.h"
#include "linkpoint.h"
#include "linkpoints.h"
#include "addflow.h"

  15. Then build the project: in the Build pulldown menu, activate the Build edit.exe item menu.
  16. And execute it: in the Build pulldown menu, activate the Execute edit.exe item menu (or press Ctrl F5)

Without any programmation, you can already draw interactively a full diagram:

  • create nodes
  • create links between nodes
  • change each property of each node or each link (it is necessary that the ShowPropertyPages property is set to "afShowNodeAndLink")

Remark: if you use the evaluation version of AddFlow, you will have a nag screen. If you use the licensed version, see the Microsoft KnowledgeBase Q151771 and see also the CAfEditView::OnCreate function if the afEditView.cpp module of the C++ afEdit sample provided with AddFlow.

  17. Then you can add your own code. Note that before adding your own code, you should include the file AddflowConst.h which is provided in the installation package (you can find it in each C++ sample directory). This file contains the declarations of all the AddFlow constants that you can be used in your application.


Interactivativity

Create a diagram interactively

Draw a node

Bring the mouse cursor into the control, press the left button, move the mouse and release the left button. You have created an elliptic node. This node is selected: that's why 9 handles (little squares) are displayed.

The handle at the center of the node is used to draw a link. The 8 others allow resizing the node. If you want to move the node you bring the mouse cursor into the node, press the left button, move the mouse and release the left button.

Draw a link

Draw a second node.

Then bring the mouse cursor into the handle at the center of the selected node, press the left button, move the mouse towards the other node. When the mouse cursor is into the other node, release the left button. The link has been created. And it is selected since a handle is displayed at the center of this link.

Stretch a link

Bring the mouse cursor into the link handle, press the left button, move the mouse and release the left button. You have created a new link segment. It has 3 handles allowing you to add or remove segments. (The handle at the intersection of two segments allows you to remove a segment: you move it with the mouse so that the two segments are aligned and when these two segments are approximately aligned, release the left button).

Create another segment

Draw a reflexive link

Select a node by clicking on it. Then bring the mouse cursor into the handle at the center of the selected node. Press the left button, move the mouse and release the left button when the mouse is still inside the selected node. You have created a reflexive link, i.e a link whose origin and destination are the same.

Multiselection

You can select several nodes by clicking them with the mouse and simultaneously pressing the shift or control key.

You can also select links or nodes and links.

There is another way to perform multiselection: see the SelectMode property.

Change properties of a node

Right click on the second node. Its property page will appear.

Change the node shape and the node filling color.

Remark: displaying a property page by right clicking on a node or a link is the default behaviour. However, you can alter this default behaviour with the ShowPropertyPages property. And probably, in your applications you will have to do that.

Change properties of a link

Right click on the reflexive link. Its property page will appear.

Change the link drawing color (red), the shape of the arrow head and the link style (1 - Bezier).

Add a text to a node

Click for instance on the blue node. This will select it. Click another time. An edit box is displayed inside the node, allowing you to enter a text.

Note that could also enter the text via the node property page. For a link, you have to use its property page. Of course, in your application you can implement your custom property page or use any other way to change the node or the link properties.

Adjust the link origin and destination points

In the previous example, you cannot adjust the extremities of the links. For instance if you click on the blue link, you will see that there is not any handle at its first and last points.

You can change this behaviour. Right click on this link. Its property page will appear. Click on the Flag tab. Then check the 2 check boxes AdjustOrg and AdjustDst.

Then Click ok. Now, you'll see that the blue link has 2 new handles at its first and last points.

If you bring the mouse cursor into one of these 2 link handles, for instance the destination one, press the left button, move the mouse and release it, you'll see that you have defined a new destination position for the link. If you move the destination node, the new link destination position keeps on following the node.

Change the destination or the origin node of a link

You can change interactively the destination or the origin of a link. For instance, consider the following diagram.

You can adjust the last point of the red link. Move it from node 1 to node 2 (Bring the mouse cursor into the third link handle (near the arrow head), press the left button, move the mouse until the node 2 and release the left button).
Then the new destination of the link will be the node 2 (If you move the node 2, the link will follow it).


AddFlow diagrams

An AddFlow diagram is a set of objects that can be linked each other. Following figure shows a typical example of such a diagram.

The objects are called nodes and the lines that connect objects are called links. Nodes and links are AddFlow objects and those objects have many attributes that can be changed: colors, text, drawing styles, fonts, etc...

Nodes may be moved or resized whereas links may be stretched into several segments.

A link cannot exist without its origin and destination nodes. If one of these two nodes is removed, the link is also removed. For instance, if you remove the node C , the diagram becomes the following:


Node and Link objects

You may create a Node object programmaticaly with the Add method of the nodes collection object. This method allows specifying the position and the size of the node that is created. The node object type name is afNode.

When it is created, the node receives default values for the following attributes: colors (Drawing color, text color, filling color), drawing pen style and width, shape, text alignment, autosize mode, transparency, font and hidden flag. Then you may alter the position, the size and all default attributes of the node. You can also associate a text, a picture or user data to this node. (See Node Properties).

A Link object allows linking two nodes. It is a line that leaves the origin node and comes to the destination node. You may create a link programmaticaly with the Add method of the links collection object. When creating a link, you have to define its origin and its destination node. The link object type name is afLink.

When it is created, the link receives default values for the following attributes: colors (Drawing color, text color), drawing pen style and width, arrow shapes, font and hidden flag. Then you may alter the default attributes of the link. You can also associate a text or user data to this link. (See Link Properties).

A link may have several segments (See The default behaviour is that the first segment is always directed towards the center of the origin node and the last segment is always directed towards the center of the destination node. However, this behaviour may be changed with the AdjustOrg and AdjustDst properties.

Now, as an example, let us give the Visual Basic and the Visual C++ code to create the following diagram.

Visual Basic Example

' Create 2 nodes and link them.
Dim node1 As afNode, node2 As afNode
Dim link As afLink

' Define a default filling color for next created nodes and links
AddFlow1.DrawColor = RGB(0, 0, 0)  ' Default Drawing color = Black
' Define a default shape for next created nodes
AddFlow1.Shape = afRectangle  ' Default shape = rectangle

' Create a blue rectangular node and associate a text to this node
Set node1 = AddFlow1.Nodes.Add(100, 100, 500, 500)
node1.Text = "First node"

' Create a blue elliptic node and associate a text to this node
Set node2 = AddFlow1.Nodes.Add(2000, 1000, 800, 800)
node2.DrawColor = RGB(0, 0, 255)
node2.Shape = afEllipse
node2.Text = "Second node"
' Create a red link between node1 and node2
Set link = node1.OutLinks.Add(node2)
link.DrawColor = RGB(255, 0, 0)
link.ExtraPoints.Add 800, 1400

Visual C++ Example

// Create 2 nodes and link them.
CNode node1, node2;
CLink link;

// Define a default filling color for next created nodes and links
m_AddFlow.SetDrawColor(RGB(0, 0, 0));  // Default Drawing color = Black
// Define a default shape for next created nodes
m_AddFlow.SetShape(afRectangle);  // Default shape = rectangle
// Create a blue rectangular node and associate a text to this node
node1 = m_AddFlow.GetNodes().Add(100, 100, 500, 500);
node1.SetText("First node");
// Create a blue elliptic node and associate a text to this node
node2 = m_AddFlow.GetNodes().Add(2000, 1000, 800, 800);
node2.SetDrawColor(RGB(0, 0, 255));
node2.SetShape(afEllipse);
node2.SetText("Second node");

// Create a red link between node1 and node2
link = node1.GetOutLinks().Add(node2);
link.SetDrawColor(RGB(255, 0, 0));
link.GetExtraPoints().Add(800, 1400);


Selection

Following properties and methods are dealing with selection.

SelectAction | returns/sets the selection rectangle action (select items, zoom,...).
SelectedLink | returns/sets a value which determines if a Link object is selected.
SelectedNode | returns/sets a value which determines if a Node object is selected.
SelectMode | determines whether selection mode is set instead of drawing mode.
SelLinks | allows access to the collection of the selected links of a diagram.
SelNodes | allows access to the collection of the selected nodes of a diagram.
Selectable | determines if the node or the link is active or readonly.
Selected | determines if the node or the link is selected or not.
IsSelChanged | returns the selection change flag.
SelectAll | select all nodes and all links.
SetSelChangedFlag | reset the selection change flag.

You can select a node either interactively by clicking it with the mouse, either programmaticaly with the SelectedNode property.

You can select a link either interactively by clicking it (see the note at the end of this topic) with the mouse, either programmaticaly with the SelectedLink property.

You can also select several nodes or links, either interactively with the mouse if multiselection is allowed (in such a case MultiSel and SelectMode properties are true), either programmaticaly with the Selected property or with the new version 3 collections: SelNodes and SelLinks.

You can also know what object is under the mouse with PointedNode and PointedLink properties that return the reference of the node or the link under the mouse. If several objects are under the mouse, the returned object is the one that is at the top of the Z-order list. You may change this order with the Zorder property.

Instead of using the PointedNode and PointedLink properties, you may use the GetNodeAtPoint and GetLinkAtPoint, methods.

Note on selecting a link with the mouse:

If the link is made of one or several segments, then if you want to select it with the mouse, you have just to click near one of its segments. If the link is a Bezier curve (see LinkStyle property), then you have just to click near the curve.


Navigation

Five properties allow accessing every nodes and links of a diagram:

Nodes | allows access to the collection of all the nodes of a diagram.
InLinks | allows access to the collection of links that come to the node.
OutLinks | allows access to the collection of links that leave the node.
Org | returns/sets the reference of the origin Node object of a link.
Dst | returns/sets the reference of the destination Node object of a link.

The following properties and methods offer additional possibilities:
GetLinkedNode | returns the node connected to a given node via a given link.
Reverse | reverses the origin and the destination of a link.
Links | allows access to the collection of links that come to the node or leave the node.
SelNodes | allows access to the collection of the selected nodes of a diagram.
SelLinks | allows access to the collection of the selected links of a diagram.

Let us give 4 examples in Visual Basic and 4 examples in Visual C++.

VB Example 1

' Make all nodes rectangular
Dim node as afNode
For Each node In AddFlow1.Nodes  ' Nodes enumeration
  node.Shape = afRectangle
Next

VB Example 2

' Make all links leaving the selected node red.
Dim link as afLink
If AddFlow1.SelectedNode Is Nothing then
 ' Do Nothing
Else
  For Each link In AddFlow1.SelectedNode.OutLinks
    link.DrawColor = RGB(255, 0, 0)
  Next
End If

VB Example 3

' Make all links red.
Dim node as afNode, link as afLink
For Each node In AddFlow1.Nodes ' Nodes enumeration
   ' For each node, perform a “ leaving link ” enumeration.
   For Each link In node.OutLinks
    link.DrawColor = RGB(255, 0, 0)
  Next
Next

VB Example 4

' Make all destination nodes of the selected node Transparent.
Dim link as afLink
If AddFlow1.SelectedNode Is Nothing then
 ' Do Nothing
Else
  For Each link In AddFlow1.SelectedNode.OutLinks
    link.Dst.Transparent = True
  Next
End If

VC++ Example 1

// Make all nodes rectangular
CNodes nodes;
CNode node;
int i;
VARIANT vaIdx;

VariantInit(&vaIdx);
vaIdx.vt = VT_I4;
nodes = m_AddFlow.GetNodes();

for (i = 1; i <= nodes.GetCount(); i++)
{
  vaIdx.lVal = i;
  node = nodes.Item(vaIdx);
  node.SetShape(afRectangle);
}

VC++ Example 2

// Make all links leaving the selected node red.
CLinks links;
CNode node;
CLink link;
int k;
VARIANT vaIdx;

VariantInit(&vaIdx);
vaIdx.vt = VT_I4;
node = m_AddFlow.GetSelectedNode();
links = node.GetOutLinks();

for (k = 1; k <= links.GetCount(); k++)
{
  vaIdx.lVal = k;
  link = links.Item(vaIdx);
  link.SetDrawColor(RGB(255, 0, 0));
}

VC++ Example 3

// Make all links red.
CNodes nodes;
CLinks links;
CNode node;
CLink link;
int i, k;
VARIANT vaIdx;

VariantInit(&vaIdx);
vaIdx.vt = VT_I4;
nodes = m_AddFlow.GetNodes();

for (i = 1; i <= nodes.GetCount(); i++)
{
  vaIdx.lVal = i;
  node = nodes.Item(vaIdx);
  links = node.GetOutLinks();
  for (k = 1; k <= links.GetCount(); k++)
  {
    vaIdx.lVal = k;
    links.Item(vaIdx).SetDrawColor(RGB(255, 0, 0));
  }
}

VC++ Example 4

// Make all destination nodes of the selected
node Transparent.
CLinks links;
CNode node;
CLink link;
int k;
VARIANT vaIdx;

VariantInit(&vaIdx);
vaIdx.vt = VT_I4;
node = m_AddFlow.GetSelectedNode();
links = node.GetOutLinks();

for (k = 1; k <= links.GetCount(); k++)
{
vaIdx.lVal = k;
link = links.Item(vaIdx);
link.GetDst().SetDrawColor(RGB(255, 0, 0));
}


Capabilities

Following properties allow setting capabilities for an AddFlow control and therefore to customize it. For instance, if you wish to allow only one link between two nodes, you have just to unset the CanMultiLink property.

AllowArrowKeys | Determines whether arrow keys can be used to scroll the diagram.
Autorouting (v5) | Determines whether the autorouting mode for links is set
CanChangeOrg (v5) | Determines whether it is allowed to interactively change the origin point
CanChangeDst (v5) | Determines whether it is allowed to interactively change the destination point
CanDrawNode | Determines whether interactive creation of Node objects is allowed or not.
CanDrawLink | Determines whether interactive creation of Link objects is allowed or not.
CanFireError | Determines if the error event is fired or not.
CanReflexLink | Determines whether interactive creation of reflexive Link objects is allowed or not.
CanMoveNode | Determines whether interactive dragging of Node objects is allowed or not.
CanSizeNode | Determines whether interaction resizing of Node objects is allowed or not.
CanStretchLink | Determines whether interactive stretching of Link objects is allowed or not.
CanMultiLink | Determines whether you can create several links between two nodes.
CanUndoRedo | Determines whether undo/redo is allowed.
CycleMode | Returns/sets a value that determines whether cycles are accepted or not.
DisplayHandles | Determines whether the handles used for selection are displayed or not.
MultiSel | Determines whether multiselection of Node objects is allowed or not.
ReadOnly | Determines whether user interaction is allowed or not.
RemovePointAngle | Returns/sets the angle that causes a link point to be removed when stretching a link.
ShowToolTip | Determines whether you can display node and link tooltips.
XZoom | Returns/sets the horizontal zooming factor.
YZoom | Returns/sets the vertical zooming factor.


Undo

Undo/Redo

AddFlow provides a powerful multilevel Undo/Redo feature. The history length is limited only by available memory. However, you can limit it yourself with the UndoSize property.

You can also enable/disable the undo/redo with the CanUndoRedo property.

Updating the user interface

Some properties and methods allow you to properly update the user interface. The CanUndo and CanRedo methods will tell you if there is something to undo or redo and therefore will allow you to grey out the menu options. The RedoCode and UndoCode properties return a code that describes the action waiting to be redone or undone. This will allow your application to give descriptions of the actions on the undo and redo history. The RedoNode, RedoLink, UndoNode, UndoLink properties allow knowing what is the item (node or link) involved in the next redo or undo action.

Grouping basic actions

Every basic action has a code. However, the BeginAction and EndAction methods allow you to define a group of actions and to assign a code to this group. This is useful if for instance, in your application, the user can open a dialog box that allows changing several properties of a node (for instance, its text, its tag and its filling color). You will certainly wish to allow the user to undo these 3 basic actions in one time.

What can be undone and redone?

The rule is the following: every action that changes a diagram can be undone or redone. This includes actions like moving or resizing nodes or stretching links or changing a text, a color, a picture or a font. This includes also actions that only change the internal state of the document without having any visible effect, for instance, changing the Marked property or the Tag property.

However, making a selection does not change the document so you will not be able to undo a selection. Changing properties of the AddFlow control (zoom, grid, default filling color, etc) does not change the document too. Therefore, it will not be possible to undo these actions. And finally, file, print and export operations are clearly not undoable.

Undo/Redo API

The following properties and methods allow to implement and customize an Undo/Redo feature:

BeginAction | Start a group of actions that can be undone in one time.
CanRedo | Indicates if there is an action that can be redone.
CanUndo | Indicates if there is an action that can be undone.
CanUndoRedo | Determines whether undo/redo is allowed.
EndAction | Terminate a group of actions that can be undone in one time.
Redo | Redo, if possible, the last action.
RedoCode | Returns the code of the next redoable action.
RedoNode (v5) | Returns a reference to the node involved in the next redoable action
RedoLink (v5) | Returns a reference to the link involved in the next redoable action
SkipUndo (v5) | Determines whether the next actions are recorded in the undo manager.
Undo | Undo, if possible, the last action.
UndoCode | Returns the code of the next undoable action.
UndoNode (v5) | Returns a reference to the node involved in the next ubdoable action
UndoLink (v5) | Returns a reference to the link involved in the next undoable action
UndoSize | Sets and returns the number of undo commands that can be performed.


Limits of AddFlow

Number of objects (nodes and links)

There is no maximum for the number of nodes or links. You can create a diagram with 30000 nodes and links if you need (a powerful processor is necessary in this case)

Drawing limits

If your diagram is too big, you may receive a "outside allowed area" error message.

The drawing limits depend on the operating system:

Under Windows 95 or Windows 98, coordinates are restricted to 0 to 32767 pixels (*). This is in fact an operating system limit: under Windows 95 or 98, coordinate values are restricted to -32 768 to 32 767. Although coordinates values appear to be 32-bit values, only the lower 16 bits are used in W95 or W98.

Under Windows NT or Windows 2000, the full 32-bit values are used. Therefore in that case, the limitation disappears.

(*) Under VB, you may use the methods Screen.TwipsPerPixelX and Screen.TwipsPerPixelY.to convert pixels in twips.


Performance tuning

Following properties allows increasing performance (speed):

Repaint | This property aims at improving performance: setting it to False allows increasing the speed when creating programmaticaly a whole diagram.
Logical | Determines if a node or a link is in the logical flow.
LogicalOnly | Determines whether collection properties allow getting only logical objects.

Be aware that, by default, the undo/redo processing is working. You can remove it with the CanUndoRedo property. And in some cases, this may improve the speed of some tasks. For instance, to delete a diagram, you may call the Clear method of the Nodes collection. If the diagram is big, then you should unset the CanUndoRedo property before:

AddFlow1.CanUndoRedo = False
AddFlow1.Nodes.Clear
AddFlow1.CanUndoRedo = True


Grid

Six properties allow setting the grid behaviour of an AddFlow control.

GridColor | Returns/sets the grid drawing color.
GridStyle | Returns/sets the grid drawing style.
ShowGrid | Determines whether the grid is displayed or not.
SnapToGrid | Determines whether nodes and links are aligned to the grid.
xGrid | Returns/sets the horizontal grid.
yGrid | Returns/sets the vertical grid.


Scrolling

The following properties allow setting the scrolling behaviour of an AddFlow control.

AutoScroll | Determines whether automatic scrolling is allowed or not.
ProportionalBars | Determines whether the scrollbar thumbs should be proportional to the size of the visible area.
ScrollBars | Allows adding scrollbars for the control.
ScrollTrack | Determines whether scrolling should occur while the user moves the scroll thumb.
ScrollWheel | Determines whether scrolling should occur while the user moves the mouse wheel.
xScroll | Returns/sets the horizontal scrolling offset.
yScroll | Returns/sets the vertical scrolling offset.

Two properties allow changing the scrolling behaviour of a node.
xScrollable | Determines whether the node can be horizontally scrolled or not.
yScrollable | Determines whether the node can be vertically scrolled or not.

Each time the diagram is scrolled, a Scroll event is fired.


Metafile support

AddFlow offers both Windows standard and enhanced metafile supports.

You can export a diagram as a picture with the ExportPicture method. The format used is the enhanced metafile format. The exported picture can be saved in a file, copied in a picture box or in the clipboard.

You can also use the old SaveImage method which allows saving the diagram on disk as a metafile (standard or enhanced). This method allows also to copy the diagram onto the clipboard.

ExportPicture is more flexible than SaveImage. However, you may find interesting to use SaveImage because this method supports also the old standard metafile format (WMF).


User Data

You can associate "user data" to a node or a link. This data is not manipulated by AddFlow. You can associate a boolean value (Marked), a numeric value (UserData), a string (Tag), a unique string (Key), a tooltip (Tooltip) and a variant value (TagVariant).

All those properties can be saved in AddFlow files (SaveFile/LoadFile methods) except the TagVariant property. Following is the list of the properties that allow associating user data to a node or a link:

UserData | Allows associating a numeric value to a node or a link.
Tag | Allows associating a string to a node or a link. This string may be a comment, an URL or anything you need for your application.
TagVariant | Allows associating a variant value to a node or a link.
ToolTip | Allows associating a tooltip text to a node or a link.
Marked | Allows associating a flag to a node or a link. This flag may be used with the DeleteMarked method. But you can also use this flag for your own purpose.
Key | Allows associating a unique key to a node or a link. This key can be used to identify a node or a link.


Saving

Saving/Loading

Persistent storage is provided by the following methods:

SaveFile | Saves a diagram in a file.
LoadFile | Loads a diagram from a file.
SaveMemory | Saves a diagram in memory.
LoadMemory | Loads a diagram from memory.

We provide also an extension of AddFlow (XMLFlow.ocx) that allows saving/loading a diagram in a XML file.

You can also use your custom format. The price for that is to write yourself the code that save/load a diagram. However, we provide such a code for the XML format (see XML topic).


Clipboard support

You can copy a part of the AddFlow diagram to the clipboard, using 2 ways.

The first one allows exporting a diagram (or a part of it) as a picture, using the ExportPicture method. Then you can paste it in a picture box or in any application that can receive a metafile. This action is not reversible. You cannot paste that metafile into an AddFlow control. See Metafile support.

The second method allows copying a diagram or a part of it, then retrieving this diagram information onto another AddFlow diagram (or the same diagram). AddFlow registers a custom format with the clipboard for that. Only AddFlow controls understand this format which is the same as the one used by the the LoadFile and SaveFile methods. All the informations associated to a node or a link are involved in this Copy/Paste feature: styles text, pictures, fonts, user data, etc…

If you wish to enable a menu item or a button for the Paste operation, you can use the method CanPaste which indicates whether a legal paste operation is possible or not.

Clipboard support is provided by the following methods:

Copy | Copies a diagram or a part of it onto the clipboard.
ExportPicture | Exports a diagram or a part of it as a picture (enhanced metafile).
Paste | Pastes items from the clipboard to a diagram.
CanPaste | Indicates if a paste operation can be performed.


Printing

The PRNFLOW method

PrnFlow is an ActiveX control that allows printing AddFlow diagrams. It allows multipage printing, print previewing, margins, header and footer. It can be viewed as an extension of AddFlow. It is a free extension. No support is provided but its source code (written in C++/MFC) is available free of charge for the AddFlow 5 registered users. See PrnFlow for more informations.

The VSVIEW method

AddFlow allows printing of any diagram with all the usual printing features you need: multipage printing, print preview, margins, header, footer, etc... For this printing feature to work, it is necessary to purchase the VSView ActiveX control from ComponentOne. (http://www.componentone.com)

To manage all the printing tasks, VSView communicates with AddFlow via the Open Print Preview architecture (OPP). The VB afEdit sample (provided in the AddFlow installation package) illustrates how to use VSView to offers a full printing feature.

VSVIEW's vsPrinter control has a property called RenderControl. To allow printing and print previewing, you have just to set RenderControl to the hWnd of the AddFlow control. Then you can use the properties and methods of VSVIEW's vsPrinter to customize your printing and print previewing.

The following code is all you need to do to print your diagram:

' vsPrinter1 is an instance of the VSPrinter control included in VSVIEW.
With vsPrinter1
   ' If you just want a print preview, set the Preview property to True.
   .Preview = False
  .Header = "|" & FileName & "|"
  .Footer = "|Page %d|"
  .StartDoc
   ' The following instruction creates the link between AddFlow and VSVIEW
   .RenderControl = AddFlow1.hWnd
  .EndDoc
End With

Other methods

Although the previous methods are the best and easiest solutions, there are other methods to print an AddFlow diagram:

  1. copy it to clipboard using the Metafile format (ExportPicture method). Then paste it in Winword or Excel or PaintBrush. Then you may resize it, change it and print it.
  2. save it to disk as a metafile (ExportPicture method) then the problem is to print a metafile.
  3. use the PrintForm method (for VB users only). This method allows printing the visible part of the diagram. But you can use it in conjunction with xScroll and yScroll properties in order to print the whole diagram.


Internet application

AddFlow can be incorporated in a web page. Your HTML code needs to reference the control as an object. The CODEBASE tag tells the browser where to find the control. You can use a CAB file here.

License file

Since you can't distribute the license file, you need to create a run-time license using LPK_TOOL. Generally, development tools like VB cache the license string within the generated application. However, Internet environments provide no built-in mechanisms for caching the license information securily in an HTML document. To get around this limitation, the user (of AddFlow or another OCX control) has to use a Microsoft utility called LPK_TOOL.EXE. This tool, available as a part of the Microsoft Internet Client SDK, packages the license file into an encrypted file that you can refer to in your HTML document. Internet Explorer can retrieve the licensed information from the LPK file when it prepares to instantiate a licensed component.

Run LPK_TOOL.EXE and choose AddFlow 5 ActiveX Control in the left listbox. Add it to the right listbox, then click on the Save & Exit button. Name the file addflow.lpk and save it in the same directory as your html page.

Then in your hml page, add the following lines:

<object classid="clsid:5220cb21-c88d-11cf-b347-00aa00a28331">
  <param name="LPKPath" value="addflow.lpk">
</object>

(For more informations about LPK_TOOL, you may visit: http://support.microsoft.com/support/kb/articles/Q159/9/23.ASP)

Security

  1. AddFlow is digitally signed, using Microsoft Authenticode™ technology and Verisign as the certifying authority.
  2. The standard version of AddFlow is not declared as safe (for scripting and initializing) because it contains methods (for instance SaveFile) that can potentially be used for malicious purposes (for instance deleting a system file) in a script. If you need to use the standard version in a web application, you will have to lower your Internet Explorer security preferences to avoid the problem. You can find a cab file for the standard version of AddFlow at http://www.lassalle.com/cab/af5unsafe.cab
  3. There is another cab file available: http://www.lassalle.com/cab/af5safe.cab. This cab file contains a version of AddFlow that is safe for scripting and initializing. However, this special version has some limitations: the SaveFile, LoadFile, SaveImage, Copy, Paste methods are disabled.

Example

The following HTML code describes a page containing an AddFlow control and a button. When this page is loaded, 5 nodes (1 is hidden and the other is transparent) and 4 links are created. The transparent node is also not selectable and is used to display the coordinates of the mouse. The button allows you to select all items. If you press the Del key, you delete the selection.

<HTML>
<HEAD><TITLE></TITLE></HEAD>
<BODY>

<OBJECT classid="clsid:5220cb21-c88d-11cf-b347-00aa00a28331">
  <param name="LPKPath" value="addflow.lpk">
</OBJECT>

<SCRIPT LANGUAGE=JavaScript FOR=AddFlow1 EVENT="MouseMove(shift, button,
x, y)">
<!--
if (AddFlow1.Nodes.Count > 0)
{
s = "mouse position: " + x + "," +
y;
node = AddFlow1.Nodes.Item("MouseCoordinatesNode");
node.Text = s;
}
//-->
</SCRIPT>

<SCRIPT LANGUAGE=JavaScript FOR=AddFlow1 EVENT="KeyDown(KeyCode,
shift)">
<!--
if (KeyCode == 46)
AddFlow1.DeleteSel();
//-->
</SCRIPT>

<OBJECT classid="clsid:C947F0AF-6F1A-49A7-A65A-D0F45DC75076"
codebase="http://www.lassalle.com/cab/af5safe.cab" id=AddFlow1
style="HEIGHT: 300px; LEFT: 10px; TOP: 15px; WIDTH: 413px" VIEWASTEXT
width="413" height="300">
<param name="_Version" value="196608">
<param name="_ExtentX" value="10927">
<param name="_ExtentY" value="7938">
<param name="_StockProps" value="229">
<param name="BackColor" value="16777215">
<param name="FillColor" value="12648447">
<param name="DrawColor" value="8388608">
</OBJECT>

<SCRIPT LANGUAGE=javascript>
<!--
node0 = AddFlow1.Nodes.Add(0, 100, 2500, 300);
node0.Shape = 1;
node0.DrawStyle = 5;
node0.Transparent = true;
node0.xScrollable = false;
node0.yScrollable = false;
node0.Selectable = false;
node0.Key = "MouseCoordinatesNode";
node1 = AddFlow1.Nodes.Add(100, 500, 1000, 1000);
node1.Text = "node1";
node1.Shape = 75;
node2 = AddFlow1.Nodes.Add(3000, 500, 750, 750);
node2.Text = "node2";
node2.Shape = 0;
node3 = AddFlow1.Nodes.Add(1300, 3200, 750, 750);
node3.Text = "node3";
node4 = AddFlow1.Nodes.Add(3500, 3700, 1000, 750);
node4.Transparent = true;
node4.Shape = 1;
node4.DrawStyle = 5;
node4.AutoSize = 2;
link = node1.OutLinks.Add(node2);
link.LinkStyle = 1;
link.ArrowOrg = 1;
link = node2.OutLinks.Add(node3);
link.ExtraPoints.Add(2000, 0);
link.ExtraPoints.Add(2000, 2000);
link.DrawColor = 255;
link.LinkStyle = 4;
link.AdjustDst = true;
link = node3.OutLinks.Add(node1);
link.DrawStyle = 2;
link = node4.OutLinks.Add(node2);

function SelectAll()
{
AddFlow1.SelectAll();
}

//-->
</SCRIPT>

<P>
<INPUT id=button1 name=button1 type=button value=SelectAll onClick="SelectAll()">
</P>

</BODY>
</HTML>


AddFlow and XML

With AddFlow 4 we provide an ActiveX DLL, XMLFlow, allows saving/loading an AddFlow diagram in a XML file. The source code of this DLL, written in Visual Basic 6, is provided in the installation package of AddFlow 4.

With AddFlow 5, we provide an ActiveX control: XMLFlow.ocx which allows saving/loading an AddFlow diagram in a XML file. See XMLFlow or more informations.


Layout

Automatic Graph Layout

The primary purpose of an automatic graph layout feature is to offer a way to display graphs or flow charts in a reasonable manner, following some aesthetic rules.

AddFlow does not provide directly any automatic graph layout feature. However, we propose LayoutFlow, a set of 4 Graph layout ActiveX controls: HFlow, OFlow, SFlow and TFlow.


Autorouting

By default, when the user creates a link between 2 nodes, the link is drawn as a straight line which may traverse other nodes. The RouteFlow algorithm allows finding a route between the other nodes which are considered as obstacles.

It uses the following rules:

1) Orthogonality rule

The path is composed of orthogonal segments. A new segment is allways orthogonal to the previous one.

2) Distance rule (we try to decrease the distance towards the destination node) When we move in a segment:

  • if the distance towards the destination node is increasing, then we stop the current segment and create a new segment allowing decreasing the distance towards the destination node.
  • else we continue until:
    • either we hit an obstacle (another node)
    • either we reach the X or Y coordinates of the destination.

3) Obstacle rule

  • If we hit an obtacle, we backtrack to the previous segment and we continue to move.
  • If this is not possible, we move back one step and we create a new segment.

4) Start rule

The first segment is orthogonal to a side of the origin node rectangle. Several methods to select the starting side are provided via the StartingMethod property.

LIMITATIONS

The autorouting is performed only if:

  • the link is not reflexive
  • the line style is Polyline
  • the AdjustDst and AdjustOrg properties are true.

REMARKS

  • Only logical nodes can be obstacles. Therefore, if you wish to avoid a node to be an obstacle, set its Logical property to False.
  • The algorithm may fail to find a route in some "pathological" diagrams (consider for instance the trivial case where a node is completely surrounded by other nodes). In such a case, the link is drawn as a straight line between the origin node and the destination node.
Autorouting | Determines whether the autorouting mode for links is set
RouteStartMethod | Determines the sides of the origin node from which the link is to start.
RouteGrain | Determines the number of steps taken when trying to find a route around nodes
RouteMinDistance | Determines the minimum distance between a segment of the link and an obstacle.


Custom Shapes

AddFlow 5 allows creating custom polygonal shapes for nodes. For that, you have to create custom shape objects, store them in a collection of custom shape objects and associate an element of this collection to a node. Moreover, the Shape property of the node must be set to afCustomShape:

node.Shape = afCustomShape

The custom shape object type name is afCustomShape. You can define the polygon with the AddPoint method.

The collection of custom shape objects can be accessed via the AddFlow property CustomShapes.
You should add the custom shapes you need to this collection when your application starts.

An element of this collection can be associated to a node via the node property CustomShapeIndex.

For instance, if your application requires to use of 2 kind of custom shapes, you could fill your custom shape collection using the following code:
Dim customShape1 As afCustomShape
Set customShape1 = AddFlow1.CustomShapes.Add
customShape1.AddPoint 0, 0
customShape1.AddPoint 100, 0
customShape1.AddPoint 100, 100
customShape1.AddPoint 50, 50
customShape1.AddPoint 0, 100
Dim customShape2 As afCustomShape
Set customShape2 = AddFlow1.CustomShapes.Add
customShape2.AddPoint 0, 0
customShape2.AddPoint 0, 100
customShape2.AddPoint 100, 100
customShape2.AddPoint 50, 50
customShape2.AddPoint 100, 0

then, if you wish to assign the second custom shape to a node, you will have to write:

node.Shape = afCustomShape
node.CustomShapeIndex = 2

The CustomShapes sample provides another example:

The code to create these 2 nodes is the following:

' Create a custom shape
Dim customShape As afCustomShape
Set customShape = AddFlow1.CustomShapes.Add
customShape.AddPoint 0, 0
customShape.AddPoint 100, 0
customShape.AddPoint 50, 30
customShape.AddPoint 100, 100
customShape.AddPoint 50, 70
customShape.AddPoint 0, 100

' We will use the first custom shape as the default shape
AddFlow1.Shape = afCustomShape
AddFlow1.CustomShapeIndex = 0
AddFlow1.FillColor = vbYellow

' Create 2 nodes and a link
Dim node1 As afNode, node2 As afNode, link As afLink
Set node1 = AddFlow1.Nodes.Add(1000, 200, 1000, 1000)
Set node2 = AddFlow1.Nodes.Add(4000, 1500, 1000, 1000)
Set link = node1.OutLinks.Add(node2)


Custom shapes

Custom Drawings

AddFlow 5 offers another way to customize drawings via 3 OwnerDraw events:

  • DiagramOwnerDraw event: occurs each time the diagram needs to be repainted. This event is fired only if the OwnerDraw property of the AddFlow control is true.
  • NodeOwnerDraw event: occurs each time a node needs to be repainted. This event is fired only if the OwnerDraw property of the node is true.
  • LinkOwnerDraw event: occurs each time a link needs to be repainted. This event is fired only if the OwnerDraw property of the link is true.

These events give you the opportunity to replace the AddFlow drawing by your custom drawing. This requires that you know how to program the Windows GDI.

The OwnerDraw sample provided with AddFlow demonstrates the use of each OwnerDraw event. The DiagramOwnerDraw event is used to draw blue and yellow swim lines.The NodeOwnerDraw event is used to display foe each node a green ellipse with a yellow square inside. The LinkOwnerDraw event is used to display links with alternatively green and red segments.

Following is the VB code used to display the swim lines:

Private Sub AddFlow1_DiagramOwnerDraw(ByVal hdc As Long, Flags As Long)
  Dim hBrush1 As Long, hBrush2 As Long
  hBrush1 = CreateSolidBrush(&HFFFFC0)
  hBrush2 = CreateSolidBrush(&HC0FFFF)

  Dim w As Integer, h As Integer
  Dim swimLines As Integer, swimLinesHeight As Integer

  swimLinesHeight = 50
  w = AddFlow1.Width + AddFlow1.xExtent / Screen.TwipsPerPixelX
  h = AddFlow1.Height + AddFlow1.yExtent / Screen.TwipsPerPixelY
  swimLines = h / swimLinesHeight

  Dim i As Integer
  Dim rc As RECT
  For i = 0 To swimLines
    rc.Left = 0
    rc.Top = i * swimLinesHeight
    rc.Right = rc.Left + w
    rc.Bottom = rc.Top + swimLinesHeight
    If i Mod 2 = 0 Then
      FillRect hdc, rc, hBrush1
    Else
      FillRect hdc, rc, hBrush2
    End If
  Next

  DeleteObject hBrush1
  DeleteObject hBrush2
End Sub


AddFlow reference guide

AddFlow Programming Reference Overview

The AddFlow object is the main component you will be dealing with. It has a list of properties, methods and events, and also exposes sub objects each with properties and methods.

List of properties

All the properties are listed below. Properties that apply only to AddFlow/ActiveX, or require special consideration when used with it, are underlined. They are documented in this help file. See the Visual Basic Language Reference or online Help for documentation of the remaining properties.

Some properties allow customizing the control according to your needs.

Some properties allow setting default values to Node and Link attributes. For instance, the FillColor property of the AddFlow control allows setting the default filling color of nodes. When a node is created, it receives this default filling color. Then, you may change the filling color of this node by using the FillColor of the Node object.

(About) | Displays the AddFlow About dialog box.
CycleMode | Returns/sets a value that determines whether cycles are accepted or not.
AdjustDst | Determines whether you can adjust the destination point of Link objects.
AdjustOrg | Determines whether you can adjust the origin point of Link objects.
Alignment | Returns/sets the default Node object text alignment style.
AllowArrowKeys | Determines whether arrow keys can be used to scroll the diagram.
ArrowOrg | Returns/sets the default Link object origin arrow shape.
ArrowMid | Returns/sets the default Link object middle segment arrow shape.
ArrowDst | Returns/sets the default Link object destination arrow shape.
Autorouting (v5) | Determines whether the autorouting mode for links is set
AutoSize | Returns/sets the default Node object AutoSize style.
AutoScroll | Determines whether automatic scrolling is allowed or not.
BackColor | Returns/sets the control background color.
BackMode | Determines whether the background will remain untouched or not behind the text of a node or a link.
BackPicture | Allows displaying a bitmap inside the control.
BorderStyle | Returns/sets the border style of the control.
CanChangeOrg (v5) | Determines whether it is allowed interactively changing the origin point
CanChangeDst (v5) | Determines whether it is allowed interactively changing the destination point
CanDrawNode | Determines whether interactive creation of Node objects is allowed or not.
CanDrawLink | Determines whether interactive creation of Link objects is allowed or not.
CanFireError | Determines if the error event is fired or not.
CanMoveNode | Determines whether interactive dragging of Node objects is allowed or not.
CanMultiLink | Determines whether you can create several links between two nodes.
CanReflexLink | Determines whether interactive creation of reflexive Link objects is allowed or not.
CanSizeNode | Determines whether interaction resizing of Node objects is allowed or not.
CanStretchLink | Determines whether interactive stretching of Link objects is allowed or not.
CanUndoRedo | Determines whether undo/redo is allowed.
CustomShapeIndex (v5) | Returns/sets the default index of a custom shape stored in the array of custom shapes defined by the CustomShapes property
CustomShapes (v5) | Returns a reference to the collection of the custom shapes that can be used to draw a node
DisplayHandles | Determines whether the handles used for selection are displayed or not.
DragIcon | Returns/sets the icon used to be displayed as a pointer in a drag-and-drop operation.
DragMode | Returns/sets a value that determines whether manual or automatic drag mode is used.
DrawColor | Returns/sets the default pen color used to draw objects (Node or Link).
DrawStyle | Returns/sets the default pen style used to draw objects (Node or Link).
DrawWidth | Returns/sets the default pen width used to draw objects (Node or Link).
EditMode | Returns/sets the default editable status of nodes.
Ellipsis | Returns/sets a value that determines if a part of a node text can be replaced with ellipses.
Enabled | Returns/sets a value that determines whether an object is enabled or not.
FillColor | Returns/sets the default color used to fill Node objects.
Font | Returns/sets the default font used to display text.
ForeColor | Returns/sets the default foreground color used to display text.
GridColor | Returns/sets the grid drawing color.
GridStyle | Returns/sets the grid drawing style.
Height | Returns/sets the height of an object.
HelpContextId | Specifies the default Help file context ID for an object.
Hidden | Determines whether objects (Node or Link) are by default visible or hidden.
Hwnd | Returns a window handle to the control
Index | Returns/sets the number identifying a control in a control array.
JumpSize (v5) | Returns/sets a value which defines the size of the jumps at the intersection of links.
LastUserAction | Returns the last interactive user action.
Left | Returns/sets the distance between the internal left edge of an object and the left edge of its container.
LinkCreationMode | Returns/sets the area allowing starting a link creation.
LinkingHandleSize | Returns/sets a value which defines the size of the linking handle at the center of selected node.
LinkStyle | Returns/sets the default style (polyline, bezier) used to draw Link objects.
LogicalOnly | Determines whether collection properties allow getting only logical objects.
MaxDegree | Returns/sets the default maximum number of links for a node.
MaxInDegree | Returns/sets the default maximum number of incoming links for a node.
MaxOutDegree | Returns/sets the default maximum number of outgoing links for a node.
MouseIcon | Sets a custom mouse icon.
MousePointer | Returns/sets the type of mouse pointer displayed when over control.
MultiSel | Determines whether multiselection of Node objects is allowed or not.
Nodes | Returns a reference to the collection of all Node objects of the diagram.
NoPrefix | Determines whether the '&' character in the text of a node appears as a '_'.
OrientedText | Determines whether the text of a link can be drawn in the same direction as the link itself.
OrthogonalDynamic | Determines whether the link is composed of several orthogonal segments...
Parent | Returns the form on which an object is located.
PicturePosition | Returns /sets the default Node object picture position.
Pictures | Collection of pictures that can be used to display a picture in a node.
PointedArea | Returns the type of the area pointed by the mouse.
PointedLink | Returns a reference to the Link object pointed by the mouse.
PointedNode | Returns a reference to the Node object pointed by the mouse.
ProportionalBars | Determines whether the scrollbar thumbs should be proportional to the size of the visible area.
ReadOnly | Determines whether user interaction is allowed or not.
RedoCode | Returns the code of the next redoable action.
RemovePointAngle | Returns/sets the angle that causes a link point to be removed when stretching a link.
Repaint | Determines whether repainting the control is allowed or not.
Rigid | Determines whether Link objects are by default rigid or not.
RoundedCorner (v5) | Determines whether, by default, there is a rounded corner at the intersection point of 2 segments of the next created links.
RoundedCornerSize (v5) | Returns/sets a value which defines the size of the rounded corners of the link segments.
RouteGrain (v5) | Determines the number of steps taken when trying to find a route around nodes.
RouteMinDistance (v5) | Determines the minimum distance between a segment of the link and an obstacle.
RouteStartMethod (v5) | Determines the sides of the origin node from which the link autorouting is to start.
ScrollBars | Allows adding scrollbars for the control.
ScrollTrack | Determines whether scrolling should occur while the user moves the scroll thumb.
ScrollWheel | Determines whether scrolling should occur while the user moves the mouse wheel.
SelectAction | Returns/sets the selection rectangle action (select items, zoom,...).
SelectedLink | Returns/sets a value which determines if a Link object is selected..
SelectedNode | Returns/sets a value which determines if a Node object is selected.
SelectionHandleSize | Returns/sets a value which defines the size of the selection handles of the selected node.
SelectMode | Determines whether selection mode is set instead of drawing mode.
SelLinks | Returns a reference to the collection of all selected links.
SelNodes | Returns a reference to the collection of all selected nodes.
Shadow | Returns/sets the default shadow style.
ShadowColor | Returns/sets the color used for the node shadows.
Shape | Returns/sets the default Node object shape.
ShapeOrientation | Returns/sets the default shape orientation (0,90,180 or 270°) of nodes.
ShowGrid | Determines whether the grid is displayed or not.
ShowJump | Returns/sets a value which determines whether jumps are by default displayed at the intersection of links.
ShowPropertyPages | Defines what property pages will be displayed at runtime when the user makes a mouse right click.
ShowToolTip | Determines whether you can display node and link tooltips.
SnapToGrid | Determines whether nodes and links are aligned to the grid.
SizeArrowDst | Returns/sets the default Link object origin arrow size.
SizeArrowMid | Returns/sets the default Link object middle segment arrow size.
SizeArrowOrg | Returns/sets the default Link object destination arrow size.
SkipUndo (v5) | Determines whether the next actions are recorded in the undo manager.
StretchingPoint | Deturns the index of the current stretching point.
TabIndex | Returns/sets the tab order of an object within its parent form.
TabStop | Returns/sets a value indicating whether a user can use the TAB key to give the focus to an object.
Tag | Stores any extra data needed for your program.
Top | Returns /sets the distance between the internal top edge of an object and the top edge of its container.
Transparent | Determines whether Node objects are transparent or not.
Visible | Returns/sets a value that determines whether an object is visible or hidden.
UndoCode | Returns the code of the next undoable action.
UndoSize | Sets and returns the number of undo commands that can be performed.
Width | Returns/sets the width of an object.
XExtent | Returns the width of the whole diagram
XGrid | Returns/sets the horizontal grid.
XScroll | Returns/sets the horizontal scrolling offset.
XShadowOffset | Returns/sets the horizontal shadow offset.
XZoom | Returns/sets the horizontal zooming factor.
YExtent | Returns the height of the whole diagram
YGrid | Returns/sets the vertical grid.
YScroll | Returns/sets the vertical scrolling offset.
YShadowOffset | Returns/sets the vertical shadow offset.
YZoom | Returns/sets the vertical zooming factor.

List of methods

BeginAction | Starts a group of actions that can be undone in one time.
CanPaste | Indicates if a paste operation can be performed
CanRedo | Indicates if there is an action that can be redone.
CanUndo | Indicates if there is an action that can be undone.
Copy | Copies a diagram or a part of it onto the clipboard
DeleteSel | Removes all selected nodes and their associated links.
DeleteMarked | Removes all marked nodes (and their associated links) and all marked links.
DisplayPropertyPage | Displays the AddFlow property page.
EndAction | Terminates a group of actions that can be undone in one time.
ExportPicture | Exports a diagram or a part of it as a picture (enhanced metafile)
GetLinkAtPoint | Returns a reference to the link placed at logical coordinates.
GetNodeAtPoint | Returns a reference to the node placed at logical coordinates.
GetVersion | Returns control version.
IsChanged | Returns the change flag.
IsSelChanged | Returns the selection change flag.
LoadFile | Loads a diagram from a file.
LoadMemory | Loads a diagram from memory.
Paste | Pastes items from the clipboard to a diagram.
Redo | Redoes, if possible, the last action.
Refresh | Forces a complete repaint of the control.
SaveFile | Saves the diagram in a file.
SaveImage | Saves the diagram in metafile (standard or enhanced) format.
SaveMemory | Saves a diagram in memory.
SelectAll | Selects all nodes.
SelectRectangle | Selects the nodes and links placed in a rectangle.
SetChangedFlag | Resets the change flag.
SetSelChangedFlag | Resets the selection change flag.
StartEdit | This method enables a user to edit a text inside a node.
Undo | Undoes, if possible, the last action.
ZoomRectangle | Zoom a rectangular portion of the diagram.

List of events

All AddFlow events, except three, are standards and are listed below. See the Visual Basic Language Reference or online Help for documentation of the those events.

afGotFocus | Got focus event (for environments that do not support it automatically)
afLostFocus | Lost focus event (for environments that do not support it automatically)
AfterAddLink | Occurs after a user creates a link.
AfterAddNode | Occurs after a user creates a node.
AfterEdit | Occurs after a user edits the text of the selected node.
AfterMove | Occurs after a user drags nodes.
AfterResize | Occurs after a user resizes a node.
AfterSelect | Occurs after a user selects items inside a selection rectangle.
AfterStretch | Occurs after a user stretches a link.
BeforeAddLink | Occurs when a user attempts to create a link.
BeforeAddNode | Occurs when a user attempts to create a node.
BeforeChangeDst (v5) | Occurs when a user attempts to change the destination node of a link.
BeforeChangeOrg (v5) | Occurs when a user attempts to change the origin node of a link.
BeforeEdit | Occurs when a user attempts to edit the text of the selected node. Cancelling the action aborts the inline edit.
Click | Fired when the user presses and then releases a mouse button over the control.
DblClick | Fired when you press and release a mouse button and then press and release it again over the control.
DragDrop | Fired when a drag/drop action is terminated. This event is automatically added by Visual Basic.
DragOver | Fired when there is a drag/drop action. This event is automatically added by Visual Basic.
Error | Fired when an error occurs within AddFlow outside of the scope of a method call or property access.
GotFocus | Fired when the object receives the focus. This event is automatically added by Visual Basic. In other environments, use afGotFocus.
KeyDown | Fired when the user presses a key while an object has the focus.
KeyPress | Fired when the user presses and releases an ANSI key.
KeyUp | Fired when the user releases a key while an object has the focus.
LostFocus | Fired when the object looses the focus. This event is automatically added by Visual Basic. In other environments, use afLostFocus.
MouseDown | Fired when the user presses the mouse button while an object has the focus.
MouseMove | Fired when the user moves the mouse.
MouseUp | Fired when the user releases the mouse button while an object has the focus.
Scroll | Fired each time the diagram is scrolled.

Node Programming Reference Overview

Node Properties

Alignment | Sets or returns the alignment of text in the node.
AutoSize | Allows adjusting node size to picture size or adjust picture size to node size.
BackMode | Determines whether the background will remain untouched or not behind the text of a node or a link.
DrawColor | Returns/sets the pen color used to draw the node.
DrawStyle | Returns/sets the pen style used to draw the node.
DrawWidth | Returns/sets the pen width used to draw the node.
EditMode | Determines whether a user can edit the text of the node.
FillColor | Returns/sets the color used to fill the node.
Font | Returns/sets the font used to display the node text.
ForeColor | Returns/sets the foreground color used to display the node text.
Height | Returns/sets the height of the bounding rectangle of the node.
Hidden | Determines whether the node is visible or hidden.
Index | Returns the index of the node in the nodes collection.
InLinks | Returns a reference to the collection of links that come to the node.
Key | Returns/sets the unique key associated with a node.
Left | Returns/sets the left position of the bounding rectangle of the node.
Links | Returns a reference to the collection of links whose origin or destination is a node.
Logical | Determines if the node is in the logical flow.
Marked | Returns/sets a flag associated with the node.
MaxDegree | Returns/sets the maximum number of links for the node.
MaxInDegree | Returns/sets the maximum number of incoming links for the node.
MaxOutDegree | Returns/sets the maximum number of outgoing links for the node.
Moveable | Determines whether the node can be moved with the mouse or not.
OutLinks | Returns a reference to the collection of links that leave the node.
Picture | Returns/sets the picture to be displayed in the node.
PictureIndex | Returns/sets the index of the node picture.
PicturePosition | Returns/sets the node picture position.
Selectable | Determines if the node is active or readonly.
Selected | Determines if the node is selected or not.
Shadow | Returns/sets the node shadow style.
Shape | Returns/sets the node shape.
ShapeOrientation | Returns/sets the shape orientation (0,90,180 or 270°) of the node.
Sizeable | Determines whether the node can be resized with the mouse or not.
Tag | Returns/sets the tag associated with the node.
TagVariant | Returns/sets a variant value associated to a node or a link.
Text | Returns/sets the text associated with the node
ToolTip | Returns/sets the node displayed tooltip
Top | Returns/sets the top position of the bounding rectangle of the node.
Transparent | Determines whether the node is transparent or not.
UserData | Returns/sets a numeric data associated with the node.
Width | Returns/sets the width of the bounding rectangle of the node
xMoveable | Determines whether a node can be horizontally moved or not.
xScrollable | Determines whether the node can be horizontally scrolled or not.
xSizeable | Determines whether a node can be horizontally resized or not.
xTextMargin | Returns/sets the size of the horizontal margin for the text of the node.
yMoveable | Determines whether a node can be vertically or vertically moved or not.
yScrollable | Determines whether the node can be vertically scrolled or not.
ySizeable | Determines whether a node can be vertically resized or not.
yTextMargin | Returns/sets the size of the vertical margin for the text of the node.
ZOrder | Places a node at the front or back of the z-order.
ZOrderIndex | Returns/sets the position of the node in the z-order list.

Node Methods

Clone | Creates a node as a copy of another one.
EnsureVisible | Scrolls the diagram so that the node is displayed at the center of the control window.
GetLinkedNode | Returns the node connected via a given link.
PropertyPage | Displays the property page of the node.

Link Programming Reference Overview

Link Properties

AdjustDst | Determines whether you can adjust the destination point of the link.
AdjustOrg | Determines whether you can adjust the origin point of the link.
ArrowDst | Returns/sets the link destination arrow shape.
ArrowMid | Returns/sets the link middle segment arrow shape.
ArrowOrg | Returns/sets the link origin arrow shape.
BackMode | Determines whether the background will remain untouched or not behind the text of a node or a link.
DrawColor | Returns/sets the pen color used to draw the link.
DrawStyle | Returns/sets the pen style used to draw the link.
DrawWidth | Returns/sets the pen width used to draw the link.
ExtraPoints | Returns a reference to the collection of the link points.
Dst | Returns/sets the reference of the destination node of the link
Font | Returns/sets the font used to display the link text.
ForeColor | Returns/sets the foreground color used to display the link text.
Hidden | Determines whether the link is visible or hidden.
InIndex | Returns the index of the link in int destination node “ InLinks ” collection.
Key | Returns/sets the unique key associated with a link.
LinkStyle | Returns/sets the style (polyline, bezier) used to draw the link.
Logical | Determines if the link is in the logical flow.
Marked | Returns/sets a flag associated with the link.
Org | Returns/sets the reference of the origin Node object of the link.
OrientedText | Determines whether the text of the link can be drawn in the same direction as the link itself.
OrthogonalDynamic | Determines whether the link is composed of several orthogonal segments (vertical or horizontal) so that the first and last segments of the link are orthogonal to the origin and destination nodes.
OutIndex | Returns the index of the link in its origin node “ OutLinks ” collection.
Rigid | Determines if the link is rigid or not.
RoundedCorner (v5) | Determines whether there is a rounded corner at the intersection point of 2 segments of the link.
Selectable | Determines if the link is active or readonly.
Selected | Determines if the link is selected or not.
ShowJump | Returns/sets a value which determines whether jumps are displayed at the intersection of the link with other links.
SizeArrowDst | Returns/sets the link origin arrow size.
SizeArrowMid | Returns/sets the link middle segment arrow size.
SizeArrowOrg | Returns/sets the link destination arrow size.
Stretchable | Determines whether the link is stretchable or not.
Tag | Returns/sets the tag associated with the link.
TagVariant | Returns/sets a variant value associated to a node or a link.
Text | Returns/sets the text associated with the link.
TextSegment | Returns/sets the number of the segment used to display the text.
ToolTip | Returns/sets the link displayed tooltip.
UserData | Returns/sets a numeric data associated with the link.
Zorder | Places a link at the front or back of the z-order.
ZOrderIndex | Returns/sets the position of the link in the z-order list.

Link Methods

Clone | Creates a link as a copy of another one.
EnsureVisible | Scrolls the diagram so that the link is displayed at the center of the control window.
PropertyPage | Displays the property page of the link.
Reverse | Reverses the origin and the destination of a link.

CustomShape Programming Reference Overview

CustomShape Properties

Count Returns the number of points that define the custom shape polygon.

CustomShape Methods

AddPoint | Add a point to the set of points that allows defining the custom shape polygon.
Clear | Remove all the polygon points of a CustomShape object

LinkPoint Properties

x | Horizontal coordinate of a point
y | Vertical coordinate of a point

Nodes collection

Add | Add a node to a collection of nodes.
Clear | Erase all the nodes of a collection of nodes.
Count | Returns the number of nodes in a collection of nodes.
Item | Returns the reference to a node object of a collection of nodes.
Remove | Remove a node from a collection of nodes.

Links collection

Add | Add a link to a collection of links.
Clear | Erase all the links of a collection of links.
Count | Returns the number of links in a collection of links.
Item | Returns the reference to a link object of a collection of links.
Remove | Remove a link from a collection of links.

LinkPoints collection

This defines the link points collection. For instance, if a link has 3 segments, its link points collection contains 4 points. Each link has such a collection. Each link points collection has at least 2 points (corresponding to one segment). If you clear the link points collection, then the number of points is equal to 2.
If the LinkStyle property of the link is either afPolyline, afBezier or afSpline, you can add or remove points to that collection.

Add | Add a point to a collection of points.
Clear | Erase all the points of a collection of points.
Count | Returns the number of points in a collection of points.
Item | Returns the reference to a point object of a collection of points.
Remove | Remove a point from a collection of points.

Pictures collection

This defines the collection of the pictures that can be used to be displayed in the nodes.
You should add the pictures you need to this collection when your application starts. For instance, if your application requires to use 3 kind of pictures, you could fill your picture collection using the following code:

AddFlow1.Pictures.Add Picture1
AddFlow1.Pictures.Add Picture2
AddFlow1.Pictures.Add Picture3

Then, if for instance, you wish to assign the second picture to a node, you will just have to write:

node.PictureIndex = 2

Note that you cannot remove a picture from the collection (no Remove method). The only possibility is to clear the collection and recreate it. You will have to update the PictureIndex property of the nodes.

Add | Add a picture to the collection of pictures.
Clear | Erase all the pictures of the collection of pictures.
Count | Returns the number of pictures in the collection of pictures.
Item | Returns the reference to a picture object of the collection of pictures.

CustomShapes collection

This defines the collection of the custom shapes that can be used to draw nodes. See Custom shapes

Note that you cannot remove a custom shape from the collection (no Remove method). The only possibility is to clear the collection and recreate it. You will have to update the CustomShapeIndex property of the nodes.

Add | Add a custom shape to the collection of custom shapes.
Clear | Erase all the custom shape objects of the collection of custom shapes.
Count | Returns the number of custom shape objects in the collection of custom shapes.
Item | Returns the reference to a custom shape object of the collection of custom shapes.


AdjustDst

AdjustOrg, AdjustDst Property

Description

If applied to a link, it determines whether it is possible to adjust the position of the first and last point of this link.
If applied to an AddFlow control, it whether it is possible to adjust the position of the first and last point of next created links.

Syntax

object.AdjustOrg =  value
object.AdjustDst =  value
value = object.AdjustOrg
value
 = object.AdjustDst

Arguments | Description
object | Object expression that references an AddFlow control or a link object.
value | A boolean which determines if it is possible to adjust the position of the first and last point of the link.

See Also

Adjust the link origin and destination points


Alignment Property

Description

If applied to a node, it returns/sets its text alignment style.
If applied to an AddFlow control, it returns/sets the default node text alignment style. When a node is created, it has this alignment value.

Syntax

object.Alignment = value
value = object.Alignment

Arguments | Description
object | Object expression that references an AddFlow control or a node object.
value | An integer value which defines the alignment of the text in a node.

The settings for value are:

Constants | Value | Description
afLeftJustifyTOP | 0 | Left Justify - TOP
afLeftJustifyMIDDLE | 1 | Left Justify - MIDDLE
afLeftJustifyBOTTOM | 2 | Left Justify - BOTTOM
afRightJustifyTOP | 3 | Right Justify - TOP
afRightJustifyMIDDLE | 4 | Right Justify - MIDDLE
afRightJustifyBOTTOM | 5 | Right Justify - BOTTOM
afCenterTOP | 6 | Center - TOP
afCenterMIDDLE | 7 | Center - MIDDLE (default)
afCenterBOTTOM | 8 | Center - BOTTOM


AutoSize Property

Description

This property allows adjusting node size to picture size or adjust picture size to node size.
If applied to a node, it returns/sets its AutoSize style.
If applied to an AddFlow control, it returns/sets the default node AutoSize style. When a node is created, it has this AutoSize value.

Syntax

object.AutoSize = value
value = object.AutoSize

Arguments | Description
object | Object expression that references an AddFlow control or a node object.
value | An integer value which defines the AutoSize style.

The settings for value are:

Constants | Value | Description
afNoAutoSize | 0 | None (default)
afAdjustPictureSizetoNode | 1 | Adjust Picture Size to Node
afAdjustNodeSizetoPicture | 2 | Adjust Node Size to Picture
afAdjustNodeSizetoText | 3 | Adjust Node Size to Text dimensions


AllowArrowKeys Property

Description

Determines whether arrow keys can be used to scroll the diagram.

Syntax

object.AllowArrowKeys = value
value = object.AllowArrowKeys

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines if arrow keys can be used to scroll the diagram.

Default value

True

See Also

Capabilities topic


ArrowDst

ArrowOrg, ArrowDst, ArrowMid Properties

Description

If applied to a link, it returns/sets its origin arrow shape (ArrowOrg) or its destination arrow shape (ArrowDst) or the arrow shape at the middle of each segment of the link (ArrowMid).
If applied to an AddFlow control, it returns/sets the default link origin arrow shape, the default link destination arrow shape or default link middle segment arrow shape. When a link is created, it receives those default link shapes.

Syntax

object.ArrowOrg = value
object.ArrowDst = value
object.ArrowMid = value
value = object.ArrowOrg
value = object.ArrowDst
value = object.ArrowMid

Arguments | Description
object | Object expression that references an AddFlow control or a link object.
value | An integer value which defines the shape of the arrow.

The settings for value are:

Default value

By default, ArrowDst is set to afEmptyArrow15, ArrowOrg is set to afNone, ArrowMid is set to afNone.

Remarks

  • The ArrowMid property value is not taken into account if the LinkStyle property value is afBezier or afSpline.
  • The size of the arrow head can be set by the SizeArrowDst, SizeArrowMid, SizeArrowOrg properties

See Also

SizeArrowDst, SizeArrowMid, SizeArrowOrg properties


Autorouting Property

Description

Determines whether the autorouting mode for links is set (see Autorouting).

Syntax

object.Autorouting = value
value = object.Autorouting

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines if the Autorouting mode is set.

Default value

False

See Also

Autorouting topic, Capabilities topic


AutoScroll Property

Description

Determines whether automatic scrolling is allowed or not. Automatic scrolling means for instance that when the user moves a node outside the visible part of the control, the control scrolls automatically so that the node stays visible.

Syntax

object.AutoScroll = value
value = object.AutoScroll

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines if automatic scrolling is allowed.

Default value

True

See Also

Scrolling topic


BackMode Property

Description

If applied to a node or a link, it determines whether the background remains untouched or if the background is filled with the current background color before the text.
If applied to an AddFlow control, it determines whether the background will remain untouched or not for the text of the next created nodes and links.

Syntax

object.BackMode = value
value = object.BackMode

Arguments | Description
object | Object expression that references an AddFlow control, a node or a link object.
value | An integer value which defines the BackMode style.

The settings for value are:

Constants | Value | Description
afBackModeTransparent | 1 | Transparent
afBackModeOpaque | 2 | Opaque

Default value

afBackModeOpaque


BackPicture Property

Description

This property is the same as the standard Visual Basic Picture property. It allows you to display a picture (bitmap, a standard metafile or an enhanced metafile) in the background of the diagram.

Remark

You cannot adjust the size of the back picture, align it, tile it or scale it. However, you can implement such a picture with a node with a picture inside. This node can be resized so that it scales to the size of the control. Make this node without any border (node.DrawStyle = afTransparent) and unselectable (node.Selectable = false).


CanReflexLink Property

CanChangeDst, CanChangeOrg Properties

Description

Determines whether it is allowed to interactively change the destination point (or the origin point) of a link.

Syntax

object.CanChangeDst = value
value = object.CanChangeDst

object.CanChangeOrg = value
value = object.CanChangeOrg

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines if it is allowed to interactively change the destination point (or the origin point) of a link.

Default value

True

See Also

Capabilities topic


CanDrawLink Property

Description

Determines whether you can create links interactively or not. If the value of this property is False, then the handle at the middle of the node is not displayed.

Syntax

object.CanDrawLink = value
value = object.CanDrawLink

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines if a user can create links interactively.

Default value

True

Remark

You'll have to do a refresh just after changing the value of this property.

Example 1

AddFlow1.CanDrawLink = False  'or True
AddFlow1.Refresh

See Also

Capabilities topic


CanDrawNode Property

Description

Determines whether you can create nodes interactively or not.

Syntax

object.CanDrawNode = value
value = object.CanDrawNode

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines if a user can create nodes interactively.

Default value

True

See Also

Capabilities topic


CanFireError Property

Description

Determines if the error event is fired or not.

For instance, suppose that your diagram has two nodes A and B and a link from A to B. Suppose also that the CanMultiLink property is false. If the user draws a new link from A to B, the link will not be created because CanMultiLink is false. If CanFireError is true, an Error event is fired and by default, this causes an error message box to be displayed (this default behaviour can be modified). If CanFireError is false, no event is fired. The user just sees that the link is not created.

Syntax

object.CanFireError = value
value = object.CanFireError

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines if the error event is fired or not.

Default value

False

See Also

Capabilities topic, Error event


CanMoveNode Property

Description

Determines whether you can move (drag) nodes interactively or not

Syntax

object.CanMoveNode = value
value = object.CanMoveNode

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines if a user can move nodes interactively.

Default value

True

See Also

Capabilities topic


CanMultiLink Property

Description

Determines whether you can create several links between two nodes or not.

Syntax

object.CanMultiLink = value
value = object.CanMultiLink

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines if a user can create several links between two nodes.

Default value

True

See Also

Capabilities topic


CanReflexLink Property

Description

Determines whether you can create reflexive links. A link is reflexive if its destination and origin nodes are the same.

Syntax

object.CanReflexLink = value
value = object.CanReflexLink

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines if a user can create reflexive links.

Default value

True

Remark

A reflexive link is created with 4 points.

See Also

Capabilities topic


CanSizeNode Property

Description

Determines whether you can resize nodes interactively or not. If the value of this property is False, then the node sizing handles are white, which mean you cannot use them to resize the node. The handles are still visible since they allow to know that the node is selected. See DisplayHandles property in order to avoid displaying handles.

Syntax

object.CanSizeNode = value
value = object.CanSizeNode

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines if a user can resize nodes interactively.

Default value

True

Remark

You'll have to do a refresh just after changing the value of this property.

Example 1

AddFlow1.CanSizeNode = False  'or True
AddFlow1.Refresh

See Also

Capabilities topic


CanStretchLink Property

Description

Determines whether you can "stretch" links (i.e add or remove segments) interactively or not. If the value of this property is True, then the link handles are white, which mean you cannot use them to strech the link. The handles are still visible since they allow to know that the link is selected. See DisplayHandles property in order to avoid displaying handles.

Syntax

object.CanStretchLink = value
value = object.CanStretchLink

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines if a user can stretch links.

Default value

True

Remark

You'll have to do a refresh just after changing the value of this property.

Example 1

AddFlow1.CanStretchLink = False  'or True
AddFlow1.Refresh

See Also

Capabilities topic


CanUndoRedo Property

Description

Determines whether undo/redo is allowed.

Syntax

object.CanUndoRedo = value
value = object.CanUndoRedo

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines if undo/redo is allowed.

Default value

True

Remark

If you set this property to false, the undo/redo feature is disabled and the undo/redo buffer is cleared.

See Also

Undo/Redo topic, Capabilities topic


PictureIndex Property

CustomShapeIndex Property

Description

If applied to a node, it returns/sets the index of a custom shape stored in an array of custom shapes defined by the CustomShapes property.
If applied to an AddFlow control, it returns/sets the default index of a custom shape stored in the array of custom shapes defined by the CustomShapes property.

Syntax

object.CustomShapeIndex = index
index = object.CustomShapeIndex

style | Description
object | Object expression that references an AddFlow control or a node object.
index | An integer that defines the index of a custom shape. 1 defines the first custom shape. 0 indicates that the node has not any custom shape associated.

See Also

CustomShapes property


ItemPicture Property

CustomShapes Property

Description

Returns a reference to the collection of the custom shapes that can be used to draw a node
Not available at design time. Read-only at run-time.

Syntax

Set coll = object.CustomShapes

style | Description
object | Object expression that references an AddFlow control.
coll | Object expression that references a collection of custom shapes

Remarks

See Also

Custom Shapes topic, CustomShapeIndex property


CanDrawLink Property

CycleMode Property

Description

Returns/sets a value that determines whether cycles are accepted or not.

Syntax

object.CycleMode = value
value = object.CycleMode

Arguments | Description
object | Object expression that references an AddFlow control.
value | An integer that defines the cycle mode.

The settings for value are:

Constants | Value | Description
afCyclesAllowed | 0 | Cycles are allowed (default)
afNoCycle | 1 | Cycles not allowed.
afNoDirectedCycle | 2 | Directed cycles are not allowed

Default value

afCyclesAllowed

Remarks

  • If the LogicalOnly property is true, then only the Logical nodes and links are taken into account to determine if there are cycles.
  • Reflexive links are ignored.
  • The afNoCycle setting allows to build an acyclic graph. Acyclic mean's there are no cycles. A cycle is a path with the same node at the beginning and the end. A path is a sequence of links (x[i], y[i]) where x[i+1] = y[i].
  • The afNoDirectedCycle setting allows to build an directed acyclic graph (DAG). A directed graph is one where the order of the nodes in a link makes a difference; i.e. the link (a,b) is different from the link (b,a).
  • In the following graph:
    - if CycleMode = afNoCycle, you will not be able to interactively draw a link from C to D or from D to C.
    - if CycleMode = afNoDirectedCycle, you will not be able to interactively draw a link from C to D. However, you will have the possibility to draw a link from D to C.

See Also

Capabilities topic, LogicalOnly property, Logical property


DisplayHandles Property

Description

Determines whether handles are displayed. The handles are the little black squares on the selected node or link. If handles are not displayed, then the user cannot interactively resize nodes, create or stretch links. In such a situation, if you (the developper that is using AddFlow) need to emphasize the selected node or link, you have to do it yourself (by changing its color for instance).

Syntax

object.DisplayHandles = value
value = object.DisplayHandles

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines if handles are displayed.

Default value

True

Remark

You'll have to do a refresh just after changing the value of this property.

Example 1

AddFlow1.DisplayHandles = False
AddFlow1.Refresh

See Also

Capabilities topic


DrawColor Property

Description

If applied to a node or a link, it returns/sets the pen color used to draw it.
If applied to an AddFlow control, it returns/sets the default color used to draw nodes or links. When a node or a link is created, it is displayed with this drawing color.

Syntax

object.DrawColor = color
color = object.DrawColor

Arguments | Description
object | Object expression that references an AddFlow control, a node or a link object.
color | The pen color used to draw a node or a link.

The settings for color are:

Value | Description
Normal RGB Colors | Color set with RGB or QBColor function in code
System Default Colors | Colors specified with the system color constants from CONSTANT.TXT, a Visual Basic file that you can load into a project's global module. Window's substitutes the user's choices, as specified through the user's Control Panel Settings.

By default, DrawColor is set to 0 (black)


DrawStyle Property

Description

If applied to a node or a link, it returns/sets the pen style used to draw it.
If applied to an AddFlow control, it returns/sets the default pen style used to draw nodes or links. When a node or a link is created, it is displayed with this drawing pen style.

Syntax

object.DrawStyle= value
value = object.DrawStyle

Arguments | Description
object | Object expression that references an AddFlow control, a node or a link object.
value | An integer value which defines the drawing style.

The settings for value are:

Constants | Value | Description
afSolid | 0 | Solid (default)
afDash | 1 | Dash
afDot | 2 | Dot
afDashDot | 3 | Dash-Dot
afDashDotDot | 4 | Dash-Dot-Dot
afTransparent | 5 | Transparent
afInsideSolid | 6 | Inside Solid

Remarks

If DrawWidth is set to a value greater than 1, then DrawStyles 1 through 4 produce a solid line (the DrawStyle property value is not changed). If DrawWidth is set to 0 or 1, DrawStyle produces the effect described above for each setting.


DrawWidth Property

Description

If applied to a node or a link, it returns/sets the pen width used to draw it.
If applied to an AddFlow control, it returns/sets the default pen width used to draw nodes or links When a node or a link is created, it is displayed with this drawing pen style.

Syntax

object.DrawWidth = size
size = object.DrawWidth

Arguments | Description
object | Object expression that references an AddFlow control, a node or a link object.
size | An integer value which defines the pen drawing size.

Setting

You can set DrawWidth to a value of 0 to 8 (pixels).

If DrawWidth = 0, the pen used to draw nodes and links is a single pixel wide, regardless of the current zoom value. This is interesting if you use a DrawStyle other than afSolid, afInsideSolid or afTransparent. Normally, if the zoom factor is not 100% or if you print the diagram, a dotted line is drawn as a solid line. If the DrawWidth is 0, it will still be drawn as a dotted line.


EditMode Method

EditHardReturn Method

Description

Determines which characters to use for a hard return when editing text inside a node.

Syntax

object.EditHardReturn = style
style = object.EditHardReturn

Arguments | Description
object | Object expression that references an AddFlow control
style | An integer value which defines the hard return character.

The settings for style are:

Constants | Value | Description
afEditCtrlReturn | 0 | Control key
afEditShiftReturn | 1 | Shift key

Default value

afEditCtrlReturn


EditMode Method

Description

If applied to a node, it returns/sets a value that determines whether a user can edit the text of the node.
If applied to an AddFlow control, it returns/sets the default editable status of nodes. When a node is created, it has this edit behaviour.

Syntax

object.EditMode = mode
mode = object.EditMode

Arguments | Description
object | Object expression that references an AddFlow control or a node object.
mode | An integer value which defines the node editable status.

The settings for mode are:

Constants | Value | Description
afEditNone | 0 | No in place edition
afEditMouseClick | 1 | Edition initiated with a mouse click (default)
afEditMouseDoubleClick | 2 | Edition initiated with a mouse double click

Default value

afEditMouseClick


Ellipsis Method

Description

Returns/sets a value that determines if a part of a node text can be replaced with ellipses.

Syntax

object.Ellipsis = value
value = object.Ellipsis

Arguments | Description
object | Object expression that references an AddFlow control.
value | An integer value which defines if a part of a node text can be replaced with ellipses.

The settings for value are:

Constants | Value | Description
afNoEllipsis | 0 | No Ellipsis
afEllipsisEnd | 1 | If the end of the node text does not fit in the node rectangle, it is truncated and ellipses are added.
afEllipsisPath | 2 | Replaces characters in the middle of the node text with ellipses so that the result fits in the node rectangle.

Default value

afNoEllipsis


FillColor Property

Description

If applied to a node, it returns/sets the color used to fill it.
If applied to an AddFlow control, it returns/sets the default color used to fill nodes. When a node is created, it is displayed with this filling color.

Syntax

object.FillColor = color
color = object.FillColor

Arguments | Description
object | Object expression that references an AddFlow control or a node object.
color | The node filling color.

The settings for color are:

Value | Description
Normal RGB Colors | Color set with RGB or QBColor function in code
System Default Colors | Colors specified with the system color constants from CONSTANT.TXT, a Visual Basic file that you can load into a project's global module. Window's substitutes the user's choices, as specified through the user's Control Panel Settings.


Font Property

Description

Sets or returns the font used to display the text associated to a node or a link.
If applied to a node or a link, it returns/sets its font used to display its text.
If applied to an AddFlow control, it returns/sets the default font used to display the text of a node or a link. When a node or a link is created, it has this default font.

Syntax

Set object.Font = font
Set font = object.Font

Arguments | Description
object | Object expression that references an AddFlow control, a node or a link object.
font | A font object which describes the font used to display the text of a node or a link.

Remark

If you need to change the text color, you have to use the ForeColor property


ForeColor Property

Description

If applied to a node or a link, it returns/sets the foreground color used to display its text.
If applied to an AddFlow control, it returns/sets the default foreground color used to display the text of next created nodes or links.

Syntax

object.ForeColor = color
color = object.ForeColor

Arguments | Description
object | Object expression that references an AddFlow control, a node or a link object.
color | The foreground color.

The settings for color are:

Value | Description
Normal RGB Colors | Color set with RGB or QBColor function in code
System Default Colors | Colors specified with the system color constants from CONSTANT.TXT, a Visual Basic file that you can load into a project's global module. Window's substitutes the user's choices, as specified through the user's Control Panel Settings.

By default, ForeColor is set to 0 (black).


EditMode Method

Gradient Method

Description

If applied to a node, it returns/sets a value that determines the kind of the linear gradient when drawn in the node.
If applied to an AddFlow control, it returns/sets the default kind of the linear gradient used for nodes. When a node is created, it has this gradient behaviour.

Syntax

object.Gradient = mode
mode = object.Gradient

Arguments | Description
object | Object expression that references an AddFlow control or a node object.
mode | An integer value which defines the node gradient mode

The settings for mode are:

Constants | Value | Description
afGradientNone | 0 | no gradient (default)
afGradientHorizontal | 1 | horizontal gradient
afGradientVertical | 2 | vertical gradient

Default value

afGradientNone


FillColor Property

GradientColor Property

Description

If applied to a node, it returns/sets the color used to draw a gradient with the FillColor.
If applied to an AddFlow control, it returns/sets the default color used to draw a gradient with the FillColor. When a node is created, it is displayed with this gradient color.

Syntax

object.GradientColor = color
color = object.GradientColor

Arguments | Description
object | Object expression that references an AddFlow control or a node object.
color | The node gradient color.

The settings for color are:

Value | Description
Normal RGB Colors | Color set with RGB or QBColor function in code
System Default Colors | Colors specified with the system color constants from CONSTANT.TXT, a Visual Basic file that you can load into a project's global module. Window's substitutes the user's choices, as specified through the user's Control Panel Settings.


GridStyle Property

Description

It returns/sets the drawing style of the grid.

Syntax

object.GridStyle = style
style = object.GridStyle

Arguments | Description
object | Object expression that references an AddFlow control.
style | An integer that defines the grid style.

The settings for style are:

Constants | Value | Description
afPixels | 0 | Pixels
afLines | 1 | Lines
afDottedLines | 2 | Dotted Lines

See Also

Grid topic


Hidden Property

Description

If applied to a node or a link, it determines whether it is visible or hidden.
If applied to an AddFlow control, it determines whether nodes and links are by default visible or hidden.

Syntax

object.Hidden = value
value = object.Hidden

Arguments | Description
object | Object expression that references an AddFlow control, a node or a link object.
value | A boolean which determines if the object is hidden.

Default value

False


LinkingHandleSize Property

JumpSize Property

Description

Returns/sets a value which defines the size of the jumps at the intersection of links.

Syntax

object.JumpSize = value
value = object.JumpSize

Arguments | Description
object | Object expression that references an AddFlow control.
value | An integer that defines the size of the jumps.

The settings for value are:

Constants | Value | Description
afSmallJump | 0 | Small jumps
afMediumJump | 1 | Medium jumps
afLargeJump | 2 | Large jumps

Default

afMediumJump


LastUserAction Property

Description

Returns the last user action.

Syntax

action = object.LastUserAction

Arguments | Description
object | Object expression that references an AddFlow control.
action | An integer that defines the last user action

The settings for action are:

Constants | Value | Description
afNoUserAction | 0 | None
afNodeCreation | 1 | Node creation action
afLinkCreation | 2 | Link creation action
afNodeDragging | 3 | Node dragging action
afNodeResizing | 4 | Node resizing action
afLinkStretching | 5 | Link stretching action
afSelection | 6 | Selection action

Remark: The afSelection case occurs when the SelectMode property is True and when you make a selection when moving the mouse (with button down).

VB Example

' The following code allows to associate text to nodes and links
' as soon as those objects are created by the user with the mouse.
' You should copy this code and paste it into the MouseUp procedure of
' an AddFlow control.
Dim Action As Long, node as afNode, link as afLink

With AddFlow1
  Action = .LastUserAction()
  Select case Action
    Case afNodeCreation  ' Node creation
      ' Display the node index
      Set node = .SelectedNode
      node.Text = Str(node.Index())
    Case afLinkCreation  ' Link creation
      ' Display the link origin and destinations nodes index
      Set link = .SelectedLink
      link.Text = Str(link.Org.Index()) + "," + Str(link.Dst.Index())
  End Select
End With

VC Example

// The following code
allows to associate text to nodes and links
// as soon as those objects are created by the user with the mouse.
// You should copy this code and paste it into the MouseUp procedure of
// an AddFlow control.
long action;
CNode node;
CLink link;
char s[10];

action = m_AddFlow.GetLastUserAction();
switch(action)
{
case afNodeCreation:
// Node creation
// Display the node index
node = m_AddFlow.GetSelectedNode();
wsprintf(s, "%ld", node.GetIndex());
node.SetText(s);
break;
case afLinkCreation:   //
Link creation
// Display the link origin and destinations nodes index
link = m_AddFlow.GetSelectedLink();
wsprintf(s, "%ld,%ld",
  link.GetOrg().GetIndex(),link.GetDst().GetIndex());
link.SetText(s);
break;
}


LinkCreationMode Property

Description

Returns/sets the link creation mode.

The default way to create a link is the following: you bring the mouse cursor into the handle at the center of the selected node, press the left button, move the mouse towards another node. When the mouse cursor is into the other node, you release the left button and the link is created.

You may also create a link without having to click at the center handle. If the LinkCreationMode property is set to afAllNodeArea, then you have just to click on the origin node, press the left button, move the mouse towards another node. This will work only if the CanMoveNode property is False.

Syntax

object.LinkCreationMode = value
value = object.LinkCreationMode

Arguments | Description
object | Object expression that references an AddFlow control.
value | An integer that defines the link creation mode.

The settings for value are:

Constants | Value | Description
afCenterNodeHandle | 0 | Click in the handle at the node center.
afAllNodeArea | 1 | Just click in the node area

Default value

afCenterNodeHandle


LinkingHandleSize Property

Description

Returns/sets a value which defines the size of the linking handle at the center of selected node.

Syntax

object.LinkingHandleSize = value
value = object.LinkingHandleSize

Arguments | Description
object | Object expression that references an AddFlow control.
value | An integer that defines the size of the linking handle.

The settings for value are:

Constants | Value | Description
afSmallSize | 6 | 6 pixels (default)
afMediumSize | 9 | 9 pixels
afLargeSize | 12 | 12 pixels

Default

afSmallSize


Hidden Property

LinkOwnerDraw Property

Description

Determines whether a custom drawing will be provided for the next created links. Therefore, if it is true, the OwnerDraw property of each new created link is true, otherwise it is false.

Syntax

object.LinkOwnerDraw = value
value = object.LinkOwnerDraw

Arguments | Description
object | Object expression that references an AddFlow control
value | A boolean which determines if a custom drawing will be provided for the next created link.

Default value

False

See Also

NodeOwnerDraw event, LinkOwnerDraw event, DiagramOwnerDraw event

OwnerDraw property


LinkStyle Property

Description

If applied to a link object, it returns/sets the style used to draw the link.
If applied to an AddFlow control, it returns/sets the default style used to draw links.

Syntax

object.LinkStyle = style
style = object.LinkStyle

style | Description
object | Object expression that references an AddFlow control or a link object.
style | An integer that defines the link style.

The settings for style are:

Constants | Value | Description
afPolyline | 0 | Polyline (default)
afBezier | 1 | Bezier curve
afVH | 2 | 2 segments: vertical horizontal
afHV | 3 | 2 segments: horizontal vertical
afVHV | 4 | 3 segments : vertical horizontal vertical
afHVH | 5 | 3 segments : horizontal vertical horizontal
afVHVH | 6 | 4 segments: vert horz vert horz
afHVHV | 7 | 4 segments: horz vert horz vert
afVHVHV | 8 | 5 segments: vert horz vert horz vert
afHVHVH | 9 | 5 segments: horz vert horz vert horz
afVHVHVH | 10 | 6 segments: vert horz vert horz vert horz
afHVHVHV | 11 | 6 segments: horz vert horz vert horz vert
afVHVHVHV | 12 | 7 segments: vert horz vert horz vert horz vert
afHVHVHVH | 13 | 7 segments: horz vert horz vert horz vert horz
afSpline(v4) | 14 | Cubic spline

Remarks

  1. A reflexive link cannot have a LinkStyle other than 0 or 1 or 14.
  2. The Bezier LinkStyle behaviour appears only when the link has at least 4 points.
  3. If LinkStyle is > 1, the link is not stretchable. You cannot increase its segments number.

See Also

AdjustOrg property, AdjustDst property, OrthogonalDynamic property, ExtraPoints property


LogicalOnly Property

Description

Determines whether collection properties allow getting only logical objects.

Syntax

object.LogicalOnly = value
value = object.LogicalOnly

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines if the logical flag will be taken into account.

Default value

False

Remarks

This property allows filtering the objects (nodes and links) of the diagram and to retain only those which are important. For instance, if your diagram contains many nodes just used for labels, you can set the Logical property of those “label” nodes to False. Then, if the LogicalOnly property is True, the Nodes collection will not contain those “label” nodes.

See Also

Performance Tuning, Logical property


Linkable Property

MaxDegree Property

Description

If applied to a node, it returns/sets the maximum number of links for the node.
If applied to an AddFlow control, it returns/sets the default maximum number of links for nodes. When a node is created, it has this maximum number of links.

Syntax

object.MaxDegree = value
value = object.MaxDegree

Arguments | Description
object | Object expression that references an AddFlow control or a node object.
value | An integer value which defines the maximum number of links. If this value is negative, then it means that there is no limitation in the number of links.

Default value

-1 (No limitation in the number of links)

See Also

MaxInDegree, MaxOutDegree, CycleMode


Linkable Property

MaxInDegree Property

Description

If applied to a node, it returns/sets the maximum number of incoming links for the node.
If applied to an AddFlow control, it returns/sets the default maximum number of incoming links for nodes. When a node is created, it has this maximum number of incoming links.

Syntax

object.MaxInDegree = value
value = object.MaxInDegree

Arguments | Description
object | Object expression that references an AddFlow control or a node object.
value | An integer value which defines the maximum number of incoming links. If this value is negative, then it means that there is no limitation in the number of links.

Default value

-1 (No limitation in the number of links)

Remark

If the value of this property is 1 and if the CycleMode property is not 0, the user will be able to create only a subset of graphs: trees.

See Also

MaxOutDegree, MaxDegree, CycleMode


Linkable Property

MaxOutDegree Property

Description

If applied to a node, it returns/sets the maximum number of outgoing links for the node.
If applied to an AddFlow control, it returns/sets the default maximum number of outgoing links for nodes. When a node is created, it has this maximum number of outgoing links.

Syntax

object.MaxOutDegree = value
value = object.MaxOutDegree

Arguments | Description
object | Object expression that references an AddFlow control or a node object.
value | An integer value which defines the maximum number of outgoing links. If this value is negative, then it means that there is no limitation in the number of links.

Default value

-1 (No limitation in the number of links)

See Also

MaxInDegree, MaxDegree, CycleMode


MultiSel Property

Description

Determines whether multiselection mode is possible or not.

Syntax

object.MultiSel = value
value = object.MultiSel

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines if multiselection is allowed.

Default value

True

See Also

Capabilities topic, Selection topic


Nodes Property

Description

Returns a reference to the collection of Node objects.
Not available at design time. Read-only at run-time.

Syntax

Set coll = object.Nodes

Arguments | Description
object | Object expression that references an AddFlow control.
coll | Object expression that references a collection of nodes (afNodes)

Remark

You may manipulate Nodes objects by using the standard methods of a collection (for instance, Add and Remove). It is possible to access each element of the collection with Item method or in an enumeration loop (For Each ... In)

See Also

Navigation topic.


Hidden Property

NodeOwnerDraw Property

Description

Determines whether a custom drawing will be provided for the next created nodes. Therefore, if it is true, the OwnerDraw property of each new created node is true, otherwise it is false.

Syntax

object.NodeOwnerDraw = value
value = object.NodeOwnerDraw

Arguments | Description
object | Object expression that references an AddFlow control
value | A boolean which determines if a custom drawing will be provided for the next created nodes.

Default value

False

See Also

NodeOwnerDraw event, LinkOwnerDraw event, DiagramOwnerDraw event

OwnerDraw property


NoPrefix Property

Description

Determines whether the '&' character in the text of a node appears as a '_'.

Syntax

object.NoPrefix= value
value = object.NoPrefix

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines if the '&' character in the text of a node appears as a '_'

Default value

False (the '&' character in the text of a node appears as a '_')


OrientedText Property

Description

If applied to a link, it determines whether whether its text can be drawn in the same direction as the link itself.
If applied to an AddFlow control, it determines whether the text of the next created links will be drawn in the same direction as the link itself.

Syntax

object.OrientedText = value
value = object.OrientedText

Arguments | Description
object | Object expression that references an AddFlow control or a link object.
value | A boolean which determines if the link text can be drawn in the same direction as the link itself.

Remark

This feature will not work if you do not use a truetype font.

Default value

False


OrthogonalDynamic Property

Description

If applied to a link, it determines whether the link is composed of several orthogonal segments (vertical or horizontal) so that the first and last segments of the link are orthogonal to the origin and destination nodes.
If applied to an AddFlow control, it determines whether the next created links will have an "OrthogonalDynamic" behaviour.

Syntax

object.OrthogonalDynamic = value
value = object.OrthogonalDynamic

Arguments | Description
object | Object expression that references an AddFlow control or a link object.
value | A boolean which determines if the link is OrthogonalDynamic.

Remark

  • This property will have not any effect if the LinkStyle property of the link is 0 (polyline) or 1 (Bezier) or 14 (Cubic Spline).
  • To observ the "OrthogonalDynamic" behaviour, click on a link point and move it. You may also set the AdjustOrg and AdjustDst properties of the link.
  • Note that when you "stretch" an OrthogonalDynamic link, its LinkStyle property value may change.

Example

See the VB "Point" sample provided with AddFlow.

Default value

False

See Also

AdjustOrg property, AdjustDst property, LinkStyle property, ExtraPoints property


Hidden Property

OwnerDraw Property

Description

If applied to a node or a link, it determines whether you want to provide custom drawing for this item.
If applied to an AddFlow control, it determines whether whether you want to provide custom drawing for the diagram.

Syntax

object.OwnerDraw = value
value = object.OwnerDraw

Arguments | Description
object | Object expression that references an AddFlow control, a node or a link object.
value | A boolean which determines if a custom drawing is provided for this object.

Default value

False

See Also

NodeOwnerDraw event, LinkOwnerDraw event, DiagramOwnerDraw event


PictureIndex Property

Description

If applied to a node, it returns/sets the index of a node picture stored in an array of pictures defined by the Pictures property.
If applied to an AddFlow control, it returns/sets the default index of a picture stored in the array of pictures defined by the Pictures property.

Syntax

object.PictureIndex = index
index = object.PictureIndex

style | Description
object | Object expression that references a node object or an AddFlow control.
index | An integer that defines the index of the node picture. 1 defines the first picture. 0 indicates that the node has not any picture associated.

Remark

  1. This property allows to associate to a node a reference to a picture instead of the picture itself. Therefore, it allows to save memory resources. For instance, if your application uses 5 distinct pictures that may appear in 500 nodes, then if you use the Picture property, you will have to save 500 pictures whereas if you use the PictureIndex property, you will just need to save 5 pictures.
  2. A node may have 2 pictures. One is defined by the Picture property, the other by the PictureIndex property. In such a case, the Picture property is used in priority and it will be displayed in the node, whereas the PictureIndex property will be ignored.

Example

If you wish to assign the second picture of the Pictures collection to a node, you will have to write:

node.PictureIndex = 2

To remove that picture, you have to write:

node.PictureIndex = 0

See Also

Pictures property, Picture property


ItemPicture Property

Pictures Property

Description

Returns a reference to the collection of the pictures that can be used to display a picture in a node
Not available at design time. Read-only at run-time.

Syntax

Set coll = object.Pictures

style | Description
object | Object expression that references an AddFlow control.
coll | Object expression that references a collection of pictures (afPictures)

Remarks

For instance, if your application requires to use 3 kind of pictures, you could fill your picture collection using the following code:

AddFlow1.Pictures.Add Picture1
AddFlow1.Pictures.Add Picture2
AddFlow1.Pictures.Add Picture3

then, if you wish to assign the second picture to a node, you will have to write:

node.PictureIndex = 2

See Also

PictureIndex property


PointedArea Property

Description

Returns the type of the area pointed by the mouse (sizing square, stretching square, linking square, node, over no special area).
Not available at design time; read only at run time

Syntax

area = object.PointedArea

Arguments | Description
object | Object expression that references an AddFlow control.
area | An integer which defines the clicked area

The settings for area are:

Constants | Value | Description
afNWSEsizeHandle | 0 | NW-SE Size handle area
afNSsizeHandle | 1 | North-South Size handle area
afNESWsizeHandle | 2 | NE-SW Size handle area
afWEsizeHandle | 3 | West-East Size handle area
afStretchingHandle | 4 | Stretching handle area
afLinkingHandle | 5 | Linking handle area
afNodeArea | 6 | Node area
afOutSide | 7 | Outside area
afLinkArea | 8 | Link area

Remarks

This property allows to change dynamically the mouse pointer BEFORE the user clicks anywhere, to indicate what actions are possible.

For example, when the pointer is over one of the corner points of a node, it should change to the standard NE/SW or NW/SE diagonal arrow. When it is over a side node, it would be the N/S or E/W arrow.

See Also

PointedNode, PointedLink properties.


PointedNode

PointedNode, PointedLink Property

Description

Returns the object pointed by the mouse :

  • If it is a node, PointedNode returns a reference to this node and PointedLink returns Nothing.
  • If it is a link, PointedNode returns Nothing and PointedLink returns a reference to this link.
  • If the mouse is over nothing, both properties returns Nothing.

Not available at design time; read only at run time

Syntax

Set node = object.PointedNode
Set link = object.PointedLink

Arguments | Description
object | Object expression that references an AddFlow control.

See Also

PointedArea property, GetNodeAtPoint, GetLinkAtPoint methods, Selection topic


ProportionalBars Property

Description

Determines whether the scrollbar thumbs should be proportional to the size of the visible area.

Syntax

object.ProportionalBars = value
value = object.ProportionalBars

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines if the scrollbar thumbs are proportional.

Default value

True

See Also

Scrolling topic


ReadOnly Property

Description

Set "read only" mode. In such a mode, user interaction is not allowed except scrolling. Tooltips are still displayed in that mode.

Syntax

object.ReadOnly = value
value = object.ReadOnly

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines the "read only" mode.

Default value

False

Remark

You'll have to do a refresh just after changing the value of this property.

Example 1

AddFlow1.ReadOnly = False  'or True
AddFlow1.Refresh

See Also

Capabilities topic


UndoCode Property

UndoCode, RedoCode Property

Description

UndoCode returns the code of the next undoable action.
RedoCode returns the code of the next redoable action.

Syntax

code = object.UndoCode
code = object.RedoCode

Arguments | Description
object | Object expression that references an AddFlow control.
code | An integer that defines the code of the next undoable or redoable action.

The setting for code are:

Constants | Value
afActionNone | 0
afActionNodeCreate | 1
afActionNodeDelete | 2
afActionNodeMove | 3
afActionNodeResize | 4
afActionNodeLeft | 5
afActionNodeTop | 6
afActionNodeWidth | 7
afActionNodeHeight | 8
afActionNodePicture | 9
afActionNodePictureIndex | 10
afActionNodeFont | 11
afActionNodeFillColor | 12
afActionNodeDrawColor | 13
afActionNodeForeColor | 14
afActionNodeText | 15
afActionNodeTag | 16
afActionNodeKey | 17
afActionNodeTooltip | 18
afActionNodeUserdata | 19
afActionNodeAutosize | 20
afActionNodeShape | 21
afActionNodeShapeOrientation | 22
afActionNodeAlignment | 23
afActionNodePicturePosition | 24
afActionNodeShadow | 25
afActionNodeEditMode | 26
afActionNodeBackMode | 27
afActionNodeDrawStyle | 28
afActionNodeDrawWidth | 29
afActionNodeMarked | 30
afActionNodeHidden | 31
afActionNodeTransparent | 32
afActionNodeLogical | 33
afActionNodeSelectable | 34
afActionNodeMoveable | 35
afActionNodeXMoveable | 36
afActionNodeYMoveable | 37
afActionNodeSizeable | 38
afActionNodeXSizeable | 39
afActionNodeYSizeable | 40
afActionNodeXScrollable | 41
afActionNodeYScrollable | 42
afActionNodeLinkable | 43
afActionLinkCreate | 44
afActionLinkDelete | 45
afActionLinkMove | 46
afActionLinkStretch | 47
afActionLinkOrg | 48
afActionLinkDst | 49
afActionLinkReverse | 50
afActionLinkPoints | 51
afActionLinkFont | 52
afActionLinkDrawColor | 53
afActionLinkForeColor | 54
afActionLinkText | 55
afActionLinkTag | 56
afActionLinkKey | 57
afActionLinkTooltip | 58
afActionLinkUserdata | 59
afActionLinkDrawWidth | 60
afActionLinkLinkStyle | 61
afActionLinkArrowOrg | 62
afActionLinkArrowMid | 63
afActionLinkArrowDst | 64
afActionLinkDrawStyle | 65
afActionLinkBackMode | 66
afActionLinkMarked | 67
afActionLinkHidden | 68
afActionLinkLogical | 69
afActionLinkSelectable | 70
afActionLinkStretchable | 71
afActionLinkOrientedText | 72
afActionLinkRigid | 73
afActionLinkAdjustOrg | 74
afActionLinkAdjustDst | 75
afActionLinkOrthogonalDynamic | 76
afActionZOrder | 77
afActionDeleteSel | 78
afActionDeleteMarked | 79
afActionPaste | 80
afActionClearNodes | 81
afActionClearLinks | 82
afActionMoveItems | 83
afActionNodePropertyPage | 84
afActionLinkPropertyPage | 85
afActionNodeTagVariant | 86
afActionLinkTagVariant | 87
afActionLinkRoundedCorner | 88

Remark

The UndoCode and RedoCode properties will allow your application to give descriptions of the actions on the undo and redo history.

See Also

Undo/Redo topic


PointedNode

RedoNode, RedoLink Property

Description

Returns the object involved in the next redoable action :

  • If it is a node, UndoNode returns a reference to this node and UndoLink returns Nothing.
  • If it is a link, UndoNode returns Nothing and UndoLink returns a reference to this link.
  • Otherwise, both properties returns Nothing.

Not available at design time; read only at run time

Syntax

Set node = object.RedoNode
Set link = object.RedoLink

Arguments | Description
object | Object expression that references an AddFlow control.

See Also

Undo/Redo topic


RemovePointAngle Property

Description

Returns/sets a value that determines if the user can remove a link point by dragging the handle to a position where it has a very obtuse angle to its surrounding link points.

Syntax

object.RemovePointAngle = value
value = object.RemovePointAngle

Arguments | Description
object | Object expression that references an AddFlow control.
value | An integer that defines the "removepoint" angle.

The settings for value are:

Constants | Value | Description
afZeroAngle | 0 | In such a case, the point is removed if both segments are stricly aligned.
afSmallAngle | 1 |
afMediumAngle | 2 | (default)
afLargeAngle | 3 |

Default value

afMediumAngle

See Also

Capabilities topic


Repaint Property

Description

Determines whether repainting the AddFlow control is allowed or not.Setting this property to False increases speed performance. Setting this property to True causes a refresh.
Not available at design time.

Syntax

object.Repaint = value
value = object.Repaint

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines if repainting is allowed.

Default value

True

See Also

Performance Tuning topic

VB Example

' Make all nodes and links red.
Dim node as afNode, link as afLink

With AddFlow1
  .Repaint = False   ' Avoid any repaintings during process

  ' Nodes enumeration
   For Each node In .Nodes
    node.DrawColor = RGB(255, 0, 0)

     ' For each node, perform a “ leaving link ” enumeration.
     For Each link In node.OutLinks
      link.DrawColor = RGB(255, 0, 0)
    Next
  Next

  .Repaint = True    ' Cause a refresh
End With

VC++ Example

CNodes nodes;
CLinks links;
CNode node;
CLink link;
int i, k;
VARIANT vaIdx;
// Avoid any repaintings during process
m_AddFlow.SetRepaint(FALSE);
nodes = m_AddFlow.GetNodes();
// Color all nodes and items
VariantInit(&vaIdx);
vaIdx.vt = VT_I4;
for (i = 1; i <= nodes.GetCount(); i++)
{
  vaIdx.lVal = i;
  node = nodes.Item(vaIdx);
  node.SetDrawColor(RGB(255, 0, 0));
  links = node.GetOutLinks();
  for (k = 1; k <= links.GetCount(); k++)
  {
    vaIdx.lVal = k;
    links.Item(vaIdx).SetDrawColor(RGB(255, 0, 0));
  }
}

// Cause a refresh
m_AddFlow.SetRepaint(TRUE);


Rigid Property

Description

Determines whether a Link object is rigid or not.
If a link is rigid, it follows (without being stretched) its origin node when this origin node is being dragged. A consequence of this rigid behaviour is that the destination node follows the origin. If all nodes are linked each other with rigid links then, all the nodes grape is moving if the user drags one node.
If it is not rigid, it does not move when its origin node is moved. Only its first point follows the node.

Syntax

object.Rigid = value
value = object.Rigid

Arguments | Description
object | Object expression that references an AddFlow control or a link object.
value | A boolean which determines if the link is rigid.

Default value

False

Remarks

This property allows to define a kind of ownership between 2 nodes. If there is a rigid link from node A to node B, then if the user drags A, B follows it. We may say that A owns B. When an owner node is moved, all its owned nodes are also moved. This happens only when the user moves the node interactively with the mouse (dragging). If the node is moved programmaticaly (i.e changing its Left or Top properties), owned nodes do not move.

You may use this property in a recursive way: an owned node may be itself owner of other nodes.

You may also use this property to group several nodes. If there is a rigid link between node A and node B and a rigid link between node B and node A, then nodes A and B are grouped. A follows B and B follows A. Of course you can hide those rigid links and make them inactive with Hidden and Selectable properties.

In the following example, if you move the red dot nodes, the nodes inside follow it.

Dim nodx As afNode, lnkx As afLink

With AddFlow1
.DrawColor = &H8000&
.ArrowDst = 0

' Create
container node
Set nodx =
.Nodes.Add(100, 100, 2500, 2500)
nodx.DrawStyle = afDot
nodx.DrawColor = 255
nodx.Transparent = True

' Create owned
nodes
.Nodes.Add
500, 500, 400, 400
.Nodes.Add 1800, 500, 400, 400
.Nodes.Add 1800, 1800, 400, 400
.Nodes.Add 500, 1800, 400, 400

' Create rigid
links between container node and owned nodes
.Rigid = True
.Hidden = True

Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(2))
lnkx.Selectable = False
Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(3))
lnkx.Selectable = False
Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(4))
lnkx.Selectable = False
Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(5))
lnkx.Selectable = False

' Create true
visible links between owned nodes
.Hidden =
False
.Rigid = False
.Nodes(2).OutLinks.Add .Nodes(3)
.Nodes(3).OutLinks.Add .Nodes(4)
.Nodes(4).OutLinks.Add .Nodes(5)
.Nodes(5).OutLinks.Add .Nodes(2)
End With


Rigid Property

RoundedCorner Property

Description

If applied to a link, it determines whether there is a rounded corner at the intersection point of 2 segments of that link.

If applied to an AddFlow control, it determines whether, by default, there is a rounded corner at the intersection point of 2 segments of the next created links.

Syntax

object.RoundedCorner = value
value = object.RoundedCorner

Arguments | Description
object | Object expression that references an AddFlow control or a link object.
value | A boolean value which determines whether there is a rounded corner

Default value

False


LinkingHandleSize Property

RoundedCornerSize Property

Description

Returns/sets a value which defines the size of the rounded corners of the link segments.

Syntax

object.RoundedCornerSize = value
value = object.RoundedCornerSize

Arguments | Description
object | Object expression that references an AddFlow control.
value | An integer that defines the size of the rounded corners.

The settings for value are:

Constants | Value | Description
afSmallRound | 0 | Small rounds
afMediumRound | 1 | Medium rounds
afLargeRound | 2 | Large rounds

Default

afMediumRound


Linkable Property

RouteGrain Property

Description

Returns/sets a number that determines the number of steps taken when trying to find a route around nodes.

Syntax

object.RouteGrain = value
value = object.RouteGrain

Arguments | Description
object | Object expression that references an AddFlow control
value | An integer value which defines the grain.

Default value

8

See Also

Autorouting topic


Linkable Property

RouteMinDistance Property

Description

Returns/sets a number that determines the minimal distance between a segment of the link and an obstacle.

Syntax

object.RouteMinDistance = value
value = object.RouteMinDistance

Arguments | Description
object | Object expression that references an AddFlow control
value | An integer value which defines the minimal distance

Default value

16

See Also

Autorouting topic


LinkCreationMode Property

RouteStartMethod Property

Description

Determines the sides of the origin node from which the link autorouting is to start.

There are several choices.

For instance, you can decide (for example, for aesthetic reasons) that the first segment must leave the origin node from a vertical side. In such a case, there are 2 possibilities and the algorithm will select the solution that uses the mimimal number of segments. This is the afVerticalSides method.

Or you can decide that the algorithm will try the 4 cases and retain the solution with the minimal number of segments.This is the afAllSides method.

Or you can also decide that the algorithm will try only the case where the first segemnt of the link will leave the 2 sides of the node that are directed towrads the destination node.This is the afTwoBestSides method.

etc...

Syntax

object.RouteStartMethod = value
value = object.RouteStartMethod

Arguments | Description
object | Object expression that references an AddFlow control.
value | An integer that defines the autorouting start method.

The settings for value are:

Constants | Value | Description
afAllSides | 0 | Takes into account the four sides of the origin node.
afTwoBestSides | 1 | Takes into account only the vertical side and the horizontal side of the origin node that are directed towards the destination node
afVerticalSides | 2 | Takes into account only the two vertical sides of the origin node
afHorizontalSides | 3 | Takes into account only the two horizontal sides of the origin node
afBestVerticalSide | 4 | Takes into account only the vertical side of the origin node that is directed towards the destination node
afBestHorizontalSide | 5 | Takes into account only the horizontal side of the origin node that is directed towards the destination node

Default value

afAllSides

See Also

Autorouting topic


ScrollTrack Property

Description

Determines whether scrolling should occur while the user moves the scroll thumb.

Syntax

object.ScrollTrack = value
value = object.ScrollTrack

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines if scrolling should occur while the user moves the scroll thumb.

Default value

True

See Also

Scrolling topic


ScrollWheel Property

Description

Determines whether scrolling should occur while the user moves the mouse wheel.

Syntax

object.ScrollWheel = value
value = object.ScrollWheel

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines if scrolling should occur while the user moves the mouse wheel.

Default value

True

See Also

Scrolling topic


ScrollBars Property

Description

Allows to add scrollbars for the AddFlow control. Read-only at run time.

Syntax

object.ScrollBars = value
value = object.ScrollBars

Arguments | Description
object | Object expression that references an AddFlow control
value | An integer value which defines the scrollbars setting

The settings for value are:

Constants | Value | Description
afNoScroll | 0 | None
afHorizontal | 1 | Horizontal
afVertical | 2 | Vertical
afBoth | 3 | Both (default)

See Also

Scrolling topic


SelectAction Property

Description

Returns/sets the selection rectangle action (none, select items, zoom,...).

Syntax

object.SelectAction = value
value = object.SelectAction

Arguments | Description
object | Object expression that references an AddFlow control.
value | An integer value which defines the select action.

The settings for value are:

Constants | Value | Description
afNoSelection | 0 | None (default)
afSelectItems | 1 | Select the Items inside the rectangle
afZoomRectangle | 2 | Zoom the rectangle
afZoomRectIso | 3 | Zoom the rectangle while ensuring a 1:1 aspect ratio
afDrawFocusRect | 4 | Just draw a rectangle (no action)

Default value

afNoSelection

Remark

This property should be used instead of the SelectMode property.

See Also

Selection topic, SelectMode property


SelectionHandleSize Property

Description

Returns/sets a value which defines the size of the selection handles of the selected node.

Syntax

object.SelectionHandleSize = value
value = object.SelectionHandleSize

Arguments | Description
object | Object expression that references an AddFlow control.
value | An integer that defines the size of the selection handles.

The settings for value are:

Constants | Value | Description
afSmallSize | 6 | 6 pixels (default)
afMediumSize | 9 | 9 pixels
afLargeSize | 12 | 12 pixels

Default

afSmallSize


SelectMode Property

Description

Allow to enter in selection mode instead of drawing mode. This property has no effect if the MultiSel property is not set.
Not available at design time.

The selection mode allows to select several nodes or links. You bring the mouse cursor into the AddFlow control, press the left button, move the mouse and release the left button. All nodes or links partly inside the selection rectangle are selected. Then you can unselect some nodes by clicking them with the mouse and simultaneously pressing the shift or control key. You can select them again by using the same method.

You can use the Shift Key in conjunction with a selection rectangle. For instance, if SelectMode property is True, you can draw a selection rectangle with a mouse, which cause items inside this rectangle to be selected. Then, if you press the Shift key, you can select additional items.

Syntax

object.SelectMode = value
value = object.SelectMode

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines if the selection mode is set.

Settings

Value | Description
False | (Default) Drawing mode.
True | Select mode is set.

Remark

It is now better to use the SelectAction property. SelectMode has been maintained just for compatibility with previous AddFlow versions.

See Also

Selection topic


SelNodes

SelNodes, SelLinks Properties

Description

Returns a reference to the collection of selected Node objects (SelNodes) or selected Link objects (SelLinks).
Not available at design time. Read-only at run-time.

Syntax

Set coll = object.SelNodes
Set coll = object.SelLinks

Arguments | Description
object | Object expression that references an AddFlow control.
coll | Object expression that references a node or link collections.

Remarks

  1. You may manipulate SelNodes and SelLinks objects by using the standard methods of a collection (for instance, Add and Remove). It is possible to access each element of the collection with Item method or in an enumeration loop (For Each ... In)
  2. The 2 following statements have the same effect:

AddFlow1.SelNodes.Add node
Node.Selected = True

See Also

Navigation topic, Selection topic


Shadow Property

Description

If applied to a node, it returns/sets its shadow style.
If applied to an AddFlow control, it returns/sets the default node shadow style. When a node is created, it has this shadow style.

Syntax

object.Shadow = value
value = object.Shadow

Arguments | Description
object | Object expression that references an AddFlow control or a node object.
value | An integer value which defines the node shadow.

The settings for value are:

Constants | Value | Description
afNoShadow | 0 | No Shadow (default)
afRightBottomShadow | 1 | Right Bottom Shadow
afRightTopShadow | 2 | Right Top Shadow
afLeftTopShadow | 3 | Left Top Shadow
afLeftBottomShadow | 4 | Left Bottom Shadow

Default value

afNoShadow

Remark

The shadow of a node can be displayed only on the canvas. It cannot be displayed on another node unless this node is transparent.

See Also

ShadowColor property.


ShadowColor Property

Description

Returns/sets the color used for the node shadows.

Syntax

object.ShadowColor = color
color = object.ShadowColor

Arguments | Description
object | Object expression that references an AddFlow control.
color | The shadow color.

The settings for color are:

Value | Description
Normal RGB Colors | Color set with RGB or QBColor function in code
System Default Colors | Colors specified with the system color constants from CONSTANT.TXT, a Visual Basic file that you can load into a project's global module. Window's substitutes the user's choices, as specified through the user's Control Panel Settings.

By default, ShadowColor is set to grey.

See Also

Shadow property.


Shape Property

Description

If applied to a node, it returns/sets its shape.
If applied to an AddFlow control, it returns/sets the default node shape. When a node is created, it has this shape.

Syntax

object.Shape = value
value = object.Shape

Arguments | Description
object | Object expression that references an AddFlow control or a node object.
value | An integer value which defines the node shape.

The settings for value are (See the diagram at the end of this topic):

Constants | Value | Description
afEllipse | 0 | Ellipse (default)
afRectangle | 1 | Rectangle
afRoundRect | 2 | RoundRect
afDiamond | 3 | Diamond
afNorthTriangle | 4 | North Triangle
afSouthTriangle | 5 | South Triangle
afEastTriangle | 6 | East Triangle
afWestTriangle | 7 | West Triangle
afHexagon | 8 | Hexagon
afRectEdgeBump | 9 | RectEdgeBump
afRectEdgeEtched | 10 | RectEdgeEtched
afRectEdgeRaised | 11 | RectEdgeRaised
afRectEdgeSunken | 12 | RectEdgeSunken
afTriangleRectangle | 13 | Triangle rectangle
afPentagon | 14 | Pentagon
afOctogon | 15 | Octogon
afProcess | 50 | Process
afAlternateProcess | 51 | Alternate Process
afDecision | 52 | Decision
afData | 53 | Data
afPredefinedProcess | 54 | Predefined process
afInternalStorage | 55 | Internal Storage
afDocument | 56 | Document
afMultiDocument | 57 | Multiple Document
afTermination | 58 | Termination
afPreparation | 59 | Preparation
afManualInput | 60 | Manual Input
afManualOperation | 61 | Manual Operation
afConnector | 62 | Connector
afOffPageConnection | 63 | Off-Page Connection
afCard | 64 | Card
afPunchedTape | 65 | Punched Tape
afSummingJunction | 66 | Summing Junction
afOr | 67 | Or
afCollate68 | 68 | Collate
afSort | 69 | Sort
afExtract | 70 | Extract
afMerge | 71 | Merge
afStoredData | 72 | StoredData
afDelay | 73 | Delay
afSequentialAccessStorage | 74 | Sequential access storage
afMagneticDisk | 75 | Magnetic Disk
afDirectAccessStorage | 76 | Direct access storage
afDisplay | 77 | Display
afTransport | 78 | Transport
afProcessIso9000 | 79 | Process Iso 9000

Remarks

1) AddFlow has 2 families of shapes: basic shapes and organigram shapes. Values 50 to 79 are the organigram shapes whereas values from 0 to 15 are the basic shapes. This explains why 2 distinct shape values may represent in fact the same shape. This occurs 7 times:

afConnector = afEllipse
afProcess = afRectangle
afAlternateProcess = afRoundRect
afDecision = afLosange
afPreparation = afHexagon
afExtract = afNorthTriangle
afMerge = afSouthTriangle

2) The ShapeOrientation property allows rotating node shapes. Only 4 angle values are accepted: 0°, 90°, 180°, 270°.

See Also

ShapeOrientation property.


ShapeOrientation Property

Description

If applied to a node, it returns/sets its shape orientation.
If applied to an AddFlow control, it returns/sets the default node shape orientation. When a node is created, it has this shape orientation.
This property allows rotating some node shapes (not all shapes). Only 4 angle values are accepted: 0°, 90°, 180°, 270°.
This property has no effect if the shape is one of the following:

  • afNorthTriangle
  • afSouthTriangle
  • afEastTriangle
  • afWestTriangle
  • afRectEdgeEtched
  • afRectEdgeRaised
  • afRectEdgeSunken
  • afPredefinedProcess
  • afInternalStorage
  • afMultiDocument
  • afExtract
  • afSequentialAccessStorage

Syntax

object.ShapeOrientation = value
value = object.ShapeOrientation

Arguments | Description
object | Object expression that references an AddFlow control or a node object.
value | An integer value which defines the node shape orientation.

The settings for value are:

Constants | Value | Description
afAngle0 | 0 | Angle 0° (default)
afAngle90 | 1 | Angle 90°
afAngle180 | 2 | Angle 180°
afAngle270 | 3 | Angle 270°

See Also

Shape property.

Exemple

Shape = afPentagon


ShowGrid Property

Description

Specify if the grid is displayed or not.

Syntax

object.ShowGrid = value
value = object.ShowGrid

Arguments | Description
object | Object expression that references an AddFlow control.
changed | A boolean which determines if the grid is displayed.

Default value

False

See Also

Grid topic


ArrowOrg

ShowJump Properties

Description

If applied to a link, it returns/sets its jump style.
If applied to an AddFlow control, it returns/sets the default link jump style. When a link is created, it receives this default jump link style.

A jump is a little arc displayed at the intersection of 2 links. The jump is displayed in the link that has the greatest ZOrder. In the following example, the link B is above the link A which is itself above the link C.

Syntax

object.ShowJump = value
value = object.ShowJump

Arguments | Description
object | Object expression that references an AddFlow control or a link object.
value | An integer value which defines the jump style.

The settings for value are:

Constants | Value | Description
afNoJump | 0 | None (default)
afArcJump | 1 | Arc jump

Remarks

  • You should use jumps only for small diagrams (< 200 nodes) because the algorithm used to find intersections requires considerable computational resources.
  • This feature is valid only for polyline links. It will not work with Bezier of spline links (See the LinkStyle property)


ShowPropertyPages Property

Description

Returns/sets a value which defines what property pages will be displayed at runtime when the user makes a mouse right click.

Syntax

object.ShowPropertyPages = value
value = object.ShowPropertyPages

Arguments | Description
object | Object expression that references an AddFlow control.
value | An integer value which defines what the property pages setting.

The settings for value are:

Constants | Value | Description
afShowNone | 0 | None
afShowNode | 1 | Node property page
afShowLink | 2 | Link property page
afShowNodeAndLink | 3 | Node and Link property pages (default)
afShowGeneral | 4 | General property page
afShowGeneralAndNode | 5 | General and Node property pages
afShowGeneralAndLink | 6 | General and Link property pages
afShowAll | 7 | All property pages

Default value

afShowNodeAndLink

See Also

PropertyPage method, DisplayPropertyPage method


ShowToolTip Property

Description

Determines whether you can display node and link tooltips.

Syntax

object.ShowToolTip = value
value = object.ShowToolTip

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines if tooltips are displayed.

Default value

True

See Also

Capabilities topic


SizeArrowDst

SizeArrowOrg, SizeArrowDst, SizeArrowMid Properties

Description

If applied to a link, it returns/sets the size of its origin arrow (SizeArrowOrg) or the size of its destination arrow (SizeArrowDst) or the size of its arrow at the middle of each segment of the link (SizeArrowMid).
If applied to an AddFlow control, it returns/sets the default link origin arrow size, the default link destination arrow size or default link middle segment arrow size. When a link is created, it receives those default arrow sizes.

Syntax

object.SizeArrowOrg = value
object.SizeArrowDst = value
object.SizeArrowMid = value
value = object.SizeArrowOrg
value = object.SizeArrowDst
value = object.SizeArrowMid

Arguments | Description
object | Object expression that references an AddFlow control or a link object.
value | An integer value which defines the size of the arrow head.

The settings for value are:

Constants | Value | Description
afSmallArrow | 0 | The arrow head size is small.
afMediumArrow | 1 | The arrow head size is small.
afLargeArrow | 2 | The arrow head size is large.

Default value

0

See Also

ArrowDst, ArrowMid, ArrowOrg properties


Repaint Property

SkipUndo Property

Description

Determines whether the following actions are recorded in the undo manager.
Not available at design time.

Syntax

object.SkipUndo = value
value = object.SkipUndo

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines whether the following actions are recorded in the undo manager

Default value

False

See Also

Undo/Redo topic


SnapToGrid Property

Description

Specify if nodes are aligned to the grid

Syntax

object.SnapToGrid = value
value = object.SnapToGrid

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines if nodes are aligned to the grid.

Default value

False

See Also

Grid topic


StretchingPoint Property

Description

Returns the index of the current stretching point.

Syntax

index = object.StretchingPoint

Arguments | Description
object | Object expression that references an AddFlow control.
index | A integer value defining the index of the current stretching point.


Transparent Property

Description

If applied to a node, it determines whether it is transparent or not.
If applied to an AddFlow control, it determines whether the next created nodes will be transparent or not.

Syntax

object.Transparent = value
value = object.Transparent

Arguments | Description
object | Object expression that references an AddFlow control or a node object.
value | A boolean which determines if the node is transparent.

Default value

False


PointedNode

UndoNode, UndoLink Property

Description

Returns the object involved in the next undoable action :

  • If it is a node, UndoNode returns a reference to this node and UndoLink returns Nothing.
  • If it is a link, UndoNode returns Nothing and UndoLink returns a reference to this link.
  • Otherwise, both properties returns Nothing.

Not available at design time; read only at run time

Syntax

Set node = object.UndoNode
Set link = object.UndoLink

Arguments | Description
object | Object expression that references an AddFlow control.

See Also

Undo/Redo topic


UndoSize Property

Description

Sets and returns the number of undo commands that can be performed.

Syntax

object.UndoSize= value
value = object.UndoSize

Arguments | Description
object | Object expression that references an AddFlow control.
value | An integer value.

Default value

0 (in such a case, the size of the Undo buffer is unlimited)

Remarks

  1. UndoSize limits the size of the Undo buffer. Therefore, you can use this property to save memory.
  2. Setting UndoSize to zero means that the size of the Undo buffer is unlimited.

See Also

Undo/Redo topic


xExtent

xExtent, yExtent Property

Description

Returns the dimensions of the diagram in twips. Not available at design time.

Syntax

xExt = object.xExtent
yExt = object.yExtent

Arguments | Description
object | Object expression that references an AddFlow control.
xExt | A numeric value that defines the width of the diagram in twips.
yExt | A numeric value that defines the heoght of the diagram in twips.


xGrid

xGrid, yGrid Property

Description

Sets or returns the grid values in twips.

Syntax

object.xGrid = xGrid
xGrid = object.xGrid
object.yGrid = yGrid
yGrid = object.yGrid

Arguments | Description
object | Object expression that references an AddFlow control.
xGrid | numeric expression
yGrid | numeric expression

See Also

Grid topic


xScroll

xScroll, yScroll Property

Description

Sets or returns the scroll values in twips. Not available at design time.

Syntax

object.xScroll = xScroll
xScroll = object.xScroll
object.yScroll = yScroll
yScroll = object.yScroll

Arguments | Description
object | Object expression that references an AddFlow control.
xScroll | Integer value defining the horizontal scrolling value.
yScroll | Integer value defining the vertical scrolling value.

See Also

Scrolling topic


xShadowOffset

xShadowOffset, yShadowOffset Property

Description

Returns/sets the horizontal/vertical shadow offset.
Shadow offsets are expressed in twips.

Syntax

object.xShadowOffset = xOffset
xOffset = object.xShadowOffset
object.yShadowOffset = yOffset
yOffset = object.yShadowOffset

Arguments | Description
object | Object expression that references an AddFlow control.
xOffset | numeric expression defining the horizontal shadow offset.
yOffset | numeric expression defining the vertical shadow offset.

Default value

105 twips

See Also

Shadow property.


xZoom

xZoom, yZoom Property

Description

Specify a zoom factor which can be a value between 0 and 1000.
Setting it to 0 display the diagram so that it fits in the control area.
Setting it to 100% display the diagram at its normal size.
Setting it to a value higher than 100% expands the diagram
Setting it to a value less than 100% shrinks the diagram.

Syntax

object.xZoom  =
xZoom
object.yZoom = yZoom
xZoom = object.xZoom
yZoom = object.yZoom

Arguments | Description
object | Object expression that references an AddFlow control.
xZoom | An integer which defines the horizontal zoom value
yZoom | An integer which defines the vertical zoom value

Remarks

Setting the Zoom properties (xZoom, yZoom) to 0 displays the diagram so that it fits (horizontally or vertically) in the control area. In this case, the value of the xZoom or yZoom property is changed to reflect the new zooming state. For instance, if the width of the diagram is equal to the width of the control window divided by 4 and if xZoom is sets to 0, then the zooming factor is in fact 25% and xZoom returns 25 instead 0.


ZeroOriginForExport Property

Description

Determines whether the diagram origin is (0,0) for the export method. By default, when exporting a diagram, Addflow starts the diagram at the left most top most item. This property allows using instead a (0,0) origin.

Syntax

object.ZeroOriginForExport = value
value = object.ZeroOriginForExport

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines whether the diagram origin is (0,0) for the export method.

Default value

False

See Also

ExportPicture method


BeginAction Method

Description

Strat a group of actions that can be undone in one time.

Syntax

object.BeginAction code

Arguments | Description
object | Object expression that references an AddFlow control.
code | An integer that must be > 1000. This code allows to identify a group of action.

Remark

The code parameter must be a value superior to 1000. It allows to identify a group of actions. This code is returned by the UndoCode and RedoCode properties.

For instance, if, in your application, the user can open a dialog box allowing to change the picture of the node, its color and its Tag property, you will probably allow that user to undo these 3 basic actions in one time. To do that, add a call to BeginAction before invoking the dialog box and a call to EndAction just after the dialog box termination.

AddFlow1.BeginAction 1001
frmDialog.Show vbModal
AddFlow1.EndAction

The 1001 code passed as a parameter can be used later to provide a description in the Undo menu item.

See Also

EndAction method. UndoCode property, RedoCode property, Undo/Redo topic


CanPaste Method

Description

Indicates if a paste operation can be performed. If you wish to enable a menu item or a button for the Paste operation, you can use that method.

Syntax

value = object.CanPaste()

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines if a user can perform a paste operation.

See Also

Copy method, Paste method, Clipboard support topic


CanRedo Method

Description

Indicates if there is an action that can be redone.

Syntax

value = object.CanRedo()

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines if there is an action that can be redone.

Remark

Typically, this method allows to enable or disable the "Redo" menu item of your application.

See Also

Redo method, Undo/Redo topic


CanUndo Method

Description

Indicates if there is an action that can be undone.

Syntax

value = object.CanUndo()

Arguments | Description
object | Object expression that references an AddFlow control.
value | A boolean which determines if there is an action that can be undone.

Remark

Typically, this method allows to enable or disable the "Undo" menu item of your application.

See Also

Undo method, Undo/Redo topic


Copy Method

Description

Copies a diagram or a part of it onto the clipboard

Syntax

object.Copy itemset

Arguments | Description
object | Object expression that references an AddFlow control.
itemset | Describes the set of items to take into account in the copy operation.

The settings for itemset are:

Constants | Value | Description
afAllItems | 0 | all items
afSelectedItems | 1 | selected items
afMarkedItems | 2 | marked items

See Also

Paste method, CanPaste method, Clipboard support topic


DeleteMarked Method

Description

Deletes marked nodes (and their associated links) and marked links.

Syntax

object.DeleteMarked

Arguments | Description
object | Object expression that references an AddFlow control.

See Also

Marked property.


DeleteSel Method

Description

Deletes selected nodes (and their associated links) and selected links.

Syntax

object.DeleteSel

Arguments | Description
object | Object expression that references an AddFlow control.


DisplayPropertyPage Method

Description

Display the AddFlow property page as a modal dialog box.

Syntax

object.DisplayPropertyPage param

Arguments | Description
object | Object expression that references an AddFlow control.
param | Integer value. It must be 0

See Also

PropertyPage method, ShowPropertyPages property


EndAction Method

Description

Terminate a group of actions that can be undone in one time.

Syntax

object.EndAction

Arguments | Description
object | Object expression that references an AddFlow control.

See Also

BeginAction method. Undo/Redo topic


ExportPicture Method

ExportPagePicture Method

Description

Exports a rectangular portion of the diagram as a picture. This picture is an enhanced metafile.

Syntax

object.ExportPagePicture(left, top, width, height)

Arguments | Description
object | Object expression that references an AddFlow control.
left | A numeric value
top | A numeric value
width | A numeric value
Height | A numeric value

Remarks

1) If the grid is displayed in the AddFlow control, then it will be exported with the diagram. If you wish to avoid that, you can put the value of the ShowGrid property to False just before calling ExportPagePicture and reset it after.

2) This method has been created just to be used by PrnFlow 5.


ExportPicture Method

Description

Export the diagram as a picture. This picture is an enhanced metafile.

Syntax

object.ExportPicture(itemset, IncludeBackColor, IncludeBackPic)

Arguments | Description
object | Object expression that references an AddFlow control.
itemset | Describes the set of items to take into account in the export
IncludeBackColor | Indicates if the diagram back color has to be taken into account
IncludeBackPic | Indicates if the diagram back picture has to be taken into account

The settings for itemset are:

Constants | Value | Description
afAllItems | 0 | all items
afSelectedItems | 1 | selected items
afMarkedItems | 2 | marked items

Remarks

If the grid is displayed in the AddFlow control, then it will be exported with the diagram. If you wish to avoid that, you can put the value of the ShowGrid property to False just before calling ExportPicture and reset it after.

By default, when exporting a diagram, Addflow starts the diagram at the left most top most item. The ZeroOriginForExport property allows to use instead a (0,0) origin.

See also

SaveImage method, ZeroOriginForExport property.

Examples

Example 1 (VB)

' Export the diagram to a picture box:
' here, we copy only the selected items.
Picture1.Picture = AddFlow1.ExportPicture(afSelectedItems, False, False)

Example 2 (VB)

' Copy the diagram to the clipboard:
' here we wish to copy all items and the back picture.
Clipboard.Clear
Clipboard.SetData AddFlow1.ExportPicture(afAllItems, False, True)

Example 3 (VB)

' Save the diagram in a file:
' here we don›t want to save the grid.
Dim pic As IpictureDisp
AddFlow1.ShowGrid = False
Set pic = AddFlow1.ExportPicture(afAllItems, True, True)
AddFlow1.ShowGrid = True
SavePicture pic, "myfile.emf"


GetNodeAtPoint

GetNodeAtPoint, GetLinkAtPoint Methods

Description

Returns the node (or the link) placed at a specific x, y position.

Syntax

Set node = object.GetNodeAtPoint(x, y)
 Set link = object.GetLinkAtPoint(x, y)

Arguments | Description
object | Object expression that references an AddFlow control.
x | logical X coordinate to hittest
y | logical Y coordinate to hittest

Remarks

Those methods mimic the PointedNode and PointedLink properties, but take x and y parameters and return a node or a link if one was found at that location, otherwise nothing is returned.

Also both methods do not take into account if the node or the link is not selectable (See Selectable property), whereas the PointedNode and PointedLink properties ignore the items that are not selectable.

See Also

PointedNode property, PointedLink property.

Example

(VB)

The following code displays (in the TextBox Text1) the text of the node pointed by the mouse. Of course, in this example it would have been easier to use the PointedNode property directly.

Private Sub AddFlow1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
    With AddFlow1
        Dim node As afNode
        Dim log_X As Single, log_Y As Single
        ' Mouse coordinates  logical coordinates
        log_X = (x * 100 / AddFlow1.xZoom) + AddFlow1.xScroll
        log_Y = (y * 100 / AddFlow1.yZoom) + AddFlow1.yScroll
        Set node = .GetNodeAtPoint(log_X, log_Y)
        If node Is Nothing Then
             ' Nothing
        Else
            Text1 = node.Text
        End If
    End With
End Sub


GetVersion Method

Description

Returns the AddFlow ActiveX control version.

Syntax

object.GetVersion major, major

Arguments | Description
object | Object expression that references an AddFlow control.
major | Major version number.
minor | Minor version number.

For instance, if the control version number is 5.0, then major = 5 and minor = 0.


IsChanged Method

Description

Returns an integer value that is nonzero if the AddFlow diagram has changed, otherwise zero.
Call this method to determine if the AddFlow diagram has changed.

Syntax

changed = object.IsChanged

Arguments | Description
object | Object expression that references an AddFlow control.
changed | A boolean value: True if a change has occured, False elsewhere.

See Also

SetChangedFlag method.


IsSelChanged Method

Description

Returns an integer value that is nonzero if the selection in the AddFlow diagram has changed, otherwise zero.

Call this method to determine if the selection has changed.

Syntax

selchanged = object.IsSelChanged

Arguments | Description
object | Object expression that references an AddFlow control.
selchanged | A boolean value: True if a selection change has occured, False elsewhere.

See Also

SetSelChangedFlag method.


LoadFile Method

Description

Load a diagram from a file.

Syntax

object.LoadFile file

style | Description
object | Object expression that references an AddFlow control.
file | A string that defines the name of the file.

See Also

SaveFile method, LoadMemory method, SaveMemory method


LoadFile Method

LoadMemory Method

Description

Loads a diagram from memory.

Syntax

object.LoadMemory hMem

style | Description
object | Object expression that references an AddFlow control.
hMem | OLE_HANDLE, reference to a BLOB variable in memory.

Remarks

The hMem parameter is generally obtained by a previous call to the SaveMemory method.

See Also

SaveMemory method, SaveFile method, LoadFile method


Paste Method

Description

Pastes items from the clipboard to a diagram.

Syntax

object.Paste SelectPastedItems

style | Description
object | Object expression that references an AddFlow control.
SelectPastedItems | A boolean that indicates if the pasted items will be selected.

Remark

If a pasted item has an associated key and if that key is already used in the diagram, then an error event (Number = 1010) is fired : "Key is not unique in the collection". If you ignore that error event, then the item is pasted without its key. It is up to your application to assign a new key to this item.

Under VB, to ignore the error event and disable the message from appearing, you have just to write :

Private Sub AddFlow1_Error(Number As Integer, Description As String, Scode As Long, Source As String, HelpFile As String, HelpContext As Long, CancelDisplay As Boolean)
    If Number = 1010 Then  ' Duplicate key when pasting
        CancelDisplay = True
    End If
End Sub

See Also

Copy method, CanPaste method, Clipboard support topic


Redo Method

Description

Redo, if possible, the last action.

Syntax

object.Redo

Arguments | Description
object | Object expression that references an AddFlow control.

See Also

Undo method, CanRedo method, Undo/Redo topic.


Refresh Method

Description

If applied to an AddFlow control, it forces a repaint of the control.
If applied to a node or a link object, it forces a repaint of that object.

Syntax

object.Refresh

Arguments | Description
object | Object expression that references an AddFlow control or a node object or a link object.


SaveFile Method

Description

Save all the diagram in a file.

Syntax

object.SaveFile file

style | Description
object | Object expression that references an AddFlow control.
file | A string that defines the name of the file.

See Also

LoadFile method, LoadMemory method, SaveMemory method


SaveImage Method

Description

Save an image of the diagram using the metafile format. Unlike the SaveFile method, It does not save the diagram itself. It saves only an image of this diagram. This image can be used in every application that accept the Windows standard metafile format.

SaveImage is provided for compatibility with older versions. You should use the ExportPicture method instead.

Syntax

object.SaveImage tymed, format, file

style | Description
object | Object expression that references an AddFlow control.
tymed | Type of medium.
format | Format of data.
file | A string that defines the name of the file.

The settings for tymed are:

Constants | Value | Description
afTypeMediumFile | 0 | The image is saved in a file
afTypeMediumClipboard | 1 | The image is copied onto the clipboard

The settings for format are:

Constants | Value | Description
afWMF | 0 | Standard windows metafile format
afEMF | 1 | Enhanced windows metafile format

See Also

ExportPicture method


SaveFile Method

SaveMemory Method

Description

Save all the diagram in memory.

Syntax

hMem = object.SaveMemory(itemset)

style | Description
object | Object expression that references an AddFlow control.
hMem | OLE_HANDLE, reference to a BLOB variable in memory.
itemset | Describes the set of items to take into account in the export

The settings for itemset are:

Constants | Value | Description
afAllItems | 0 | all items
afSelectedItems | 1 | selected items
afMarkedItems | 2 | marked items

Remarks

The returned value can be used later as a parameter for LoadMemory.

See Also

LoadMemory method, SaveFile method, LoadFile method


SelectAll Method

Description

Selects all nodes and links.

Syntax

object.SelectAll

Arguments | Description
object | Object expression that references an AddFlow control.

Remarks

Nodes and links that are not Selectable will not be selected.

See Also

Selection topic, Selectable property


SelectRectangle Method

Description

Select the nodes and links placed in a rectangle.

Syntax

object.SelectRectangle(filter, left, top, width, height)

Arguments | Description
object | Object expression that references an AddFlow control.
itemset | an integer defining the set of items to take into account
left | A numeric value
top | A numeric value
width | A numeric value
height | A numeric value

The settings for itemset are:

Constants | Value | Description
afAllItems | 0 | all items
afSelectedItems | 1 | selected items
afMarkedItems | 2 | marked items


SetChangedFlag Method

Description

Allows setting a flag indicating that the diagram has changed or not. Typically, you should set this flag to False just after having saved the diagram.

Syntax

object.SetChangedFlag changed

Arguments | Description
object | Object expression that references an AddFlow control.
changed | a boolean value

See Also

IsChanged method.


SetSelChangedFlag Method

Description

Allows setting a flag indicating that the selection has changed or not.

Syntax

object.SetSelChangedFlag selchanged

Arguments | Description
object | Object expression that references an AddFlow control.
selchanged | a boolean value

See Also

IsSelChanged method, Selection topic


StartEdit Method

Description

This method enables a user to edit a text inside the selected node.

Syntax

object.StartEdit

Arguments | Description
object | Object expression that references an AddFlow control.

Remark

This method has no effect if there is no selected node. A node can be selected programmaticaly with the SelectedNode property or interactively by clicking it with the mouse.

See Also

EditMode property, SelectedNode property, BeforeEdit event, AfterEdit event


Undo Method

Description

This undoes the last action performed in AddFlow.

Syntax

object.Undo

Arguments | Description
object | Object expression that references an AddFlow control.

Remarks

Only the actions that change the AddFlow diagram can be undoable.

See Also

Redo method, CanUndo method, Undo/Redo topic


DisplayPropertyPage Method

UndocMethod Method

Description

The purpose of this method is to offer some new minor features or aleter some existing features without having to release a new major version. We cannot add a property or a method to add a new feature because we have to preserve the binary compatibility (A COM interface must not change). However, it is sometime necessary to add a new feature without having to wait for a new major version and this is the purpose of the UndocMethod method.

Syntax

object.UndocMethod param

Arguments | Description
object | Object expression that references an AddFlow control.
param | Integer value.

The settings for param are:

Value | Description
1 Provides a workaround allowing associating a picture to a node under C++ Builder.

The Picture property does not work under C++ Builder (for unclear reasons that do not depend on AddFlow). This workaround uses the BackPicture property. We have to set a flag so that AddFlow understands that the BackPicture property is used in another way than the normal one.
To position this flag:

AddFlow1.UndocMethod 1

Then, to associate a picture to a node, we have to:
- select that node
- associate the picture to the AddFlow BackPicture property (Internally, AddFlow associates this picture to the selected node). For instance (using C++ Builder):

if (AddFlow1->SelectedNode)
{
  TPicture *pic = new TPicture;
  pic->LoadFromFile("aaa.bmp");
  AddFlow1->BackPicture = pic;
}

4 In the V3, whenever a node became shorter than its picture, the size of that picture was adjusted to the size of the node. This behaviour was not logical and has been removed in the V4. Now, in the V4, the picture is just clipped (unless you use the afAdjustPictureSizetoNode option of the AutoSize property). However, for compatibility reasons, you may wish to keep the old behaviour of the V3. This is possible if you add in the Load event of your application:
AddFlow1.UndocMethod 4
5 Allows using a line clipping algorithm when printing diagram. This may be necessary with some printers which cannot handle correctly calls to the Polyline Windows API (if one of the points is outside the printing area). The line clipping algorithm corrects the endpoints of each line-segment to be inside the printing area.
If, when printing a diagram, you see that the links are not printed correctly, you may add in the Load event of your application:
AddFlow1.UndocMethod 5
8 | Allows removing the AddFlow OLE file dropping feature.
9 | Allows displaying shadows as in the V4.

Remarks

  • This method is a toggle method. Calling this method a second time with the same parameter removes the new behaviour.
  • You may place your calls to the UndocMethod at the beginning of your application (in the Load event if you use VB).


ZoomRectangle Method

Description

Zoom a rectangular portion of the diagram.

Syntax

object.ZoomRectangle(typezoom, left, top, width, height)

Arguments | Description
object | Object expression that references an AddFlow control.
typezoom | an integer defining the type of zooming
left | A numeric value
top | A numeric value
width | A numeric value
height | A numeric value

The settings for typezoom are:

Constants | Value | Description
 | 0 | isotropic zoom
 | 1 | anisotropic zoom


AfterEdit Event

AfterAddLink Event

Description

Occurs after a user creates a link.

Syntax

Private Sub object_AfterAddLink(ByVal NewLink As AddFlow4Lib.afLink)

Arguments | Description
object | Object expression that references an AddFlow control.
NewLink | Object expression that references the new created link.

Remark

  • The AfterAddLink event is generated after the user finishes the link drawing operation with the mouse.
  • This event is not generated if a link is created programmaticaly.


AfterEdit Event

AfterAddNode Event

Description

Occurs after a user creates a node.

Syntax

Private Sub object_AfterAddNode(ByVal NewNode As AddFlow4Lib.afNode)

Arguments | Description
object | Object expression that references an AddFlow control.
NewNode | Object expression that references the new created node.

Remark

  • The AfterAddNode event is generated after the user finishes the node drawing operation with the mouse.
  • This event is not generated if a node is created programmaticaly.


AfterEdit Event

Description

Occurs after a user edits the text of the selected node.

Syntax

Private Sub object_AfterEdit(cancel As Integer, newstring As String)

Arguments | Description
object | Object expression that references an AddFlow control.
cancel | An integer that determines if the operation is canceled. Any nonzero integer cancels the operation. The default is 0.
newstring | The string the user entered, or Null if the user canceled the operation.

Remark

Both the AfterEdit and the BeforeEdit events are generated only if the EditMode property is set to 1 (afEditMouseClick), or if the StartEdit method is invoked.

The AfterEdit event is generated after the user finishes the editing operation, which occurs when the user clicks outside the selected node or presses the ENTER key.

To cancel a node editing operation, set cancel to any nonzero number or to True. If a node editing operation is canceled, the previously existing node text is restored.

The newstring argument can be used to test for a condition before canceling an operation. For example, the following code cancels the operation if newstring is a number:

Private Sub AddFlow1_AfterEdit(Cancel As Integer, NewString As String)
If IsNumeric(NewString) Then
MsgBox "No numbers allowed"
Cancel = True
End If
End Sub

See Also

EditMode property, BeforeEdit event, StartEdit method


AfterEdit Event

AfterMove Event

Description

Occurs after a user drags the selected nodes.

Syntax

Private Sub object_AfterMove()

Arguments | Description
object | Object expression that references an AddFlow control.

Remarks

  • The AfterMove event is generated after the user finishes the nodes dragging operation with the mouse.
  • This event is not generated if the nodes are moved programmaticaly.
  • The dragged nodes are the nodes that are selected and therefore can be referenced via the SelNodes property.


AfterEdit Event

AfterResize Event

Description

Occurs after a user resizes a node.

Syntax

Private Sub object_AfterResize()

Arguments | Description
object | Object expression that references an AddFlow control.

Remarks

  • The AfterResize event is generated after the user finishes the node resizing operation with the mouse.
  • This event is not generated if the node is resized programmaticaly.
  • The resized node is the current one and therefore is referenced via the SelectedNode property.


AfterEdit Event

AfterSelect Event

Description

Occurs after a user selects items inside a selection rectangle.

Syntax

Private Sub object_AfterSelect()

Arguments | Description
object | Object expression that references an AddFlow control.

Remarks

  • The AfterSelect event is generated after the user finishes selecting operation with the mouse.
  • This event is not generated if the items are selected programmaticaly.


AfterEdit Event

AfterStretch Event

Description

Occurs after a user stretches a link.

Syntax

Private Sub object_AfterStretch()

Arguments | Description
object | Object expression that references an AddFlow control.

Remarks

  • The AfterStretch event is generated after the user finishes the link stretching operation with the mouse.
  • This event is not generated if the link is stretched programmaticaly.
  • The stretched link is the current one and therefore is referenced via the SelectedLink property.


BeforeEdit Event

BeforeAddLink Event

Description

Occurs when a user attempts to create a link. Cancelling the action aborts the link creation.

Syntax

Private Sub object_BeforeAddLink(ByVal Org As AddFlow4Lib.afNode, ByVal Dst As AddFlow4Lib.afNode, Cancel As Integer)

Arguments | Description
object | Object expression that references an AddFlow control.
Org | A reference to the node object that will be the origin of the new link.
Dst | A reference to a node object that will be the destination of the new link.
cancel | An integer that determines if the operation is canceled. Any nonzero integer cancels the operation. The default is 0.

Remark

  • The BeforeAddLink event is generated just before the user finishes the link drawing operation with the mouse.
  • This event is not generated if a link is created programmaticaly.
  • To cancel a link creation, set cancel to any nonzero number or to True. In such a case, the link is not created.


BeforeEdit Event

BeforeAddNode Event

Description

Occurs when a user attempts to create a node. Cancelling the action aborts the node creation.

Syntax

Private Sub object_BeforeAddNode(left as Single, top as Single, width as Single, height as Single, cancel As Integer)

Arguments | Description
object | Object expression that references an AddFlow control.
left | A numeric value that defines the left position of the node in twips.
top | A numeric value that defines the top position of the node in twips.
width | A numeric value that defines the width of the node in twips.
height | A numeric value that defines the height of the node in twips.
cancel | An integer that determines if the operation is canceled. Any nonzero integer cancels the operation. The default is 0.

Remark

  • The BeforeAddNode event is generated just before the user finishes the node drawing operation with the mouse.
  • This event is not generated if a node is created programmaticaly.
  • To cancel a node creation, set cancel to any nonzero number or to True. In such a case, the node is not created.


BeforeEdit Event

BeforeChangeDst Event

Description

Occurs when a user attempts to change the destination node of a link. Cancelling the action aborts the destination change.

Syntax

Private Sub object_BeforeChangeDst(ByVal Link As AddFlow4Lib.afLink, ByVal newDst As AddFlow4Lib.afNode, Cancel As Integer)

Arguments | Description
object | Object expression that references an AddFlow control.
Link | A reference to the link object that will have a new destination
newDst | A reference to a node object that will be the new destination of the link.
cancel | An integer that determines if the operation is canceled. Any nonzero integer cancels the operation. The default is 0.

Remark

  • The BeforeChangeDst event is generated just before the user finishes to move the link ending point over a node with the mouse.
  • This event is not generated if the destination change is made programmaticaly.
  • To cancel the destination change, set cancel to any nonzero number or to True.


BeforeEdit Event

BeforeChangeOrg Event

Description

Occurs when a user attempts to change the origin node of a link. Cancelling the action aborts the origin change.

Syntax

Private Sub object_BeforeChangOrg(ByVal Link As AddFlow4Lib.afLink, ByVal newOrg As AddFlow4Lib.afNode, Cancel As Integer)

Arguments | Description
object | Object expression that references an AddFlow control.
Link | A reference to the link object that will have a new origin node.
newOrg | A reference to a node object that will be the new origin of the link.
cancel | An integer that determines if the operation is canceled. Any nonzero integer cancels the operation. The default is 0.

Remark

  • The BeforeChangeOrg event is generated just before the user finishes to move the link starting point over a node with the mouse.
  • This event is not generated if the origin change is made programmaticaly.
  • To cancel the origin change, set cancel to any nonzero number or to True.


BeforeEdit Event

Description

Occurs when a user attempts to edit the text of the selected node. Cancelling the action aborts the inline edit.

Syntax

Private Sub object_BeforeEdit(cancel As Integer)

Arguments | Description
object | Object expression that references an AddFlow control.
cancel | An integer that determines if the operation is canceled. Any nonzero integer cancels the operation. The default is 0.

Remark

Both the AfterEdit and the BeforeEdit events are generated only if the EditMode property is set to 1 (afEditMouseClick), or if the StartEdit method is invoked.

To begin editing the text of a node, the user must first click the node to select it, and click it a second time to begin the operation. The BeforeEdit event occurs after the second click.

To determine which node's text is being edited, use the SelectedNode property. The following example checks the key of the selected node before allowing an edit. If the key is "table", the operation is cancelled.

Private Sub AddFlow1_BeforeEdit(Cancel As
Integer)
If AddFlow1.SelectedNode.Key = "table" Then
Cancel = True   ' Cancel the operation
End If
End Sub

Note that a node can be made uneditable with the EditMode property.

See Also

EditMode property, AfterEdit event, StartEdit method


AfterEdit Event

DiagramOwnerDraw Event

Description

Occurs when the AddFlow control is repainted. The OwnerDraw property of the AddFlow control must be set.

Syntax

Private Sub object_DiagramOwnerDraw(ByVal hdc As Long, flags As Long)

Arguments | Description
object | Object expression that references an AddFlow control.
hdc | A handle to the AddFlow window display context.
flags | A value indicating what is to be drawn.

The settings for flags are:

Constants | Value | Description
afDrawNone | 0 | AddFlow will draw nothing. The diagram is entirely drawn by the owner.
afDrawAll | 1 | AddFlow will draw all the diagram.

Remark

  • This event is generated only if the OwnerDraw property of the AddFlow control is true.
  • The hdc is already prepared for drawing according to the AddFlow coordinate system.
  • You are entirely responsible for the custom drawing you provide.

See Also

OwnerDraw property


Error Event

Description

This event is fired when an error occurs within AddFlow outside of the scope of a method call or property access.

Syntax

Private Sub object_Error(Number As Integer, Description As String, Scode As Long, Source As String, HelpFile As String, HelpContext As Long, CancelDisplay As Boolean)

Arguments | Description
object | Object expression that references an AddFlow control.
Number | Number of the error

The settings for Number are:

Constants | Value | Description
afKeyAlreadyExist | 1002 | The key already exists in the collection. May occur when changing interactively the link origin or destination node.
afCycleError | 1008 | The graph is not acyclic (see CycleMode property).
afDuplicateKeyIgnored | 1010 | At least one duplicate key has been ignored during the paste operation.
afOutDegreeError | 1015 | The link cannot be added (MaxOutDegree or MaxDegree limit)
afInDegreeError | 1016 | The link cannot be added (MaxInDegree or MaxDegree limit)
afDirectedCycleError | 1017 | The graph is not directed acyclic (see CycleMode property).
afReflexiveLinkNotAccepted | 1018 | Reflexive links are not accepted. May occur if the CanReflexLink property is false.
afMultipleLinkNotAccepted | 1019 | Multiple links are not accepted. May occur if the CanMultiLink property is false.

Remark

  • The Error event will not be fired if the CanFireError property is false, which is the case by default.
  • If CancelDisplay is true, the error message box is not displayed. You can provide instead another behaviour.

See Also

CanFireError property.


AfterEdit Event

LinkOwnerDraw Event

Description

Occurs when a link is repainted. The OwnerDraw property of the link must be set.

Syntax

Private Sub object_LinkOwnerDraw(ByVal hdc As Long, ByVal link As AddFlow4Lib.afLink, flags As Long)

Arguments | Description
object | Object expression that references an AddFlow control.
hdc | A handle to the AddFlow window display context.
link | Object expression that references the repainted link.
flags | A value indicating what is to be drawn for the link.

The settings for flags are:

Constants | Value | Description
afLinkDrawNone | 0 | AddFlow will draw nothing. The link is entirely drawn by the owner.
afLinkDrawShape | 1 | AddFlow will draw the link shape (its segments).
afLinkDrawArrows | 2 | AddFlow will draw the link arrows.
afLinkDrawText | 4 | AddFlow will draw the link text.
afLinkDrawAll | 7 | AddFlow will draw all the link.

Remark

  • This event is generated only if the OwnerDraw property of the link is true.
  • The hdc is already prepared for drawing according to the AddFlow coordinate system.
  • You are entirely responsible for the custom drawing you provide.

See Also

OwnerDraw property


AfterEdit Event

NodeOwnerDraw Event

Description

Occurs when a node is repainted. The OwnerDraw property of the node must be set.

Syntax

Private Sub object_NodeOwnerDraw(ByVal hdc As Long, ByVal node As AddFlow4Lib.afNode, flags As Long)

Arguments | Description
object | Object expression that references an AddFlow control.
hdc | A handle to the AddFlow window display context.
node | Object expression that references the repainted node.
flags | A value indicating what is to be drawn for the node.

The settings for flags are:

Constants | Value | Description
afNodeDrawNone | 0 | AddFlow will draw nothing. The node is entirely drawn by the owner.
afNodeDrawShape | 1 | AddFlow will draw the node shape.
afNodeDrawText | 2 | AddFlow will draw the node text.
afNodeDrawPicture | 4 | AddFlow will draw the node picture.
afNodeDrawAll | 7 | AddFlow will draw all the node.

Remark

  • This event is generated only if the OwnerDraw property of the node is true.
  • The hdc is already prepared for drawing according to the AddFlow coordinate system.
  • You are entirely responsible for the custom drawing you provide.

See Also

OwnerDraw property


Scroll Event

Description

This event is fired each time the diagram is scrolled.

Syntax

Private Sub object_Scroll()

Arguments | Description
object | Object expression that references an AddFlow control.

See Also

Scrolling topic


Left

Left, Top, Width, Height Property

Description

Sets or returns the position (Left, Top) and size (Width, Height) of the bounding rectangle of a node.
The values of these properties are given in twips.
Not available at design time.

Syntax

node.Left = left
node.Top = top
node.Width = width
node.Height = height
left = node.Left
top = node.Top
width = node.Width
height = node.Height

Arguments | Description
node | Object expression that references a node object.
left | A numeric value that defines the left position of the node in twips.
top | A numeric value that defines the top position of the node in twips.
width | A numeric value that defines the width of the node in twips.
height | A numeric value that defines the height of the node in twips.


Key Property

Description

Sets or returns a key associated with a node or a link. The key is a unique string that can be associated to a node or a link. It allows to identifies a node or a link. It can be used as the parameter for the Item method.
A key is unique. It means here that two nodes cannot have the same key and that two links attached to the same node cannot have the same key. But two links can have the same key if they are not in the same OutLinks or InLinks collection.
Not available at design time.

Syntax

object.Key = sKey
sKey = object.Key

Arguments | Description
object | Object expression that references a node or a link object.
sKey | A string expression

Remarks

  • If the Key value of a node or a link is an empty string (""), then we consider that the node or the link has no key.
  • The Key property cannot be a pure number because in such a case, it is considered as an index. (See the FAQ How to store an integer in the Key property? )

See Also

Item method, User data topic


OutLinks

OutLinks, InLinks, Links Property

Description

InLinks returns a reference to the collection of Link objects that comes to a node.
OutLinks returns a reference to the collection of Link objects that leaves a node.
Links returns a reference to the collection of Link objects that comes to a node or leaves it.

Not available at design time. Read-only at run-time.

Syntax

Set coll = object.InLinks
Set coll = object.OutLinks
Set coll = object.Links

Arguments | Description
object | Object expression that references a node object.
coll | Object expression that references a collection of links (afLink).

Remarks

  1. You may manipulate Link objects by using the standard methods of a collection (for instance, Add and Remove). It is possible to access each element of the collection with Item method or in an enumeration loop (For Each ... In)
  2. The Links collection is the union of the InLinks and OutLinks collections.
  3. Adding a link to the Links collection is the same thing as adding that link to the OutLinks collection (convention)

See Also

Navigation topic.


Logical Property

Description

Determines whether a node or link is in the “logical” flow.

Syntax

object.Logical = value
value = object.Logical

Arguments | Description
object | Object expression that references a node or a link object.
value | A boolean which determines if the object is logical.

Default value

True

Remarks

For instance, if a node is not “Logical” and if the LogicalOnly property is True, the Nodes collection will not contain this node. This allows excluding some nodes or links from the diagram logic, for instance, a node that just contains a label or a picture and that has not any role in the flow.

See Also

Performance Tuning topic, LogicalOnly property


Marked Property

Description

Returns/sets a flag indicating if a node or a link is marked or not. This property can be used in conjunction with the DeleteMarked method.

Syntax

object.Marked = value
value = object.Marked

Arguments | Description
object | Object expression that references a node or a link object.
value | A boolean which defines the "marked" flag.

Default value

False


Moveable Property

Description

Determines whether a node is moveable or not.
When a node is not moveable,the user cannot interactively drag it with the mouse.

Syntax

node.Moveable = value
value = object.Moveable

Arguments | Description
node | Object expression that references a node object.
value | A boolean which determines if the node can be moved by a user.

Default value

True

Remark

  • If the node is moveable, then you can make the node moveable only horizontally or only vertically with the xMoveable et yMoveable properties.
  • If the node is not moveable, then the xMoveable et yMoveable properties are ignored.

See also

xMoveable, yMoveable properties


Picture Property

Description

Sets or returns the picture to be displayed in a node. This picture can be a bitmap, an icon or a standard metafile or an enhanced metafile, a GIF file, a JPEG file.

Syntax

Set object.Picture = picture
Set picture = object.Picture

Arguments | Description
object | Object expression that references a node object.
picture | A reference to a picture object displayed inside a node.

The settings for picture are:

Value | Description
(none) | (Default)
(bmp,ico,wmf,emf,gif,jpeg) | Specifies a picture. You can also set this property using the LoadPicture function on a bitmap, an icon or a metafile (standard or enhanced), a GIF or a JPEG file.

Remarks

  1. Note the need to use the Set keyword. The picture is passed by reference.
  2. If you have a small number of distinct pictures that can be used in many nodes, you should use the PictureIndex property rather than the Picture property.

Example

Set node.Picture = LoadPicture("d:\labo\banner.gif")

See Also

PictureIndex property


PicturePosition Property

Description

If applied to a node, it returns/sets its picture position.
If applied to an AddFlow control, it returns/sets the default node picture position. When a node is created, it has this picture position.

Syntax

object.PicturePosition = style
style = object.PicturePosition

style | Description
object | Object expression that references an AddFlow control or a node object.
style | An integer that defines the node picture position.

The settings for position are:

Constants | Value | Description
afPictureLeftTOP | 0 | Picture at the left top position of the node
afPictureLeftMIDDLE | 1 | Picture at the left middle position of the node
afPictureLeftBOTTOM | 2 | Picture at the left bottom position of the node
afPictureRightTOP | 3 | Picture at the right top position of the node
afPictureRightMIDDLE | 4 | Picture at the right middle position of the node
afPictureRightBOTTOM | 5 | Picture at the right bottom position of the node
afPictureCenterTOP | 6 | Picture at the center top position of the node
afPictureCenterMIDDLE | 7 | Picture at the center middle position of the node
afPictureCenterBOTTOM | 8 | Picture at the center bottom position of the node
afRelativeToText | 9 | Picture at a position relative to text.


Selectable Property

Description

Determines whether a node or a link is selectable by clicking on it with the mouse or unselectable (readonly or inactive).

When a node or a link is unselectable, the user cannot interactively make it current or selected. He can do this only programmaticaly. For instance, an unselectable node may be used to display a picture or a text but the user cannot move or resize it with the mouse.

Syntax

object.Selectable = value
value = object.Selectable

Arguments | Description
node | Object expression that references a node or a link object.
value | A boolean which determines if the object is selectable.

Default value

True

See Also

Selection topic


Selected Property

Description

Returns/sets a flag indicating if a node or a link is selected or not.

Syntax

object.Selected = value
value = object.Selected

Arguments | Description
object | Object expression that references a node or a link object.
value | A boolean which determines if the object is selected.

Default value

False

Remarks

A node or a link that is not Selectable will not be selected.

See Also

Selection topic, Selectable property


Sizeable Property

Description

Determines whether a node is sizable or not.
When a node is not sizable,the user cannot interactively resize it with the mouse.

Syntax

node.Sizeable = value
value = object.Sizeable

Arguments | Description
node | Object expression that references a node object.
value | A boolean which determines if the node can be resized.

Default value

True

Remark

  • If the node is sizeable, then you can make the node sizeable only horizontally or only vertically with the xSizeable et ySizeable properties.
  • If the node is not sizeable, then the xSizeable et ySizeable properties are ignored.

See also

xSizeable, ySizeable properties


Tag Property

Description

Sets or returns a tag associated with a node or a link.

Syntax

object.Tag = sTag
sTag = object.Tag

Arguments | Description
object | Object expression that references a node or a link object.
sTag | A string expression

See Also

User data topic


Tag Property

TagVariant Property

Description

Sets or returns any variant value associated with a node or a link. This is a user data that is not used by AddFlow.

Syntax

object.TagVariant = value
value = object.TagVariant

Arguments | Description
object | Object expression that references a node or a link object.
value | A variant contains any value the container application wishes to associate with the object.

Remark

The TagVariant value is not used by AddFlow at all. It is not saved by the SaveFile method.

See Also

User data topic


Text Property

Description

Sets or returns the text associated with a node or a link.
The text associated to a node is displayed inside the node. It is a multiline display. The text is wrapped automatically inside the node. Linefeed and carriage return characters are supported for the text of a node.
The text associated to a link is displayed in a single line.

Syntax

object.Text = sText
sText = object.Text

Arguments | Description
object | Object expression that references a node or a link object.
sText | A string expression

Remarks

  1. The font and the color of the text are determined by the Font and ForeColor properties.
  2. The position of the text in a node is determined by the Alignment property.
  3. You can define the size of the margins for the text of a node, using the xTextMargin and yTextMargin properties.
  4. You can define the segment used to display the text of the link with the TextSegment property. By default the link text is displayed at the middle of its segment number n/2 + 1 (n is the number of segments).
  5. The text of the link is displayed in a single line.


ToolTip Property

Description

Sets or returns the tooltip text associated with a node or a link. The tooltip will be displayed only if the ShowToolTip property is True.

Syntax

object.ToolTip = sTooltip
sTooltip = object.ToolTip

Arguments | Description
object | Object expression that references a node or a link object.
sTooltip | A string expression

Remarks

  1. The tootips will not appear if you use another ActiveX control to “wrap” an AddFlow control. This is a known problem.
  2. AddFlow tooltips take only one line.

See Also

User data topic, ShowToolTip property


UserData Property

Description

Sets or returns a numeric data associated with a node or a link. If you need to associate a string to a node or a link, use the Tag or the Key property.

Syntax

object.UserData = value
value = object.UserData

Arguments | Description
object | Object expression that references a node or a link object.
value | An integer value.

See Also

User data topic


xMoveable

xMoveable, yMoveable Property

Description

Determines whether a node can be horizontally or vertically moved or not.

Syntax

object.xMoveable = value
object.yMoveable = value
value = object.xMoveable
value = object.yMoveable

Arguments | Description
node | Object expression that references a node object.
value | A boolean which determines if the node is vertically or horizontally moveable or not.

Default value

True

Remark

The xMoveable et yMoveable properties are taken into account only if the node is Moveable.

See also

Moveable property


xScrollable

xScrollable, yScrollable Property

Description

Determines whether a node can be horizontally or vertically scrolled or not.

Syntax

object.xScrollable = value
object.yScrollable = value
value = object.xScrollable
value = object.yScrollable

Arguments | Description
node | Object expression that references a node object.
value | A boolean which determines if the node is vertically or horizontally scrollable or not.

Default value

True

See Also

Scrolling topic


xSizeable

xSizeable, ySizeable Property

Description

Determines whether a node can be horizontally or vertically resized or not.

Syntax

object.xSizeable = value
object.ySizeable = value
value = object.xSizeable
value = object.ySizeable

Arguments | Description
node | Object expression that references a node object.
value | A boolean which determines if the node is vertically or horizontally sizeable or not.

Default value

True

Remark

The xSizeable et ySizeable properties are taken into account only if the node is Sizeable.

See also

Sizeable property


xSizeable

xTextMargin, yTextMargin Property

Description

Returns/sets the size of the margins for the text of the node. The margin is expressed in percentage of the size of the node.

Syntax

object.xTextMargin = value
object.yTextMargin = value
value = object.xTextMargin
value = object.yTextMargin

Arguments | Description
node | Object expression that references a node object.
value | An integer value (between 0 and 50) which specifies the margin.

Default value

0


ZOrder Property

Description

Places current Node or Link object at the front or back of the z-order.
Not available at design time; write only at run time.

Syntax

object.ZOrder = setting

Arguments | Description
object | Object expression that references a node or a link object.
setting | An integer value. If setting = 0, send object (node or link) Front If setting = 1, send object (node or link) Back

Remark

It is now better to use the ZOrderIndex property which is read/write.

See Also

ZOrderIndex property


ZOrderIndex Property

Description

Returns/sets the position of the object (node or link) in the z-order list.

Syntax

object.ZOrderIndex = index
index = object.ZOrderIndex

Arguments | Description
object | Object expression that references a node or a link object.
index | An integer value defining the position of the object in the z-order list.

Setting

index > 0
index <= (number of nodes + number of links)

If index = 1, then the object is placed at the back of the z-order.
If index = (number of nodes + number of links), then the object is placed at the front of the z-order.


Clone Method

Clone Method (Node object)

Description

Create a node as a copy of another one.

Syntax

Set node2 = node.Clone()

Arguments | Description
node | Object expression that references the model node.
node2 | Object expression that references the clone node.

Remarks

The clone has the same property values as its model and it is placed at the same position.


EnsureVisible Method

Description

Scrolls the diagram so that a node or a link is displayed at the center of the control window

Syntax

object.EnsureVisible

Arguments | Description
object | Object expression that references a node or a link object.


GetLinkedNode Method

Description

Returns the node connected via a given link.

Syntax

Set node2 = node.GetLinkedNode(link)

Arguments | Description
node | Object expression that references a node object.
node2 | Object expression that references the connected object
link | Object expression that references a link object.

Remarks

This method has been added to manage undirected graphs. In some situations, it may be useful to get the node B linked to the node A via a given link, without having to wonder if node A is the origin or the destination.

See Also

Navigation topic


PropertyPage Method

Description

Display the property page of a node or a link. This property page allows changing every properties (except the font) of the node or the link object.

Syntax

object.PropertyPage title, page

Arguments | Description
object | Object expression that references a node or a link.
title | A string expression used for the title of the property page.
page | an integer value that determines which page will be displayed first.

Remark

Depending on the value of the ShowPropertyPages property, the property page of a node or a link can be displayed automatically as soon as the user right click on that node or that link.

See Also

ShowPropertyPages property, DisplayPropertyPage method

Change properties of a node

Change properties of a link


Dst

Dst, Org Property

Description

Return/set the reference of the origin and destination nodes of a link.
Not available at design time. Read-only at run-time.

Syntax

link.Org = node
link.Dst = node
node = link.Org
node = link.Dst

Arguments | Description
node | Object expression that references a node object.
link | Object expression that references a link object.

See Also

Navigation topic


ExtraPoints Property

Description

Returns a reference to the collection of all the points of a Link object. The number of points is equal to the number of segments plus one. Not available at design time.

Syntax

Set coll = object.ExtraPoints

Arguments | Description
object | Object expression that references a link object.
coll | Object expression that references a link point collections (afLinkPoints)

Remarks

1)You may manipulate LinkPoint objects by using the standard methods of a collection (for instance, Add and Remove). It is possible to access each element of the collection with Item method or in a For Each loop.

2)When a link is created, its points collection is not empty. If it is a reflexive link, then the default number of points is 4. If it is not reflexive, then it depends on its style (See LinkStyle property) :

afPolyline | 2 points
afBezier | 2 points
afVerticalHorizontal | 3 points
afHorizontalVertical | 3 points
afVerticalHorizontalVertical | 4 points
afHorizontalVerticalHorizontal | 4 points

3)You can add points (and therefore segments) to a link only if its style is afPolyline or afBezier.

Examples

(VB)

'Add a point
link.ExtraPoints.Add 795, 2130

'Change a point
Dim lp As afLinkPoint
Set lp = lnkx.ExtraPoints.Item(1)
lp.X = 975
lp.Y = 1905
Set lnkx.ExtraPoints.Item(1) = lp

(VC)

// Add a point
link.GetExtraPoints().Add(795,
2130);

// Change a point
CLinkPoint lp;
lp = link.GetExtraPoints().GetItem(1);
lp.SetX(975);
lp.SetY(1905);
link.GetExtraPoints().SetRefItem(1, lp);

See Also

AdjustOrg property, AdjustDst property, LinkStyle property, OrthogonalDynamic property


OutIndex

OutIndex, InIndex Property

Description

Returns the index of a link, i.e its position in the origin Node Outlinks or destination node InLinks collection.
Not available at design time; read only at run time.

Syntax

index = link.InIndex
index = link.OutIndex

Arguments | Description
link | Object expression that references a link object.
index | An integer defining the returned index


Stretchable Property

Description

Determines whether a link is stretchable or not.
When a link is not stretchable ,the user cannot interactively stretch it with the mouse.

Syntax

object.Stretchable = value
value = object.Stretchable

Arguments | Description
object | Object expression that references a link object.
value | A boolean which determines if the link is stretchable.

Default value

True


DrawWidth Property

TextSegment Property

Description

It returns/sets the number of the segment used to display the text.

Syntax

object.TextSegment = value
value = object.TextSegment

Arguments | Description
object | Object expression that references a link object.
value | An integer value which defines segement number used to display the text of the link.

Setting

You can set TextSegment to a value of 0 to n where n is the number of segments.

Default value

0. In this case, the link text is displayed at the middle of its segment number n/2 + 1 (n is the number of segments)

Example

See Also

Text property


Clone Method

Clone Method (Link object)

Description

Create a link as a copy of another one.

Syntax

Set link2 = link.Clone(org, dst)

Arguments | Description
link | Object expression that references the model link.
link2 | Object expression that references the clone link.
org | Object expression that references the origin node of the clone.
dst | Object expression that references the destination node of the clone.

Remarks

The clone has the same property values as its model except the origin and the destination that may change, depending of the parameters.


Reverse Method

Description

Reverse the link origin and destination nodes. After a Reverse action, a link from node A to B becomes a link from node B to node A.

Syntax

object.Reverse

Arguments | Description
object | Object expression that references a link object.

See Also

Org, Dst properties, Navigation topic.


Count Method

Count Method (CustomShape Object)

Description

Returns the number of points that define the custom shape polygon.

Syntax

number = object.Count

Arguments | Description
object | Object expression that references a CustomShape object.
number | The returned number of points.

See also

Custom shapes


Add Method

AddPoint Method (CustomShape Object)

Description

Add a point to the set of points that allows defining the custom shape polygon. The x,y coordinates are percentages of the rectangle bounding the node.

Syntax

object.AddPoint(x, y)

The arguments are:

Arguments | Description
object | Object expression that references a CustomShape object
x | X coordinate (in %) of the point to add.
y | Y coordinate (in %) of the point to add.

See also

Custom shapes


Clear Method

Clear Method (CustomShape Object)

Description

Remove all the polygon points of a CustomShape object.

Syntax

object.Clear

Arguments | Description
object | Object expression that references a CustomShape object

See also

Custom shapes


Count Method

Description

Returns the number of objects in a collection.

Syntax

number = collection.Count

Arguments | Description
collection | Object expression that references a collection of nodes, links, pictures, customshapes or points.
number | The returned number of objects.

See Also

ExtraPoints property

Pictures property

Nodes property

InLinks, Links, OutLinks properties

SelLinks, SelNodes properties


Item Property

Description

Returns an object from a collection of nodes, links pictures or points.
Not available at design time; read only at run time.

Syntax

object = collection.Item(index)
object = collection.Item(key)

Arguments | Description
collection | Object expression that references a collection.
object | Object expression that references an object in a collection.
index | The index of an object in a collection.
key | The key of an object in a collection (nodes and links collections only).

See Also

Key property.

ExtraPoints property

Pictures property

Nodes property

InLinks, Links, OutLinks properties

SelLinks, SelNodes properties


Add Method

Add Method (Nodes collection)

Description

Creates a node, adds it to a collection of nodes and returns a reference to this node.

Syntax

Set node = collection.Add(left, top, width, height)

Arguments | Description
node | A reference to the created node.
collection | A reference to a Nodes collection.
left | A numeric value that defines the left position of the node in twips.
top | A numeric value that defines the top position of the node in twips.
width | A numeric value that defines the width of the node in twips.
height | A numeric value that defines the height of the node in twips.

Remark

The left, top, width and height parameters are expressed in twips.


Clear Method

Description

Remove all objects of a collection.

Syntax

collection.Clear

Arguments | Description
collection | Object expression that references a collection of nodes, links, pictures, custom shapes or points.

Remarks

If it is a collection of points, the effect of the Clear method is to reinitialize the collection since a link points collection is never empty and contains at least 2 points.

See Also

ExtraPoints property

Pictures property

Nodes property

InLinks, Links, OutLinks properties

SelLinks, SelNodes properties


Remove Method

Description

Remove an object from a collection. This object can be identified by its index in the collection or by its unique key if it is a collection of nodes or links.

Syntax

collection.Remove index
collection.Remove key

Arguments | Description
collection | Object expression that may reference a collection of nodes, links or points.
index | Index of the object in the collection.
key | Key of the object (nodes and links collections only).

Remark

If it is a collection of link points, you cannot remove the first and the last point of the collection.


Add Method

Add Method (Links collection)

Description

Creates a link, adds it to a collection of links and returns a reference to this link.

Syntax

Set link = collection.Add(node)

The arguments are:

Arguments | Description
link | A reference to the created link.
collection | A reference to a Links collection.
node | A reference to a node.


Add Method

Add Method (LinkPoints collection)

Description

Adds a point to a link collection of points.

Syntax

collection.Add(x, y)

The arguments are:

Arguments | Description
collection | A reference to a LinkPoints collection.
x | X coordinate of the point to add.
y | Y coordinate of the point to add.

Examples

(Visual Basic)

'Add a point
link.ExtraPoints.Add 795, 2130

(Visual C++)

// Add a point
link.GetExtraPoints().Add(795, 2130);


Add Method

Add Method (Pictures collection)

Description

Adds a picture to the pictures collection of an AddFlow control.

Syntax

collection.Add pic

The arguments are:

Arguments | Description
collection | A reference to a Pictures collection (afPicture)
pic | A reference to a picture object.

Examples

AddFlow1.Pictures.Add Picture1

See Also

Pictures property


Add Method

Add Method (CustomShapes collection)

Description

Add a custom shape to the collection of custom shapes.

Syntax

collection.Add customShape

The arguments are:

Arguments | Description
collection | A reference to a collection of custom shapes (afCustomShapes)
customShape | A reference to a custom shape object (afCustomShape)

See Also

Custom shapes


LayoutFlow

What is LayoutFlow?

Short Description

LayoutFlow is a set of four graph layout ActiveX controls. These controls are AddFlow extensions. Each of these controls allows performing a graph layout automatically, positioning its vertices (also called nodes) and edges (also called links) on a form containing an AddFlow control. You create the graph in AddFlow, then apply the layout to this graph. The primary purpose of those tools is to offer a way to display graphs or flow charts in a reasonable manner, following some aesthetic rules. Runtime Royalty free.

More informations

You may wish to draw a graph without having to worry about the position of each node or link. For that purpose, we provide LayoutFlow. It is a set of four graph layout controls:

  • HFlow (hierarchical layout)
  • OFlow (orthogonal layout)
  • SFlow (symmetric force directed layout)
  • TFlow (tree or radial layout)

A demonstration of each of these products is available in the LayoutDemo sample provided with AddFlow.

HFlow, OFlow, SFlow and TFlow are AddFlow extensions and you cannot use them without AddFlow. Typically, you can first create your nodes and links inside AddFlow, using the AddFlow API, giving each node a random or a (0,0) position. Then you call the layout method of the graph layout control of your choice. This method will position the nodes and the links in a reasonable manner in the AddFlow control, following some aesthetic rules that depend on the chosen control (hierarchical with HFlow, symmetric with SFlow, orthogonal with OFlow...)

If the AddFlow LogicalOnly property is true, then only the logical vertices of the AddFlow control are involved in this layout. This will allow you to apply the layout only to important vertices. For instance, you will be able to exclude a node just used to display a label by setting its Logical property to false.

1) HFlow

The HFlow layout algorithm arranges vertices in horizontal layers. The orders of the vertices are chosen so that the number of crossings is kept small.
HFlow just produces a reasonable solution, not the optimum solution.

2) OFlow

The OFlow layout algorithm allows performing an orthogonal layout on a graph. The layout is orthogonal since it produces an orthogonal drawing where each edge is drawn as a polygonal chain of alternating horizontal and vertical segments.

OFlow works with any graphs, connected or not. In the resulting drawing, if the graph is a graph of maximum degree four, then each node has the same size. If the degree of a node is higher than four, then the height of the node is expanded.

3) SFlow

The SFlow layout algorithm allows performing a symmetric layout on a graph. The symmetric layout produces a high degree of symmetry and is particularly useful for undirected graphs, where the directions of the edge are not important.

The resulting layout is often good. However it requires considerable computational resources and therefore should be used for small graphs (less than 300 nodes).

Using the animation mode you can see of SFlow is working.

4) TFlow

The TFlow layout algorithm allows performing a tree layout on a graph. The tree layout applies only to a specific subset of graphs: rooted trees. In such a graph, no vertice may have more than one parent.

The drawing of the tree occupies as little space as possible while satisfying certain aesthetics. If the DrawingStyle property is "Layered":

  • vertices at the same level of the tree are placed on the same line
  • a parent is centered over its childs

If the DrawingStyle property is "Radial":

  • the root is placed at the origin
  • the layers are concentric circles centered at the origin

Remarks

  • HFlow, OFlow, SFlow and TFlow are AddFlow extensions and you cannot use them without AddFlow.
  • LayoutFlow is installed with AddFlow.
  • LayoutFlow is licensed (same licensing as AddFlow: see License)


HFlow

What is HFlow?

HFlow is an ActiveX control allowing performing a hierarchical layout on a graph. Performing a layout automatically positions its vertices (also called nodes) and edges (also called links).

The hierarchical layout arranges vertices in horizontal layers. The orders of the vertices on the layers are chosen so that the number of crossings is kept as small as possible.

As HFlow applies to AddFlow diagrams, it can be viewed as an extension of AddFlow™, an ActiveX control dedicated to the creation and the use of flowchart diagrams or graphs. Note that it is necessary to use AddFlow version 5.00 or higher to be able to use HFlow 2.

At run-time, the HFlow control window is invisible. At design-time, the HFlow control is displayed as an icon on a form. This icon can't be sized.

The following VB6 code is all you need to do to perform a hierarchical layout:

HFlow1.LayerDistance = 1000 ' Sets the distance between adjacent levels
HFlow1.VertexDistance = 1500 ' Sets the distance between adjacent vertices
HFlow1.Orientation = North
HFlow1.LayerWidth = 0 ' No limitation in the number od vertices in a level
HFlow1.Layout AddFlow1 ' Perform the hierarchical layout

This code supposes that you have a form containing an AddFlow control and a HFlow control. You create the graph in the AddFlow control, using the AddFlow API, giving each vertex a random position or a (0,0) position.Then you apply the HFlow layout to this graph. And each vertex will be placed at a reasonable position.

If the AddFlow LogicalOnly property is true, then only the logical vertices of the AddFlow control are involved in this layout. This will allow you to apply the layout only to important vertices. For instance, you will be able to exclude a node just used to display a label by setting its Logical property to false.


Enhancements

HFlow 2 enhancements

HFlow 2 is now a part of LayoutFlow, a set of the AddFlow graph autolayout ActiveX controls: HFlow, OFlow, SFlow, TFlow.

It works with AddFlow 5 or Higher. It is compatible with previous versions on a source-code level.

New features

  • It now takes into account correctly the reflexive links.
  • xMargin and yMargin properties


LayerDistance Property, HFlow

 LayerDistance Property

Description

Returns or sets the distance between adjacant levels, in twips.

Syntax

HFlow1.LayerDistance = value
value = HFlow1.LayerDistance

Arguments | Description
HFlow1 | Object expression that references an HFlow control
value | A numeric value which defines the distance between layers

Default Value

500


LayerWidth Property, HFlow

 LayerWidth Property

Description

Returns or sets the maximum number of vertices in a layer. If it is 0, then there is no maximum number of vertices.

Syntax

HFlow1.LayerWidth = value
value = HFlow1.LayerWidth

Arguments | Description
HFlow1 | Object expression that references an HFlow control
value | An integer value which defines the maximum number of vertices.

Default Value

0


Orientation Property, HFlow

 Orientation Property

Description

Returns or sets the graph orientation (north, south, east, west).

Syntax

HFlow1.Orientation = value
value = HFlow1.Orientation

Arguments | Description
HFlow1 | Object expression that references an HFlow control
value | An integer that defines the orientation

The settings for value are:

Constants | Value | Description
North | 0 | The root is at the top, its siblings are under it.
East | 1 | The root is at the right, its siblings are to its left.
South | 2 | The root is at the bottom, its siblings are above it.
West | 3 | The root is at the left, its siblings are to its right.

Default Value

North


VertexDistance Property, HFlow

 VertexDistance Property

Description

Returns or sets the distance between adjacant vertices, in twips.

Syntax

HFlow1.VertexDistance = value
value = HFlow1.VertexDistance

Arguments | Description
HFlow1 | Object expression that references an HFlow control
value | A numeric value which defines the distance between vertices

Default Value

500


Orientation Property, HFlow

 xMargin, yMargin Property

Description

Returns or sets the size in twips of the left and top margins used by the hierarchic algorithm to draw the graph.

Syntax

HFlow1.xMargin = xMargin
xMargin = HFlow1.xMargin
HFlow1.yMargin = yMargin
yMargin= HFlow1.yMargin

Arguments | Description
HFlow1 | Object expression that references an HFlow control
xMargin | numeric expression
yMargin | numeric expression

Default Value

600 twips


DisplayPropertyPage Method, HFlow

 DisplayPropertyPage Method

Description

Display the HFlow property page.

Syntax

HFlow1.DisplayPropertyPage

Arguments | Description
HFlow1 | Object expression that references an HFlow control.


Layout Method, HFlow

 Layout Method

Description

Performs the hierarchical layout algorithm.

Syntax

HFlow1.Layout AddFlow1

Arguments | Description
HFlow1 | Object expression that references an HFlow control.
AddFlow1 | Object expression that references an AddFlow control.


TFlow

What is OFlow?

OFlow is an ActiveX control allowing performing an orthogonal layout on a graph. Performing a layout automatically positions its vertices (also called nodes) and edges (also called links). The layout is orthogonal since it produces an orthogonal drawing where each edge is drawn as a polygonal chain of alternating horizontal and vertical segments.

OFlow works with any graphs, connected or not. In the resulting drawing, if the graph is a graph of maximum degree four, then each node has the same size. If the degree of a node is higher than four, then the height of the node is expanded.

As OFlow applies to AddFlow diagrams, it can be viewed as an extension of AddFlow™, an ActiveX control dedicated to the creation and the use of flowchart diagrams or graphs. Note that it is necessary to use AddFlow version 5.00 or higher to be able to use OFlow.

At run-time, the OFlow control window is invisible. At design-time, the OFlow control is displayed as an icon on a form. This icon can't be sized.

The following VB6 code is all you need to do to perform the layout:

OFlow1.xGrid = 600
OFlow1.yGrid = 600
OFlow1.Orientation = North
OFlow1.Layout AddFlow1 ' Perform the orthogonal layout

This code supposes that you have a form containing an AddFlow control and a OFlow control. You create the graph in the AddFlow control, using the AddFlow API, giving each vertex a random position or a (0,0) position. Then you apply the OFlow layout to this graph.

If the AddFlow LogicalOnly property is true, then only the logical vertices of the AddFlow control are involved in this layout. This will allow you to apply the layout only to important vertices. For instance, you will be able to exclude a node just used to display a label by setting its Logical property to false.


Orientation Property, HFlow

 NodeSizeRatio Property

Description

Returns or sets the size of the node expressed in percentage of the grid size used by the orthogonal algorithm.

Syntax

OFlow1.NodeSizeRatio = value
value = OFlow1.NodeSizeRatio

Arguments | Description
OFlow1 | Object expression that references an OFlow control
value | An integer value (between 1 and 100) which specifies the margin.

Default Value

50

See Also

xGrid, yGrid properties


Orientation Property, HFlow

 Orientation Property

Description

Returns or sets the graph orientation (north, south, east, west).

Syntax

OFlow1.Orientation = value
value = OFlow1.Orientation

Arguments | Description
OFlow1 | Object expression that references an OFlow control
value | An integer that defines the orientation

The settings for value are:

Constants | Value | Description
North | 0 | from bottom to top
East | 1 | from left to right
South | 2 | from top to bottom
West | 3 | from right to left

Default Value

North


Orientation Property, HFlow

 xGrid, yGrid Property

Description

Returns or sets the size in twips of the grid used by the orthogonal algorithm. The vertices are placed on the grid. The size of each vertex is equal to the size of the grid divided by 2.

Syntax

OFlow1.xGrid = xGrid
xGrid = OFlow1.xGrid
OFlow1.yGrid = yGrid
yGrid = OFlow1.yGrid

Arguments | Description
OFlow1 | Object expression that references an OFlow control
xGrid | numeric expression
yGrid | numeric expression

Default Value

600 twips


Orientation Property, HFlow

 xMargin, yMargin Property

Description

Returns or sets the size in twips of the left and top margins used by the orthogonal algorithm to draw the graph.

Syntax

OFlow1.xMargin = xMargin
xMargin = OFlow1.xMargin
OFlow1.yMargin = yMargin
yMargin= OFlow1.yMargin

Arguments | Description
OFlow1 | Object expression that references an OFlow control
xMargin | numeric expression
yMargin | numeric expression

Default Value

600 twips


DisplayPropertyPage Method, HFlow

 DisplayPropertyPage Method

Description

Display the OFlow property page.

Syntax

OFlow1.DisplayPropertyPage

Arguments | Description
OFlow1 | Object expression that references an OFlow control.


Layout Method, HFlow

 Layout Method

Description

Performs the orthogonal layout algorithm.

Syntax

OFlow1.Layout AddFlow1

Arguments | Description
OFlow1 | Object expression that references an OFlow control.
AddFlow1 | Object expression that references an AddFlow control.


SFlow

What is SFlow?

SFlow is an ActiveX control allowing performing a symmetric layout on a graph. Performing a layout automatically positions its vertices (also called nodes) and edges (also called links).

The symmetric layout produces a high degree of symmetry and is particularly useful for undirected graphs, where the directions of the edge are not important.

As SFlow applies to AddFlow diagrams, it can be viewed as an extension of AddFlow™, an ActiveX control dedicated to the creation and the use of flowchart diagrams or graphs. Note that it is necessary to use AddFlow version 5.00 or higher to be able to use SFlow 2.

At run-time, the SFlow control window is invisible. At design-time, the SFlow control is displayed as an icon on a form. This icon can't be sized.

he following VB6 code is all you need to do to perform a symmetric layout on a graph:

SFlow1.Distance = 1000 ' Sets the distance between vertices.
SFlow1.Layout AddFlow1 ' Perform the symmetrical layout

This code supposes that you have a form containing an AddFlow control and a SFlow control. You create the graph in the AddFlow control, using the AddFlow API, giving each vertex a random position or a (0,0) position.Then you apply the SFlow layout to this graph. And each vertex will be placed at a reasonable position.

If the AddFlow LogicalOnly property is true, then only the logical vertices of the AddFlow control are involved in this layout. This will allow you to apply the layout only to important vertices. For instance, you will be able to exclude a node just used to display a label by setting its Logical property to false.


Enhancements

SFlow 2 enhancements

SFlow 2 is now a part of LayoutFlow, a set of the AddFlow graph autolayout ActiveX controls: HFlow, OFlow, SFlow, TFlow.

It works with AddFlow 5 or Higher. It is compatible with previous versions on a source-code level.

New features

  • It now takes into account correctly the reflexive links.
  • DisplayPropertypage method
  • Animation property
  • RandomStart property
  • SendStepEvent property
  • Step event
  • UnmoveableNodesAccepted property
  • xMargin and yMargin properties


AutoScroll Property

Animation Property

Description

Determines whether the animation mode is set or not.

Syntax

SFlow1.Animation = value
value = SFlow1.Animation

Arguments | Description
SFlow1 | Object expression that references a SFlow control.
value | A boolean which determines whether the animation mode is set or not.

Default value

False


Distance Property, SFlow

Distance Property

Description

Returns or sets the distance between vertices, in twips.

Syntax

SFlow1.Distance = value
value = SFlow1.Distance

Arguments | Description
SFlow1 | Object expression that references a SFlow control
value | A numeric value which defines the distance between vertices

Default Value

1500


AutoScroll Property

RandomStart Property

Description

Determines whether the nodes are placed randomly at the beginnining of the layout.

Syntax

SFlow1.RandomStart = value
value = SFlow1.RandomStart

Arguments | Description
SFlow1 | Object expression that references a SFlow control.
value | A boolean which determines the nodes are placed randomly at the beginnining of the layout.

Default value

True


AutoScroll Property

SendStepEvent Property

Description

Determines whether the Step event is fired at each step.

Syntax

SFlow1.SendStepEvent = value
value = SFlow1.SendStepEvent

Arguments | Description
SFlow1 | Object expression that references a SFlow control.
value | A boolean which determines whether the Step event is fired at each step.

Default value

False


AutoScroll Property

UnmoveableNodesAccepted Property

Description

Determines the layout takes account of the Moveable status of the nodes.

Syntax

SFlow1.UnmoveableNodesAccepted = value
value = SFlow1.UnmoveableNodesAccepted

Arguments | Description
SFlow1 | Object expression that references a SFlow control.
value | A boolean which determines the layout takes account of the Moveable status of the nodes.

Default value

False


Orientation Property, HFlow

 xMargin, yMargin Property

Description

Returns or sets the size in twips of the left and top margins used by the symmetric algorithm to draw the graph.

Syntax

SFlow1.xMargin = xMargin
xMargin = SFlow1.xMargin
SFlow1.yMargin = yMargin
yMargin= SFlow1.yMargin

Arguments | Description
SFlow1 | Object expression that references an sFlow control
xMargin | numeric expression
yMargin | numeric expression

Default Value

600 twips


DisplayPropertyPage Method, HFlow

 DisplayPropertyPage Method

Description

Display the SFlow property page.

Syntax

SFlow1.DisplayPropertyPage

S | Description
HFlow1 | Object expression that references an SFlow control.


Layout Method, SFlow

 Layout Method

Description

Performs the symmetric layout algorithm.

Syntax

SFlow1.Layout AddFlow1

Arguments | Description
SFlow1 | Object expression that references a SFlow control.
AddFlow1 | Object expression that references an AddFlow control.


Scroll Event

Step Event

Description

This event is fired during the layout execution if the SendStepEvent property is true.

Syntax

Private Sub object_Step()

Arguments | Description
object | Object expression that references a SFlow control.


TFlow

What is TFlow?

TFlow is an ActiveX control allowing performing a tree layout on a graph. Performing a layout automatically positions its vertices (also called nodes) and edges (also called links).

The tree layout applies only to a specific subset of graphs: rooted trees. In such a graph, no vertice may have more than one parent.

The drawing of the tree occupies as little space as possible while satisfying certain aesthetics. If the DrawingStyle property is "Layered":

  • vertices at the same level of the tree are placed on the same line
  • a parent is centered over its childs

If the DrawingStyle property is "Radial":

  • the root is placed at the origin
  • the layers are concentric circles centered at the origin

As TFlow applies to AddFlow diagrams, it can be viewed as an extension of AddFlow™, an ActiveX control dedicated to the creation and the use of flowchart diagrams or graphs. Note that it is necessary to use AddFlow version 5.00 or higher to be able to use TFlow 2.

At run-time, the TFlow control window is invisible. At design-time, the TFlow control is displayed as an icon on a form. This icon can't be sized.

The following VB6 code is all you need to do to perform a tree layout:

TFlow1.LayerDistance = 1000 ' Sets the distance between adjacent levels
TFlow1.VertexDistance = 1000 ' Sets the distance between adjacent vertices
TFlow1.Orientation = North
TFlow1.DrawingStyle = Layered
TFlow1.Layout AddFlow1 ' Perform the tree layout

This code supposes that you have a form containing an AddFlow control and a TFlow control. You create the graph in the AddFlow control, using the AddFlow API, giving each vertex a random position or a (0,0) position. Then you apply the TFlow layout to this graph.

If the AddFlow LogicalOnly property is true, then only the logical vertices of the AddFlow control are involved in this layout. This will allow you to apply the layout only to important vertices. For instance, you will be able to exclude a node just used to display a label by setting its Logical property to false.


Enhancements

TFlow 2 enhancements

TFlow 2 is now a part of LayoutFlow, a set of the AddFlow graph autolayout ActiveX controls: HFlow, OFlow, SFlow, TFlow.

It works with AddFlow 5 or Higher. It is compatible with previous versions on a source-code level.

New features

  • It now takes into account correctly the reflexive links.
  • DrawingStyle property allowing hierarchical or radial drawings.
  • xMargin and yMargin properties


Orientation Property, TFlow

 DrawingStyle Property

Description

Returns or sets the drawing style used to draw the tree (Layered, Radial).

Syntax

TFlow1.DrawingStyle = value
value = TFlow1.DrawingStyle

Arguments | Description
TFlow1 | Object expression that references a TFlow control
value | An integer that defines the drawing style

The settings for value are:

Constants | Value | Description
Layered | 0 | Vertices are arranged in horizontal (or vertical, depending on the choosen orientation) layers
Radial | 1 | The root is placed at the origin and the layers are concentric circles centered at the origin.

Default Value

Layered


LayerDistance Property, TFlow

 LayerDistance Property

Description

Returns or sets the distance between adjacant levels, in twips.

Syntax

TFlow1.LayerDistance = value
value = TFlow1.LayerDistance

Arguments | Description
TFlow1 | Object expression that references a TFlow control
value | A numeric value which defines the distance between layers

Default Value

500


Orientation Property, TFlow

 Orientation Property

Description

Returns or sets the graph orientation (north, south, east, west).

Syntax

TFlow1.Orientation = value
value = TFlow1.Orientation

Arguments | Description
TFlow1 | Object expression that references a TFlow control
value | An integer that defines the orientation

The settings for value are:

Constants | Value | Description
North | 0 | The root is at the top, its siblings are under it.
East | 1 | The root is at the right, its siblings are to its left.
South | 2 | The root is at the bottom, its siblings are above it.
West | 3 | The root is at the left, its siblings are to its right.

Default Value

North


VertexDistance Property, TFlow

VertexDistance Property

Description

Returns or sets the distance between adjacant vertices, in twips.

Syntax

TFlow1.VertexDistance = value
value = TFlow1.VertexDistance

Arguments | Description
TFlow1 | Object expression that references a TFlow control
value | A numeric value which defines the distance between vertices

Default Value

500


Orientation Property, HFlow

 xMargin, yMargin Property

Description

Returns or sets the size in twips of the left and top margins used by the tree algorithm to draw the graph.

Syntax

TFlow1.xMargin = xMargin
xMargin = TFlow1.xMargin
TFlow1.yMargin = yMargin
yMargin= TFlow1.yMargin

Arguments | Description
TFlow1 | Object expression that references a TFlow control
xMargin | numeric expression
yMargin | numeric expression

Default Value

600 twips


DisplayPropertyPage Method, TFlow

 DisplayPropertyPage Method

Description

Display the TFlow property page.

Syntax

TFlow1.DisplayPropertyPage

Arguments | Description
TFlow1 | Object expression that references a TFlow control.


Layout Method, TFlow

 Layout Method

Description

Performs the tree layout algorithm.

Syntax

TFlow1.Layout AddFlow1

Arguments | Description
TFlow1 | Object expression that references a TFlow control.
AddFlow1 | Object expression that references an AddFlow control.

Remark

If the graph is not a rooted tree, an error is generated.


LayoutFlow

What are the free extensions?

The free extensions is a set of two free ActiveX controls.

  • PrnFlow (Printing / Previewing of AddFlow diagrams)
  • XMLFlow (Loading / Saving of AddFlow diagram in XML)

XMLFlow and PrnFlow can be used freely.

The source code (written in C++/MFC) of PrnFlow and XMLFlow is available free of charge for AddFlow 5 registered users.


PrnFlow

What is PrnFlow?

PrnFlow is an ActiveX control allowing to print AddFlow diagrams. It allows multipage printing, print previewing, margins, header and footer. It can be viewed as an extension of AddFlow. Note that it is necessary to use AddFlow version 5.2 or higher to be able to use PrnFlow 5.0.

No support is provided for PrnFlow. However, the source code of PrnFlow (written in C++/MFC) is available free of charge for the AddFlow 5 registered users.

The following VB6 code is all you need to do to print your diagram with PrnFlow:

PrnFlow1.DocName = sFileTitle
' Prints a dotted box in each page
PrnFlow1.PageBorder = PageBorderDottedBoxDot
' The header contains the file name (placed at the left)
' and the date (placed at the right)
PrnFlow1.Header = sFileTitle & "||" & Format(Date, "dd-mmm-yyyy")
' The footer contains the page number (placed at the center)
PrnFlow1.Footer = "|- Page <PAGE> -|"
PrnFlow1.ForeColor = vbBlue
' Print the AddFlow diagram
PrnFlow1.PrintDoc

To preview an AddFlow diagram, you may use the previous code, just replacing the call to the PrintDoc method by the call to the PreviewDoc method. The diagram will be previewed in the PrnFlow control window. The user can:

  • switch pages by shift-double clicking on the preview window.
  • zoom in and out by double clicking on the preview window.


Enhancements

PrnFlow 5 changes

PrnFlow 5 is not 100% compatible with the previous versions. However the features are the same.

The changes are the following:

  • The hWndFlow property is no more useful and therefore has been removed.
  • The Orientation property is no more useful and has been removed.
  • The Preview property has been removed.
  • The PreviewDoc method has been added.


DocName Property, PrnFlow

DocName Property

Description

Returns or sets the name of the current document.

Syntax

PrnFlow1.DocName[ = value As String]

Remarks

The DocName property defines the string that appears in the default Abort dialog and on the Windows Print Manager list.


FitToPage Property, PrnFlow

FitToPage Property

Description

Determines whether all the diagram is printed in one page or several pages.

Syntax

PrnFlow1.FitToPage[ = {True | False}]

Default Value

False


Footer Property, PrnFlow

Footer Property

Description

Returns or sets the footer text.

Syntax

PrnFlow1.Footer[ = value As String]

Remarks

The Footer is composed of three sections, separated by pipe characters ("|"). The first section is left-justified, the second is centered, and the third is right-justified.

You may include a page number field by embedding a "<PAGE>" code in the string.

Example

' Print the page number at the center of the footer zone.
PrnFlow1.Footer = "|- Page <PAGE> -|"


Header Property, PrnFlow

Header Property

Description

Returns or sets the header text.

Syntax

PrnFlow1.Header[ = value As String]

Remarks

The Header is composed of three sections, separated by pipe characters ("|"). The first section is left-justified, the second is centered, and the third is right-justified.

You may include a page number field by embedding a "<PAGE>" code in the string.

Example

' Print the document name at the left of the header zone,
' and a date at the right of the header zone
PrnFlow1.Header = sFileTitle & "||" & Format(Date, "dd-mmm-yyyy")


HorzPageCount Property, PrnFlow

HorzPageCount Property

Description

Returns the horizontal number of pages in the current document. This property used with the VertPageCount and PreviewPage properties may allow you to navigate in the bidimentional matrix of pages.

Syntax

Val = PrnFlow1.HorzPageCount

See Also

PageCount property, VertPageCount property, PreviewPage property


MarginBottom Property, PrnFlow

MarginBottom Property

Description

Returns or sets the bottom margin, in twips.

Syntax

PrnFlow1.MarginBottom[ = value As Single]

Default Value

1440


MarginFooter Property, PrnFlow

MarginFooter Property

Description

Returns or sets the footer margin, in twips.

Syntax

PrnFlow1.MarginFooter[ = value As Single]

Default Value

0


MarginHeader Property, PrnFlow

MarginHeader Property

Description

Returns or sets the header margin, in twips.

Syntax

PrnFlow1.MarginHeader[ = value As Single]

Default Value

0


MarginLeft Property, PrnFlow

MarginLeft Property

Description

Returns or sets the left margin, in twips.

Syntax

PrnFlow1.MarginLeft[ = value As Single]

Default Value

1440


MarginRight Property, PrnFlow

MarginRight Property

Description

Returns or sets the right margin, in twips.

Syntax

PrnFlow1.MarginRight[ = value As Single]

Default Value

1440


MarginTop Property, PrnFlow

MarginTop Property

Description

Returns or sets the top margin, in twips.

Syntax

PrnFlow1.MarginTop[ = value As Single]

Default Value

1440


MousePage Property, PrnFlow

MousePage Property

Description

Returns or sets whether the user can switch pages by shift-double clicking on the preview window.

If MousePage is true, then the user may switch pages back and forth by Shift-double clicking the mouse with the left and right mouse buttons.

If MousePage is false, then no automatic paging with the mouse is performed.

Syntax

PrnFlow1.MousePage[ = {True | False}]

Default Value

True


MouseZoom Property, PrnFlow

MouseZoom Property

Description

Returns or sets whether the user can zoom in and out by double clicking on the preview window with the with the left (zoom out) or right (zoom in) mouse buttons.

If MouseZoom is true, then double clicking the mouse with the left button zoom out by incrementing the Zoom property by a step of 10% and double clicking the mouse with the right button zoom in by decrementing the Zoom property by a step of 10%.

If MouseZoom is false, then no automatic zooming with the mouse is performed.

Syntax

PrnFlow1.MouseZoom[ = {True | False}]

Default Value

True

See Also

Zoom property


PageBorder Property, PrnFlow

PageBorder Property

Description

Returns or sets the type of border to draw around each page.

Syntax

PrnFlow1.PageBorder[ = style]

Arguments | Description
PrnFlow1 | Object expression that references a PrnFlow control.
style | An integer that defines the page border style.

The settings for style are:

Constants | Value | Description
PageBorderNone | 0 | no border
PageBorderTopLine | 1 | a line under the top margin
PageBorderBottomLine | 2 | a line above the bottom margin
PageBorderTopBottomLines | 3 | 2 lines, one under the top margin and one above the bottom margin
PageBorderBox | 4 | a box
PageBorderDottedTopLine | 5 | a dotted line under the top margin
PageBorderDottedBottomLine | 6 | a dotted line above the bottom margin
PageBorderDottedTopBottomLines | 7 | 2 dotted lines, one under the top margin and one above the bottom margin
PageBorderDottedBoxDot | 8 | a dotted box


PageCount Property, PrnFlow

PageCount Property

Description

Returns the number of pages in the current document.

Syntax

Val = PrnFlow1.PageCount


PreviewPage Property, PrnFlow

PreviewPage Property

Description

Returns or sets the current preview page (first page is 1).

Syntax

PrnFlow1.PreviewPage [ = page]

Remarks

Valid pages range from 1 to PageCount.


PrinterSettings Property, PrnFlow

PrinterSettings Property

Description

Determines whether a printer settings dialog box is displayed before printing.

Syntax

PrnFlow1.PrinterSettings [ = {True | False}]


VertPageCount Property, PrnFlow

VertPageCount Property

Description

Returns the vertical number of pages in the current document. This property used with the HorzPageCount and PreviewPage properties may allow you to navigate in the bidimentional matrix of pages.

Syntax

Val = PrnFlow1.VertPageCount

See Also

PageCount property, HorzPageCount property, PreviewPage property


Zoom Property, PrnFlow

Zoom Property

Description

Specify a zoom factor which can be 0 or a value between 10 and 400.

Setting it to 0 displays the preview page, so that it fits vertically in the control area.

Setting it to 100% displays the preview page in actual size.

Setting it to a value higher than 100% expands the preview page.

Setting it to a value less than 100% shrinks the preview page.

If the page image is larger than the control, scroll bars are automatically added.

If the control is larger than the page image, the image is centered on the control.

Syntax

PrnFlow1.Zoom[ = setting]

Default Value

0

See Also

MouseZoom property


NextPage Method, PrnFlow

NextPage Method

Description

Previews the next page.

Syntax

PrnFlow1.NextPage


PrintDoc Method, PrnFlow

PageSetup Method

Description

Page setup method

Syntax

PrnFlow1.PageSetup

Example

PrnFlow1.PageSetup


PrintDoc Method, PrnFlow

PreviewDoc Method

Description

Preview the AddFlow diagram in the PrnFlow window

Syntax

PrnFlow1.PreviewDoc

Example

' Preview the AddFlow diagram
PrnFlow1.PreviewDoc


PrintDoc Method, PrnFlow

PrintDoc Method

Description

Prints the document on the printer

Syntax

PrnFlow1.PrintDoc

Example

' Print the AddFlow diagram
PrnFlow1.PrintDoc


PriorPage Method, PrnFlow

PriorPage Method

Description

Previews the prior page.

Syntax

PrnFlow1.PriorPage


BeforeFooter Method, PrnFlow

BeforeFooter Event

Description

Fired before printing the footer for each page to allow font changes.


BeforeHeader Method, PrnFlow

BeforeHeader Event

Description

Fired before printing the header for each page to allow font changes.


BeforePageBorder Method, PrnFlow

BeforePageBorder Event

Description

Fired before printing the page border for each page to allow color change.


PrnFlow

What is XMLFlow?

XMLFlow is an ActiveX control allowing saving/loading an AddFlow diagram in a XML file or a XML string. It can be viewed as an extension of AddFlow. Note that it is necessary to use AddFlow version 5.2 or higher to be able to use XMLFlow.

No support is provided for XMLFlow. However, the source code of XMLFlow (written in C++/MFC) is available free of charge for the AddFlow 5 registered users.

The following VB6 code is all you need to do to save a diagram with XMLFlow:

XMLFlow1.SaveFlowToXML AddFlow1, sFileName

To load a diagram from a xml file:

XMLFlow1.LoadXMLToFlow AddFlow1, sFileName


Layout Method, HFlow

 SaveFlowToXML Method

Description

Save the diagram in a XML file.

Syntax

XMLFlow1.SaveFlowToXML AddFlow1, filename

Arguments | Description
XMLFlow1 | Object expression that references a XMLFlow control.
AddFlow1 | Object expression that references an AddFlow control.
filename | The name of the file


Layout Method, HFlow

 LoadXMLToFlow Method

Description

Load a diagram from a XML file.

Syntax

XMLFlow1.LoadXMLToFlow AddFlow1, filename

Arguments | Description
XMLFlow1 | Object expression that references a XMLFlow control.
AddFlow1 | Object expression that references an AddFlow control.
filename | The name of the file


Layout Method, HFlow

 XMLTextToFlow Method

Description

Load a diagram from a XML string.

Syntax

XMLFlow1.XMLTextToFlow AddFlow1, xmlText

Arguments | Description
XMLFlow1 | Object expression that references a XMLFlow control.
AddFlow1 | Object expression that references an AddFlow control.
xmlText | A xml string


Layout Method, HFlow

 FlowToXMLText Method

Description

Save the diagram in a XML string.

Syntax

xmlText = XMLFlow1.FlowToXMLText AddFlow1, select

Arguments | Description
XMLFlow1 | Object expression that references a XMLFlow control.
AddFlow1 | Object expression that references an AddFlow control.
select | A boolean expression. If true, only the selected nodes and links are saved.
xmlText A xml string


GridColor Property

Description

It returns/sets the drawing color of the grid.

Syntax

object.GridColor = color
color = object.GridColor

Arguments | Description
object | Object expression that references an AddFlow control.
color | The grid color.

The settings for color are:

Value | Description
Normal RGB Colors | Color set with RGB or QBColor function in code
System Default Colors | Colors specified with the system color constants from CONSTANT.TXT, a Visual Basic file that you can load into a project's global module. Window's substitutes the user's choices, as specified through the user's Control Panel Settings.

By default, GridColor is set to grey.

See Also

Grid topic


Index Property

Description

Returns the index of the node, i.e its position in the Nodes collection.
Not available at design time; read only at run time.

Syntax

index = node.Index

Arguments | Description
node | Object expression that references a node object.
index | An integer defining the returned index.


SelectedLink Property

Description

Sets or returns the reference to the current Link object.
Setting this property causes previous selection to disappear.
Not available at design time.

Syntax

Set object.SelectedLink = link
 Set link = object.SelectedLink

Arguments | Description
object | Object expression that references an AddFlow control.
link | Object expression that references a link object.

Remarks

  1. The selected link is selected : its Selected property is True.
  2. A link that is not Selectable cannot be made the current one.

See Also

Selection topic, Selectable property, Selected property


SelectedNode Property

Description

Sets or returns the reference to the current Node object.
Setting this property causes previous selection to disappear.
Not available at design time.

Syntax

Set object.SelectedNode = node
 Set node = object.SelectedNode

Arguments | Description
object | Object expression that references an AddFlow control.
node | Object expression that references a node object.

Remarks

  1. The selected node is selected : its Selected property is True.
  2. A node that is not Selectable cannot be made the current one.

See Also

Selection topic, Selectable property, Selected property