Copyright: AddFlow: Copyright © 1997-98 Lassalle Technologies


AddFlow
AddFlow™ ActiveX Control version 2.00

Lassalle Technologies.

Licence Agreement Copyrights Introduction Quick Start Tutorial Reference Guide Version 2 enhancements Installation Frequently Asked Questions


License , AddFlow
License Agreement

ADDFLOW ACTIVEX CONTROL LICENSE AGREEMENT

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 the AddFlow ActiveX control. By using this product, you are agreeing to be bound by the following terms and conditions:

1.OWNERSHIP

The AddFlow ActiveX Control program (the "SOFTWARE") and accompanying written materials are owned by Lassalle Technologies (the "LICENSOR") and are protected by copyright law and international treaties.

2. LICENSE FOR EVALUATION VERSION

When you install a copy of the SOFTWARE without providing the appropriate license number (also called "serial number"), the SOFTWARE will be installed as an Evaluation Version. When you use an Evaluation version, you will be prompted by a dialog box explaining that you are using an Evaluation Version of the SOFTWARE.

If you generate an executable application with an Evaluation Version, then any attempt to use executable application will display a dialog box explaining that it has been generated without license file and that the SOFTWARE will not work.

You may use the Evaluation Version of the SOFTWARE for up to 30 days in your design environment for evaluation purposes only. You may copy and distribute it freely as long as all the files in the package, including the demo programs are distributed with it and no changes or additions of any kind are made to the original package.

3.FULL LICENSE

To get a full license of the SOFTWARE that allows to generate executable applications that work correctly, you have to order a full license of the SOFWARE.

If you pay the license fee and if you agree to the terms of this agreement, the LICENSOR grants to you a license to:

- use the SOFTWARE on a single terminal connected to a single computer by one person at a time for the purpose of development and creation of executable applications.

- have the royalty-free right to distribute executable applications that use the SOFTWARE as a runtime component.

- have the right to a technical support for a period of 12 months from the date of purchase of the license.

- have the right,during a period of 12 months, to download from LICENSOR's Internet site all maintenance releases of the SOFWARE, without having to pay any fees. Maintenance release mean bug corrections and minor improvements.

The SOFTWARE is intended to be sold to individuals. This is a single user license. Any company wishing to purchase it would need to purchase one copy for each person using it. You may not network the SOFTWARE or otherwise use it on more than one computer or computer terminal at the same time.

You may make one copy of the SOFTWARE for backup purposes only. Making copies for any other purpose violates international copyright laws. You can just copy the ActiveX file as a runtime component of one of your applications.

You are not allowed to distribute the license file (.lic) with any application that you distribute.

You agree to treat the license number as strictly confidential except to the LICENSOR or your authorized AddFlow distributor.

4.OTHER RESTRICTIONS

It is stricly prohibited to reverse engineer, decompile, or disassemble the SOFTWARE. You are not allowed to rent or lease the SOFTWARE, but you may transfer it and accompanying written materials on a permanent basis provided you retain no copies and the recipient agrees to the terms of this Agreement.

You are not allowed to expose directly or indirectly the properties and methods of the SOFTWARE.

You may not repackage the SOFTWARE for sale as a competing product.

5.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.


Copyrights, AddFlow
Copyrights

AddFlow™

Copyright © 1997-98 Lassalle Technologies.

All rights reserved.

All other names and trademarks are property of their respective companies.


Introduction , AddFlow
Introduction

Very short description

AddFlow is a general purpose Flowcharting/Diagramming control.

Short Description

AddFlow is a 32 bits ActiveX control that lets you quickly build flowchart-enabled applications. Many features: distinct colors, fonts, shapes, styles, pictures, text, etc... for each object of the diagram (node or link). Nodes stay connected when moved. Navigation and user data allowed, programmatic or interactive drawings, metafiles, serialization, zooming, Bezier curves,reflexive links, multiselection, scrolling. Easy, fast and small: only 140 Ko of code. Runtime royalty-free.

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

Diagrams creation

AddFlow provides two ways to build diagrams:

1) interactive way (with the mouse): see Quick Start in order to know how to interactively draw a diagram.

2) programmatic way with the AddFlow API (Application Programmatic Interface). This API is very easy to use since it is based upon OLE automation and collections. It is a set of properties, events and methods that allow to manipulate Node and Link objects and to customize your application. The Tutorial provides a full description of this API.

Environments

AddFlow can be used in many developer environments. It has been tested with Visual Basic, Visual C++ and Delphi. AddFlow is a MFC (Microsoft Foundation Class) based ActiveX control. The term ActiveX is now also being used for controls of this type. This is partly because such controls can be placed on a HTML page as part of a Internet application.

The code examples in this help file are written in Visual Basic and Visual C++. You can also download samples written in VB5, VC5 and Delphi3 from our web site.


Quick Start , AddFlow
Quick Start under Visual Basic

Add the AddFlow ActiveX to your project by selecting "Components..." from Visual Basic's "Project" menu.

Drag an AddFlow control from the toolbox to your form. If you have not any AddFlow license file, an "About" dialog box appears and you have to click Ok.

Launch the program by selecting "Run" from the "Execute" menu (or do F5). Without any programmation you can already draw nodes and link them.

Draw a node

Draw a link

Stretch a link

Draw a reflexive link

Multiselection

Change default properties

Adjust the link origin and destination points


