Strange Polyline Behaviour

I'm using v Diagram Studio and having some issues with Polylines (I'm using the Simple demo program).

1. When drawing a new polyline the last segment is drawn in a dashed line but all previous segments are not painted until the polyline is completed.  I think all segments should be drawn.

2. After a polyline is drawn it can be selected (grips drawn at nodes) by clicking anywhere along the length of the polyline, except if I click on either end of the polyline the polyline is not selected and instead a new line segment is added to the drawing.  This appears to be a bug?

3. I can connect Flowchart blocks with a straight or elbow line, but not with a polyline.  How would I do this?

Not an issue, but it would be very nice to be able to have more complex polylines including curved segments, much like the polylines I can draw in Microsoft Word.  In Word can right-click and add/ insert nodes, change segments between lines and curves, nodes can be smooth etc, etc.

2. If the polyline is already selected then clicking on one of the end nodes has the desired behaviour.

3. I can connect an existing polyline to blocks by dragging the ends to link points - what I can't work out how to do is to draw a new polyline to connect two blocks by starting at one block, drawing some intermediate points,then finishing at a second block.

Hi Edward,

1. Polyline is working here as expected, I'm not sure I understood what you said? As you keep drawing segments in a polyline, the previous segment are drawn and keep in a solid pen, while the current segment being drawn is in dashed line because you are still moving it.

2. This is by default and happens with all line types. If the line is not selected and you start draging from the ends, it will create a new line connected to that end. You can turn this behavior off by setting TatDiagram.ConnectionLineId property to an empty string

3. In diagram demo, if I select a new polyline from the palette toolbar, I can connect two blocks using the polyline, by clicking the linkpoint in first block and dragging the line until the first segment is drawn. Did you try that?

Hi Wagner

1. I get the correct behaviour with a polygon block, but not with a polyline.  I can reproduce it as follows:

a) EITHER Create a new project and insert a DiagramEditor on the form.  Execute the diagrameditor in the OnShow.
OR new project with a Diagram and a DiagramToolbar.
b) select polyline from the Lines category or Polyline from Toolbar.
c) start drawing on the diagram. draw a polyline with more than one segment.

Results: The current segment is drawn dashed but the previous segments are not drawn until the polyline is completed.

I am using Delphi 2010 on Windows 7.  I get the expected behaviour on a polyline with only one segment, but not with more than one segment.  If you are getting correct behaviour perhaps it is environment related?  I'm getting the same behaviour from the executable on other machines running XP and Vista so expect it would be related to Delphi version?

(By the way, in the Diagram Editor there is a toolbar at the top of the screen with buttons for drawing lines (DiagramToolbar2).  Those buttons don't work for me, but the lines in the Diagram Objects dockable panel do work.  Looking in the source perhaps that toolbar needs visible set to false within an IFDEF DELPHI9_LVL???)

2. Thank you, I will try your suggestion

3. I can connect two blocks with a single-segment polyline by dragging as you describe, but I could use a plain line to achieve that.  I want the end user to use a polyline with more than one segment to join blocks.  The behaviour I expected was click on first linkpoint, click several times on canvas, last click on second linkpoint.  Any suggestions?


Edward, can you send me a private e-mail so I send you the latest source I have here? This will guarantee we have the exact same source files, so we can continue testing.

Thank you, the polyline is drawing correctly with the latest code.