Draw a node , AddFlow
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 to resize 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 , AddFlow
Draw a link

Draw a second node...(same method)

Draw a link: 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 , AddFlow
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).


Draw a reflexive link , AddFlow
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 , AddFlow
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 SelectMode property.


Change default properties , AddFlow
Change default properties

 Now, you may return to the Visual Basic design-time mode in order to change control properties. For instance you may change :

•	the default node filling color (FillColor property) to yellow

•	the default node shape (Shape property) to rectangle

•	the default drawing color (DrawColor property) to red

•	the default link style (LinkStyle property) to « Bezier ».

Then launch again the program and draw nodes and links:


Adjust the link origin and destination points, AddFlow
Adjust the link origin and destination points

In the previous examples, you could not adjust the extremities of the link.

Now, return to the Visual Basic design-time mode and set the AdjustOrg and AdjustDst properties.

Then launch again the program and draw nodes and links. If you select a link, you’ll see that it 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.


Tutorial, AddFlow
Tutorial

AddFlow diagram

Node objects

Link objects

Selection

Navigation

Capabilities

Metafile support

User data

Saving/Loading

Printing

Visual C++ environment


AddFlow diagrams, AddFlow
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 objects, AddFlow
Node objects

You may create a Node object programmaticaly with the Add method of the nodes collection object. This method allows to specify 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. You have to do it since you cannot define default values for those attributes (See Node Properties).

VB5 Example

VC5 Example


Link objects, AddFlow
Link objects

A Link object allows to link 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. You have to do it since you cannot define default values for those attributes (See Link Properties).

A link may have several segments (See ExtraPoints property).

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.

VB5 Example

VC5 Example


Selection, AddFlow
Selection

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.

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.

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 , AddFlow
Navigation

Five properties allow to access every nodes and links of a diagram :

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

Navigation : VB5 Examples

Navigation : VC5 Examples


Capabilities , AddFlow
Capabilities

Following properties allow to set 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.

AutoScroll	determines whether automatic scrolling is allowed or not.
CanDrawNode	determines whether interactive creation of Node objects is allowed or not.
CanDrawLink	determines whether interactive creation of Link objects is allowed 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.
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.
Repaint	not really a "capability". This property aims at improving performance: setting it to False allows to increase the speed when creating programmaticaly a whole diagram.
ScrollBars	allows to add scrollbars for the control.
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.
xZoom	returns/sets the horizontal zooming factor.
yGrid	returns/sets the vertical grid.
yZoom	returns/sets the vertical zooming factor.


Metafile support , AddFlow
Metafile support

AddFlow offers both Windows standard and enhanced metafile supports. SaveImage method allows to save the diagram on disk as a metafile (standard or enhanced). This method allows also to copy the diagram onto the clipboard. Then you may paste it in Window Write, in PaintBrush, Excel, Winword, WordPerfect, in a VB picture, etc... And the result can be resized. For instance, you may paste the metafile in a Winword document, double-click on the picture, adjust the margins so that there's room for other drawing objects, use the drawing tools to draw some lines, circles, etc, close the picture, select it, copy it to the clipboard, etc...

All the diagrams in this current help file have been made with AddFlow and copied using the SaveImage method.


User data , AddFlow
User data

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

UserData: this property allows to associate a numeric (long integer) value to a node or a link.

Tag: this property allows to associate 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 to associate 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 to associate a unique key to a node or a link. This key can be used to identify a node or a link.


Saving/Loading , AddFlow
Saving/Loading

AddFlow 2 offers 2 methods that allow to save and load a whole diagram : SaveFile and LoadFile.


Printing , AddFlow
Printing

Printing is under the responsability of the VB program that uses AddFlow. To print an AddFlow diagram today, you have 4 methods:

1) copy it to clipboard via Metafile format (SaveImage 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 standard or enhanced metafile (SaveImage method) then the problem is to print a metafile. Some OCXs have specifically been created to accomplish this task easily.

3) use container code (VB5, Delphi3, etc). You have to retrieve attributes of each Node or Link object and use VB code to draw those objects. It is not very easy but feasable.

4) use the PrintForm method (for VB5 users only). This method allows to print 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.


Version 2 enhancements , AddFlow
Version 2 enhancements

The version 2 is in fact a new product with a new programmatic interface, new properties and new methods. If you are migrating from version to version 2, then you have to be aware of the new features and also of some changes.

New features

The new features are the following :

- reflexive links : you can build reflexive links programmaticaly or interactively. The CanReflexLink property allows the choice to enable this feature or not.

- new link styles allowing to create links having only vertical and horizontal segments

- improved collections with ability to associate a unique key to a node or a link (Key property).

- serialization methods to save and reload a diagram (LoadFile and SaveFile methods)

- ability to select nodes and links programmaticaly (Selected property)

- metafiles inside node (in the previous version, only icons and bitmaps are allowed)

- ability to save the diagram in enhanced metafile format

- ability to adjust the position of the first and last point of a link (AdjustOrg and AdjustDst properties)

- SnapToGrid property

- xExtent and yExtent properties to know the size of the whole diagram.

- four new rectangular 3D shapes for nodes.

Changes

- The PointOrg, PointDst properties are useless under version 2 and therefore have been removed.

- The Add method of the LinkPoints collection has been modified : now, to add a new point to a link, just write (in Visual Basic)

linx.ExtraPoints.Add 795, 2130

or (Visual C++)

link.GetExtraPoints().Add(795, 2130);

- Multiselection is different : now you can select nodes and links. A link has to be explicitly selected. (In version 1, a link was selected only if its origin and destination nodes were themselves selected)

- The ShowGrid property has a different behaviour . In version 1, setting this property displayed the grid and caused nodes to be aligned to this grid. In version 2, it just displays the grid. If you need the alignment feature, use the SnapToGrid property.

- xScroll and yScroll properties now have values that do not depend on zoom factors.


Installation , AddFlow
Installation

Floppy disk Install

To install AddFlow on your system, follow these steps :

 1) Make sure Windows NT or Windows 95 is running.

 2) Insert the disk 1 into drive A or B.

 3) Launch the setup program “A:\SETUP” or “B:\SETUP” depending on where you inserted the setup disk.

 4) Follow the instructions given in the installation program.

Evaluation version Install

Generally, this demo version is packaged in a single zip file: ADDFLO2.ZIP. You will find such a file on Compuserve or Internet or on some CD-ROMS provided by authorized AddFlow distributors. In such a case, you have just to unzip this file, then launch the setup program and follow the instructions given in the installation program.

Notes

1) When installing the product and if it is not an evaluation version, a license file ADDFLOW2.LIC is copied in the same directory as the ActiveX file ADDFLOW2.OCX.

2) The setup program should register the ActiveX file. Anyway you can do it yourself with the regsrv32 tool program. The command is the following:

REGSVR32 ADDFLOW2.OCX.

3) AddFlow has been compiled with Microsoft VC++ 5.0. To work correctly, it requires that many shared DLLs from Microsoft to be present on your computer. Those DLLs are the following:

MFC42.DLL

MSVCRT.DLL

OLEPRO32.DLL

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

5) You are not allowed to distribute the license file ADDFLOW2.LIC with any application that you distribute.


Frequently Asked Questions , AddFlow
Frequently Asked Questions

How to associate data to a node or a link ?

See User data

How to save a diagram ?

See Saving/Loading

How to print a diagram ?

See Printing

How to detect a user action (node or link creation, node resizing, etc...)?

This can be done when receiving the MouseUp event. You have to use the LastUserAction method.

This allows to avoid what we call the "events proliferation syndrom". All AddFlow events are standards.

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.

What are the new features of version 2?

See Version 2 enhancements

Why should I use AddFlow instead of another product?

AddFlow is a RUNTIME ROYALTY FREE product. It is not expensive and you only need to purchase one license per developper. AddFlow is easy, fast and small (only 140 K of code).

Under what development tools has AddFlow been tested?

AddFlow has been tested under Visual Basic 5, Visual C++ 5 and Delphi 3. You can download VB5, VC5 and Delphi 3 samples from our web site. See also the Visual C++ environment topic for a quick start under VC5.

If you project to use AddFlow with another development tools, then you should be very careful and make all the needed tests before purchasing the control.


Reference Guide , AddFlow
Reference Guide

The AddFlow API offers a set of properties, events and methods that may apply to a whole AddFlow control object, a node object, a link object, a collection of nodes, a collection of links or a collection of the points of a link

AddFlow control

Some properties allow to customize the control according to your needs.

Some properties allow to set default values to Node and Link attributes. For instance, the FillColor property of the AddFlow control allows to set 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.

Properties

Events

Methods

Constants

Node and Link objects

Some properties apply only to Node objects (for instance FillColor, Picture, Shape, etc, ...).

Some properties apply only to Link objects (for instance, ArrowOrg, ArrowDst, Org, Dst, etc...).

Some properties apply to both types of object (for instance, DrawColor, Text, Tag, Key, etc...).

Remember that the node object name is afNode and the link object name is afLink.

See following topics to know what you can do with each object type.

Node Properties

Link Properties

LinkPoint objects

A link is defined by its points. Each point is defined by its x and y coordinates. The link point object type name is afLinkPoint.

See ExtraPoints property and LinkPoint Properties

Collections

An AddFlow diagram is a collection of Node objects. Each Node object allows to access the collection of the Link objects that leave the node and the collection of the Link objects that come to the Node. Each Link object allows to access the collection of its points.Therefore we have 3 types of collection objects:

Nodes collection

Links collection

LinkPoints collection


Properties, AddFlow
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.

(About)	displays the AddFlow About dialog box.
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.
ArrowOrg	returns/sets the default Link object origin arrow shape.
ArrowDst	returns/sets the default Link object destination arrow shape.
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
BackPicture	allows to display a bitmap inside the control
BorderStyle	returns/sets the border style of the control.
CanDrawNode	determines whether interactive creation of Node objects is allowed or not.
CanDrawLink	determines whether interactive creation of Link objects is allowed 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.
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).
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.
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.
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.
LinkStyle	returns/sets the default style (polyline, bezier) used to draw Link objects.
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.
Parent	returns the form on which an object is located.
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.
ReadOnly	determines whether user interaction is allowed or not.
Repaint	determines whether repainting the control is allowed or not.
Rigid	determines whether Link objects are by default rigid or not.
ScrollBars	allows to add scrollbars for the control.
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.
Shape	returns/sets the default Node object shape.
ShowGrid	determines whether the grid is displayed or not.
SnapToGrid	determines whether nodes and links are aligned to the grid.
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.
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.
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.
yZoom	returns/sets the vertical zooming factor.


Events, AddFlow
Events

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

Click

DblClick

DragDrop

DragOver

GotFocus

KeyDown

KeyPress

KeyUp

LostFocus

MouseDown

MouseMove

MouseUp


Methods, AddFlow
Custom Methods

DeleteSel	Removes all selected nodes and their associated links.
DeleteMarked	Removes all marked nodes (and their associated links) and all marked links.
DoClick	Fires a click event.
GetVersion	Returns control version.
IsChanged	Returns the change flag.
IsSelChanged	Returns the selection change flag.
LoadFile	Load a diagram from a file.
Refresh	Force a complete repaint of the control.
SaveFile	Save the diagram in a file.
SaveImage	Save the diagram in metafile (standard or enhanced) format.
SelectAll	Select all nodes.
SetChangedFlag	Reset the change flag.
SetSelChangedFlag	Reset the selection change flag.


Constants, AddFlow
Constants

Alignment Constants

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

afCenterBOTTOM	8	Center - BOTTOM

Arrow Constants

Constants	Value	Description

afNoArrow	0	None

afFilledCircle	1	Filled Circle

afEmptyCircle	2	Empty Circle

afFilledArrow15	3	Filled Arrow 15

afEmptyArrow15	4	Empty Arrow 15

afFilledArrow30	5	Filled Arrow 30

afEmptyArrow30	6	Empty Arrow 30

afFilledArrow45	7	Filled Arrow 45

afEmptyArrow45	8	Empty Arrow 45

AutoSize Constants

Constants	Value	Description

afNoAutoSize	0	None

afAdjustPictureSizetoNode	1	Adjust Picture Size to Node

afAdjustNodeSizetoPicture	2	Adjust Node Size to Picture

BorderStyleConstants

Constants	Value	Description

afNoBorder	0	None

afFixedSingle	1	Fixed Single

DrawStyle Constants

Constants	Value	Description

afSolid	0	Solid

afDash	1	Dash

afDot	2	Dot

afDashDot	3	Dash-Dot

afDashDotDot	4	Dash-Dot-Dot

afTransparent	5	Transparent

afInsideSolid	6	Inside Solid

LinkStyle constants

Constants	Value	Description

afPolyline	0	Polyline

afBezier	1	Bezier curve

afVerticalHorizontal	2	2 segments: vertical, horizontal

afHorizontalVertical	3	2 segments: horizontal, vertical

afVerticalHorizontalVertical	4	3 segments : vertical, horizontal, vertical

afHorizontalVerticalHorizontal	5	3 segments : horizontal, vertical, horizontal

MousePointer Constants

Constants	Value	Description

afDefault	0	Default

afArrow	1	Arrow

afCross	2	Cross

afIBeam	3	I-Beam

afIcon	4	Icon

afSize	5	Size

afSizeNESW	6	Size NE SW

afSizeNS	7	Size N S

afSizeNWSE	8	Size NW SE

afSizeEW	9	Size W E

afUpArrow	10	Up Arrow

afHourglass	11	Hourglass

afNoDrop	12	No Drop

afArrowHourglass	13	Arrow and Hourglass

afArrowQuestion	14	Arrow and Question mark

afSizeAll	15	Size all

afCustom	99	Custom

PointedArea Constants

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

ScrollBars Constants

Constants	Value	Description

afNoScroll	0	None

afHorizontal	1	Horizontal

afHorizontal	2	Vertical

afBoth	3	Both

Shape Constants

Constants	Value	Description

afEllipse	0	Ellipse

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

UserAction Constants

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

afNodeSelection	6	Node selection action

SaveImage Medium Constants

Constants	Value	Description

afTypeMediumFile	0	The image is saved in a file

afTypeMediumClipboard	1	The image is copied onto the clipboard

SaveImage Format Constants

Constants	Value	Description

afWMF	0	Standard windows metafile format

afEMF	1	Enhanced windows metafile format


Node Properties, AddFlow
Node Properties

Alignment	sets or returns the alignment of text in a node.
AutoSize	allows to adjust node size to picture size or adjust picture size to node size.
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.
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 a 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 a node.
Marked	returns/sets a flag.
OutLinks	returns a reference to the collection of links that leave the node.
Picture	returns/sets the picture to be displayed in a node.
Selectable	determines if the node is active or readonly.
Selected	determines if the node is selected or not.
Shape	returns/sets the node shape.
Tag	returns/sets the tag associated with a node.
Text	returns/sets the text associated with a node
Top	returns/sets the top position of the bounding rectangle of a node.
Transparent	determines whether a node is transparent or not.
UserData	returns/sets a numeric data associated with a node.
Width	returns/sets the width of the bounding rectangle of a node
ZOrder	places a node at the front or back of the z-order.


Link Properties, AddFlow
Link Properties

AdjustDst	determines whether you can adjust the destination point of a link.
AdjustOrg	determines whether you can adjust the origin point of a link.
ArrowDst	returns/sets the link destination arrow shape.
ArrowOrg	returns/sets the link origin arrow shape.
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 a link points.
Dst	returns the reference of the destination node of a 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.
Marked	returns/sets a flag.
Org	returns the reference of the origin Node object of a link
OutIndex	returns the index of the link in its origin node « OutLinks » collection.
Rigid	determines if the link is rigid or not.
Selectable	determines if the link is active or readonly.
Selected	determines if the link is selected or not.
Tag	returns/sets the tag associated with a link.
Text	returns/sets the text associated with a link.
UserData	returns/sets a numeric data associated with a link.
ZOrder	places a link at the front or back of the z-order.


LinkPoint Properties, AddFlow
LinkPoint Properties

x	x coordinate of a point
y	y coordinate of a point


Nodes Collection, AddFlow
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, AddFlow
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, AddFlow
LinkPoints 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.


Add Method (Links collection), AddFlow
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 (LinkPoints collection), AddFlow
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 a the point to add

y	y coordinate of a the point to add

Examples

(VB5)

'Add a point

link.ExtraPoints.Add 795, 2130

(VC5)

// Add a point

link.GetExtraPoints().Add(795, 2130);


Add Method (Nodes collection), AddFlow
Add Method (Nodes collection)

Description

Creates a node, adds it to a collection of nodes and returns a reference to this node.

Syntax

[node =] collection.Add(left, top, width, height)

Arguments	Description

node	a reference to the created node.

collection	a reference to a Nodes collection.

left	Single

top	Single

width	Single

height	Single


AdjustOrg, AdjustDst Property, AddFlow
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[ = {True | False}]]

object.AdjustDst[ = {True | False}]

Arguments	Description

object	Object expression that may reference an AddFlow control or a link.


Alignment Property, AddFlow
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[ = alignment]

Arguments	Description

object	Object expression that may reference an AddFlow control or a node.

alignment	the node text alignment.

Settings

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


ArrowOrg, ArrowDst Property, AddFlow
ArrowOrg, ArrowDst Property

Description

If applied to a link, it returns/sets its origin arrow shape or its destination arrow shape.

If applied to an AddFlow control, it returns/sets the default link origin or destination arrow shape. When a link is created, it receives those default link shapes.

Syntax

object.ArrowOrg[ = shape]

object.ArrowDst[ = shape]

Arguments	Description

object	Object expression that may reference an AddFlow control or a link.

shape	the link origin or destination shape

Settings

Constants	Value	Description

afNone	0	None

afFilledCircle	1	Filled Circle

afEmptyCircle	2	Empty Circle

afFilledArrow15	3	Filled Arrow 15

afEmptyArrow15	4	Empty Arrow 15

afFilledArrow30	5	Filled Arrow 30

afEmptyArrow30	6	Empty Arrow 30

afFilledArrow45	7	Filled Arrow 45

afEmptyArrow45	8	Empty Arrow 45

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


AutoScroll Property, AddFlow
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

AddFlow1.AutoScroll[ = {True | False}]

Settings

Value	Description

False	Automatic scrolling is not allowed.

True	(Default) Automatic scrolling is allowed.

See Also

Capabilities


AutoSize Property, AddFlow
AutoSize Property

Description

This property allows to adjust 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[ = autosize]

Arguments	Description

object	Object expression that may reference an AddFlow control or a node.

autosize	the node AutoSize style.

Settings

Constants	Value	Description

afNone	0	None (default)

afAdjustPictureSizetoNode	1	Adjust Picture Size to Node

afAdjustNodeSizetoPicture	2	Adjust Node Size to Picture


BackPicture Property, AddFlow
BackPicture Property

Description

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


CanDrawNode Property, AddFlow
CanDrawNode Property

Description

Determines whether you can create nodes interactively or not.

Syntax

AddFlow1.CanDrawNode[ = {True | False}]

Settings

Value	Description

False	Drawing nodes is not allowed.

True	(Default) Drawing nodes is allowed.

See Also

Capabilities


CanDrawLink Property, AddFlow
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

AddFlow1.CanDrawLink[ =  {True | False}]

Settings

Value	Description

False	Drawing links is not allowed.

True	(Default) Drawing links is allowed.

Note

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


CanMoveNode Property, AddFlow
CanMoveNode Property

Description

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

Syntax

AddFlow1.CanMoveNode[ =  {True | False}]

Settings

Value	Description

False	Moving nodes is not allowed.

True	(Default) Moving nodes is allowed.

See Also

Capabilities


CanMultiLink Property, AddFlow
CanMultiLink Property

Description

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

Syntax

AddFlow1.CanMultiLink[ = {True | False}]

Settings

Value	Description

False	Multi links is not allowed.

True	(Default) Multi links is allowed.

See Also

Capabilities


CanReflexLink Property, AddFlow
CanReflexLink Property

Description

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

Syntax

AddFlow1.CanReflexLink[ = {True | False}]

Settings

Value	Description

False	Reflexive links is not allowed.

True	(Default) Reflexive links is allowed.

Note

A reflexive link is created with 4 points.

See Also

Capabilities


CanSizeNode Property, AddFlow
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

AddFlow1.CanSizeNode[ =  {True | False}]

Settings

Value	Description

False	Sizing nodes is not allowed.

True	(Default) Sizing nodes is allowed.

Note

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


CanStretchLink Property, AddFlow
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

AddFlow1.CanStretchLink[ =  {True | False}]

Settings

Value	Description

False	Stretching links is not allowed.

True	(Default) Stretching links is allowed.

Note

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


Clear Method, AddFlow
Clear Method

Description

Remove all objects of a collection.

Syntax

collection.Clear

Arguments	Description

collection	Object expression that may reference a collection of nodes, links 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 ExtraPoints property).


Count Method, AddFlow
Count Method

Description

Returns the number of objects in a collection.

Syntax

number = collection.Count

Arguments	Description

collection	Object expression that may reference a collection of nodes, links or points.

Number	the returned number of objects.


DeleteMarked Method, AddFlow
DeleteMarked Method

Description

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

Syntax

AddFlow1.DeleteMarked

See Also

Marked property.


DeleteSel Method, AddFlow
DeleteSel Method

Description

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

Syntax

AddFlow1.DeleteSel


DisplayHandles Property, AddFlow
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

AddFlow1.DisplayHandles[ = {True | False}]

Settings

Value	Description

False	Handles are not displayed.

True	(Default) Handles are displayed.

Note

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

Example 1

AddFlow1.DisplayHandles = False  'or True

AddFlow1.Refresh

See Also

Capabilities


DoClick Method, AddFlow
DoClick Method

Description

Fires a click event.

Syntax

AddFlow1.DoClick


DrawColor Property, AddFlow
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 &]

Arguments	Description

object	Object expression that may reference an AddFlow control, a node or a link.

color	the pen drawing color

Settings

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, AddFlow
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[ = style]

Arguments	Description

object	Object expression that may reference an AddFlow control, a node or a link.

style	the pen drawing style

Setting

Constants	Value	Description

afSolid	0	Solid

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 1, DrawStyle produces the effect described above for each setting.


DrawWidth Property, AddFlow
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]

Arguments	Description

object	Object expression that may reference an AddFlow control, a node or a link.

size	the pen drawing size

Setting

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


ExtraPoints Property, AddFlow
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

Object.ExtraPoints

Notes

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.

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

You can add points (and therefore segments) to a link only if its style is afPolyline or afBezier.

Examples

(VB5)

'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

(VC5)

// 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);


FillColor Property, AddFlow
FillColor Property

Description

If applied to a Node object, it returns/sets the color used to fill the node.

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

Syntax

object.FillColor[ = color &]

Arguments	Description

object	Object expression that references an AddFlow control or a node.

color	the filling color

Settings

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, FillColor is set to 0 (black)


Font Property, AddFlow
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

object.Font[ = font]

Note

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


ForeColor Property, AddFlow
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 &]

Arguments	Description

object	Object expression that references an AddFlow control, a node or a link.

color	the foreground color

Settings

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).


GetVersion Method, AddFlow
GetVersion Method

Description

Returns control version.

Syntax

AddFlow1.GetVersion major, major

Arguments	Description

major	major version number

minor	minor version number

For instance, if the control version number is 2.01, then major = 2 and minor = 01.


Hidden Property, AddFlow
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 [ =  {True | False}]

Arguments	Description

object	Object expression that may reference an AddFlow control, a node or a link.

Settings

Value	Description

False	(default) The object (node or link) is visible.

True	The object is hidden.


Index Property, AddFlow
Index Property

Description

Returns the index of a node, i.e its position in the Nodes collection.

Not available at design time; read only at run time.

Syntax

object.Index


InIndex, OutIndex Property, AddFlow
InIndex, OutIndex 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

object.InIndex

object.OutIndex


Item Property, AddFlow
Item Property

Description

Returns an object from a collection.

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

See Also

Key property.


InLinks, OutLinks Property, AddFlow
InLinks, OutLinks 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.

Not available at design time. Read-only at run-time.

Syntax

object.InLinks

object.OutLinks

Notes

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)


IsChanged Method, AddFlow
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 =] AddFlow1.IsChanged

Arguments	Description

changed	True if a change has occured, False elsewhere.

See Also

SetChangedFlag method.


IsSelChanged Method, AddFlow
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 =] AddFlow1.IsSelChanged

Arguments	Description

selchanged	True if a selection change has occured, False elsewhere.

See Also

SetSelChangedFlag method.


Key Property, AddFlow
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[ = string expression]

See Also

Item method and User data


LastUserAction Property, AddFlow
LastUserAction Property

Description

Rreturns the last user action.

Syntax

object.LastUserAction[ = action]

Arguments	Description

object	Object expression that may reference an AddFlow control.

action	the last user action

Setting

Constants	Value	Description

afNone	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

afNodeSelection	6	Node selection action

LastUserAction VB5 Example

LastUserAction VC5 Example


Left, Top, Width, Height Property, AddFlow
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[ = numeric expression]

Node.Top[ = numeric expression]

Node.Width[ = numeric expression]

Node.Height[ = numeric expression]


LinkStyle Property, AddFlow
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]

Arguments	Description

object	Object expression that may reference an AddFlow control or a link.

style	the link style.

Setting

Constants	Value	Description

afPolyline	0	Polyline

afBezier	1	Bezier curve

afVerticalHorizontal	2	2 segments: vertical, horizontal

afHorizontalVertical	3	2 segments: horizontal, vertical

afVerticalHorizontalVertical	4	3 segments: vertical, horizontal, vertical

afHorizontalVerticalHorizontal	5	3 segments: horizontal, vertical, horizontal

Remarks

- A reflexive link cannot have a LinkStyle other than 0 or 1.

- The Bezier LinkStyle behaviour appears only when the link has at least 4 points.

- If LinkStyle is > 1, the link is not stretchable. You cannot increase its segments number.


LoadFile Method, AddFlow
LoadFile Method

Description

Load a diagram from a file.

Syntax

AddFlow1.LoadFile file

Arguments	Description

file	name of file

See Also

SaveFile


Marked Property, AddFlow
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 [ = {True | False}]

Settings

Value	Description

False	(default) The Node or Link Object is unmarked.

True	The Node or Link Object is marked.


MultiSel Property, AddFlow
MultiSel Property

Description

Determines whether multiselection mode is possible or not.

Syntax

AddFlow1.MultiSel[ =  {True | False}]

Settings

Value	Description

False	Multi selection is not allowed.

True	(Default) Multi selection is allowed.

See Also

Capabilities


Nodes Property, AddFlow
Nodes Property

Description

Returns a reference to the collection of Node objects.

Not available at design time. Read-only at run-time.

Syntax

AddFlow1.Nodes

Notes

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)


Org, Dst Property, AddFlow
Org, Dst Property

Description

Return the reference of the origin and destination nodes of a link.

Not available at design time. Read-only at run-time.

Syntax

Link.Org

Link.Dst

Remarks

It is not possible to change directly the origin or destination nodes of a link. If you want to do that, you have to memorize the link properties, destroy it, create a new one with the new origin or destination node and sets previous saved properties.

See Also

Navigation


Picture Property, AddFlow
Picture Property

Description

Sets or returns the picture to be displayed in a node. This picture can be a bitmap, an icon or a metafile.

Syntax

Node.Picture[ = picture]

Settings

Value	Description

(none)	(Default)

(bitmap, icon, metafile)	Specifies a picture. You can also set this property using the

LoadPicture function on a bitmap, an icon or a metafile.


PointedArea Property, AddFlow
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

AddFlow1.PointedArea

Settings

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, PointedLink Property, AddFlow
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

AddFlow1.PointedNode

AddFlow1.PointedLink

See Also

PointedArea property.


ReadOnly Property, AddFlow
ReadOnly Property

Description

Set "read only" mode. In such a mode, user interaction is not allowed.

Syntax

AddFlow1.ReadOnly[ = {True | False}]

Settings

Value	Description

False	(Default) "Read only" mode is set.

True	"Read only" mode is not set.

Note

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


Refresh Method, AddFlow
Refresh Method

Description

Forces a repaint of the OLE control.

Syntax

AddFlow1.Refresh


Remove Method (Nodes or Links collection), AddFlow
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.


Repaint Property, AddFlow
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

AddFlow1.Repaint[ = {True | False}]

Settings

Value	Description

False	Repainting not allowed.

True	(Default) Repainting allowed

VB5 Example

VC5 Example


Rigid Property, AddFlow
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 [ =  {True | False}]

Arguments	Description

object	Object expression that may reference an AddFlow control, or a link.

Settings

Value	Description

False	(default) The link is not rigid.

True	The link is rigid.

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


SaveImage Method, AddFlow
SaveImage Method

Description

Save an image of the diagram using the Windows standard 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.

Syntax

AddFlow1.SaveImage tymed, format, file

Arguments	Description

tymed	type of medium

format	format of data

file	name of file

Settings

SaveImage Medium Constants

Constants	Value	Description

afTypeMediumFile	0	The image is saved in a file

afTypeMediumClipboard	1	The image is copied onto the clipboard

SaveImage Format Constants

Constants	Value	Description

afWMF	0	Standard windows metafile format

afEMF	1	Enhanced windows metafile format


SaveFile Method, AddFlow
SaveFile Method

Description

Save all the diagram in a file.

Syntax

AddFlow1.SaveFile file

Arguments	Description

file	name of file

See Also

LoadFile


ScrollBars Property, AddFlow
ScrollBars Property

Description

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

Syntax

AddFlow1.ScrollBars[ = setting]

Settings

Constants	Value	Description

afNone	0	None

afHorizontal	1	Horizontal

afHorizontal	2	Vertical

afBoth	3	Both

See Also

Capabilities


Selectable Property, AddFlow
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 an object is unselectable,the user cannot interactively make it current or selected. He can do this only programmaticaly. Such an object may be used to display a picture or a text but the user cannot move, stretch or resize it with the mouse.

Syntax

Object.Selectable [ =  {True | False}]

Settings

Value	Description

False	The Node or Link Object is unselectable.

True	(default) The Node or Link Object is selectable.


SelectAll Method, AddFlow
SelectAll Method

Description

Selects all nodes and links.

Syntax

AddFlow1.SelectAll


Selected Property, AddFlow
Selected Property

Description

Returns/sets a flag indicating if a node or a link is selected or not.

Syntax

Object.Selected [ = {True | False}]

Settings

Value	Description

False	(default) The Node or Link Object is not selected.

True	The Node or Link Object is selected.

Remarks

AddFlow version 2 allows to set this property. It means we can now programmaticaly select and unselect nodes and links.


SelectedLink Property, AddFlow
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 AddFlow1.SelectedLink[ = Link]

Remarks

The selected link is selected : its Selected property is True.


SelectedNode Property, AddFlow
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 AddFlow1.SelectedNode[ = Node]

Remarks

The selected node is selected : its Selected property is True.


SelectMode Property, AddFlow
SelectMode Property

Description

Allow to enter in selection mode instead of drawing mode. This property has no effect if 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.

Syntax

AddFlow1.SelectMode[ = {True | False}]

Settings

Value	Description

False	(Default) Drawing mode.

True	Select mode is set.


SetChangedFlag Method, AddFlow
SetChangedFlag Method

Description

Allow to set 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

AddFlow1.SetChangedFlag changed

Arguments	Description

changed	boolean value.

See Also

IsChanged method.


SetSelChangedFlag Method, AddFlow
SetSelChangedFlag Method

Description

Allow to set a flag indicating that the selection has changed or not.

Syntax

AddFlow1.SetSelChangedFlag selchanged

Arguments	Description

selchanged	boolean value.

See Also

IsSelChanged method.


Shape Property, AddFlow
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[ = shape]

Arguments	Description

object	Object expression that may reference an AddFlow control or a node

shape	the node shape

Settings

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


ShowGrid Property, AddFlow
ShowGrid Property

Description

Specify if the grid is displayed or not.

Syntax

AddFlow1.ShowGrid[ =  {True | False}]

Settings

Value	Description

False	(Default) The grid is not displayed.

True	The grid is displayed.

See Also

Capabilities


SnapToGrid Property, AddFlow
SnapToGrid Property

Description

Specify if nodes are aligned to the grid

Syntax

AddFlow1.SnapToGrid[ =  {True | False}]

Settings

Value	Description

False	(Default) Nodes are not aligned to the grid.

True	Nodes are aligned to the grid.

See Also

Capabilities


Tag Property, AddFlow
Tag Property

Description

Sets or returns a tag associated with a node or a link.

Syntax

Object.Tag[ = string expression]

See Also

User data


Text Property, AddFlow
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.

The text associated to a link is displayed at the middle of its segment number n/2 + 1 (n is the number of segments). This text is displayed in a single line.

Syntax

Object.Text[ = string expression]

Remarks

The font and the color of the text are determined by Font and ForeColor properties.

If the object is a node, then the position of the text is determined by the Alignment property.


Transparent Property, AddFlow
Transparent Property

Description

Determines whether next created nodes will be transparent or not.

If applied to a node, it determines whether it is transparent or not.

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

Syntax

object.Transparent[ =  {True | False}]

Arguments	Description

object	Object expression that may reference an AddFlow control or a node.

Settings

Value	Description

False	(default) Opaque

True	Transparent


UserData Property, AddFlow
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]

See Also

User data


xExtent, yExtent Property, AddFlow
xExtent, yExtent Property

Description

Returns the dimensions of the diagram in twips.

Not available at design time.

Syntax

AddFlow1.xExtent

AddFlow1.yExtent


xGrid, yGrid Property, AddFlow
xGrid,  yGrid Property

Description

Sets or returns the grid values in twips.

Syntax

AddFlow1.xGrid[ = numeric expression]

AddFlow1.yGrid[ = numeric expression]

See Also

Capabilities


xScroll, yScroll Property, AddFlow
xScroll, yScroll Property

Description

Sets or returns the scroll values in twips.

Not available at design time.

Syntax

AddFlow1.xScroll[ = numeric expression]

AddFlow1.yScroll[ = numeric expression]


xZoom, yZoom Property, AddFlow
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

AddFlow1.xZoom[ = setting]

AddFlow1.yZoom[ = setting]

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.


ZOrder Property, AddFlow
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]

Settings

Value	Description

0	Send object (node or link) Front

1	Send object (node or link) Back


LastUserAction, property, VB5 example, AddFlow
LastUserAction, property, VB5 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


LastUserAction, VC5 property, example, AddFlow
LastUserAction, property, VC5 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;

}


Repaint, property, VB5 example, AddFlow
Repaint, property, VB5 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


Repaint, property, VC5 example, AddFlow
Repaint, property, VC5 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);


Node and link creation : VB5 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


Node and link creation : VC5 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);


Navigation : VB5 examples

Example 1

' Make all nodes rectangular

Dim node as afNode

For Each node In AddFlow1.Nodes  ' Nodes enumeration

  node.Shape = afRectangle

Next

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

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

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


Navigation : VC5 examples

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);

}

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));

}

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));

  }

}

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));

}


Visual C++ environment, AddFlow
Visual C++ environment

It is easy to use AddFlow under Visual C++ 5.0. For instance: let us build a SDI application using AddFlow.

1) Launch the VC++ 5.0 AppWizard :

MFC AppWizard : Step 1. Select a SDI interface.

MFC AppWizard : Step 2.Click the Next button.

MFC AppWizard : Step 3. The check box ActiveX controls must be checked.

MFC AppWizard : Step 4 Click the Next button.

MFC AppWizard : Step 5 Click the Next button.

MFC AppWizard : Step 6. Select CFormView as a base class for the CEditorView class.

Then click the Finish button and click the OK button in the New Project Information dialog box.

2) In the "Project" pulldown menu, activate the "Add to project..." item menu and the "Component and controls..." submenu.

Choose AddFlow in the registered ActiveX controls list.

Then select all the classes in the Confirm Classes dialog box.

3) Switch to ResourceView (WorkSpace Window)

Expand the Resources folder.

Expand the Dialog folder.

Double-click the IDD_EDITOR_FORM dialog.

Then click on the AddFlow bitmap in the toolbox  [image] and place an AddFlow control in the dialog box.

4) Then you can compile the application and run it so that you verify that the AddFlow control works.

5) 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 : editor, navig or demo). This file contains the declarations of all the AddFlow constants that you can be used in your application.