Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) ArrowCreated event not being fired (Read 4631 times)
Julie Roberts
Guest


ArrowCreated event not being fired
Aug 2nd, 2006 at 11:44am
Print Post  
I have just upgraded from v3.1.3 to v4.2.  I have some code in the arrowcreated event but it never gets executed. I put a break point on the first line and found it was never hit. I then tried to catch the arrowcreating event and see if that worked. i set a breakpoint in that event and found that once the arrow was created the arrowcreated event was fired, but only if there is a breakpoint in the arrowcreating event. The code used to work in the old version ???
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3171
Joined: Oct 19th, 2005
Re: ArrowCreated event not being fired
Reply #1 - Aug 2nd, 2006 at 12:47pm
Print Post  
Make sure that the event handler method is really connected to the event. If your application is in C#, open the events page for FlowChart.NET and see whether the ArrowCreated event really points to your method. In VB.NET check the events combo box at the top of the form's source code window.
  
Back to top
 
IP Logged
 
Julie Roberts
Guest


Re: ArrowCreated event not being fired
Reply #2 - Aug 3rd, 2006 at 8:01am
Print Post  
The event handler is definately correct. The handles clause is there and the event registers in the drop down list of events for the flowchart. I know that the event is handled - but only if i have a breakpoint in the arrowcreating event.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3171
Joined: Oct 19th, 2005
Re: ArrowCreated event not being fired
Reply #3 - Aug 3rd, 2006 at 8:46am
Print Post  
We have changed how the Creating events are handled in version 4.2 - now ArrowCreating is raised after each MouseMove message, and not only when dropping the arrow. If your ArrowCreating code is intended to be called only once per arrow, you might have to revise it.
  
Back to top
 
IP Logged
 
Julie Roberts
Guest


Re: ArrowCreated event not being fired
Reply #4 - Aug 3rd, 2006 at 10:20am
Print Post  
It's actually the arrowcreated event that i need to handle; and that never gets fired unless i have a breakpoint in the arrowcreating event. If i just have a breakpoint in the arrowcreated event it never gets hit. But i need to know about the full arrow that the user has made so therefore the creating event is not the one i want to catch. Especially not when it gets fired so many times.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3171
Joined: Oct 19th, 2005
Re: ArrowCreated event not being fired
Reply #5 - Aug 3rd, 2006 at 12:00pm
Print Post  
Is what happening there that the arrow is created but no event is raised, or the arrow is not created at all? The arrow creation might be cancelled in the following situations:

- There isn't any node under the mouse and AllowUnconnectedArrows is false.
- There is a node under the mouse but it is locked.
- The AllowIncomingArrows property of the node is false.
- AllowUnanchoredArrows is false and the node's AnchorPattern is null.
- Or the node's AnchorPattern does not have points that allow incoming arrows.
- AllowLinksRepeat is false and this is the second arrow between the same nodes.
- You set e.Confirm = false in ArrowCreating.

Some of these conditions might have been met after you ported your project, please check that.
  
Back to top
 
IP Logged
 
Julie Roberts
Guest


Re: ArrowCreated event not being fired
Reply #6 - Aug 4th, 2006 at 6:19am
Print Post  
The arrow is not being created at all. I have explicitly set e.confirm to true in the arrowcreating event but the event is still not being fired. All the reasons you specified for an arrow being cancelled are not being met i.e there is no reason for the arrow to be cancelled.

[code]Private Sub fcCase_ArrowCreated(ByVal sender As Object, ByVal e As MindFusion.FlowChartX.ArrowEventArgs) Handles fcCase.ArrowCreated
      ...
           e.Arrow.Tag = LinkInfo

       End Sub
[/code]
I have a breakpoint on the first line of this sub - it never gets hit. But, if i have a breakpoint in the arrowcreating event, it will then go on to perform the arrowcreated method. Obviously breakpoints have no effect in deployed projects which will mean that arrows are never created.

I have even tried deleting the method and rewriting it but that still hasn't helped (was a long shot). Theres nothing else i can think of to do.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3171
Joined: Oct 19th, 2005
Re: ArrowCreated event not being fired
Reply #7 - Aug 4th, 2006 at 6:38am
Print Post  
Please email a sample diagram file and your ArrowCreating and ArrowCreated code to support@mindfusion.org. Clear all Tag values before saving the file, or otherwise we cannot load it here without having the assembly that contains the LinkInfo class.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3171
Joined: Oct 19th, 2005
Re: ArrowCreated event not being fired
Reply #8 - Aug 4th, 2006 at 1:41pm
Print Post  
We've received it, but it still has some tags in it -from a type in the VantageShared assembly. Please set all tags of links, nodes, table cells and anchor points to null, save the diagram and send us the file again.

10x
  
Back to top
 
IP Logged
 
Julie Roberts
Guest


Re: ArrowCreated event not being fired
Reply #9 - Aug 22nd, 2006 at 9:59am
Print Post  
Thank you so much for all your help. Your suggestion of the behaviour changing in the mouseup event seems to be the problem. I dont understand how it's happening but it seems it is. I have added an event handler for the mouse up event and explicitly set the behaviour which seems to have solved the problem.

[code]Private Sub fcCase_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles fcCase.MouseUp
           If fcCase.Behavior = BehaviorType.CreateArrow Then
               fcCase.Behavior = BehaviorType.CreateArrow
           End If
       End Sub
[/code]

Thanks again :)
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3171
Joined: Oct 19th, 2005
Re: ArrowCreated event not being fired
Reply #10 - Aug 22nd, 2006 at 10:36am
Print Post  
you mean "If Not fcCase.Behavior = BehaviorType.CreateArrow Then ..." ?  Roll Eyes
  
Back to top
 
IP Logged
 
Julie Roberts
Guest


Re: ArrowCreated event not being fired
Reply #11 - Aug 22nd, 2006 at 12:16pm
Print Post  
Haha

You might have thought that but no! When it goes into the event it has the behaviour correctly but must somehow loose it. And i don't want to set it to creating arrows every time i click anywhere on the page - it's only if it's supposed to be in that mode. As i say, this is a very strange fix for a very strange problem. But it does explain why it was only ever firing the event if a breakpoint was in the arrowcreating event.

Anyway, I can get on with my life now! Fingers crossed nothing else goes wrong!  Smiley
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3171
Joined: Oct 19th, 2005
Re: ArrowCreated event not being fired
Reply #12 - Aug 22nd, 2006 at 12:45pm
Print Post  
no way  Grin

I've put a breakpoint in the Behavior property setter and here are the call-stacks when the breakpoint got hit:

This is the call stack when clicking the "Draw links" button, the Behavior is set to DrawArrow:

>FlowChart.NET.dll!MindFusion.FlowChartX.FlowChart.Behavior.set(MindFusion.FlowC
hartX.BehaviorType value = CreateArrow) Line 4823C#
VantageShared.dll!VantageShared.CaseManagement.CaseRendering.ExtendedFlowchart.E
xtendedFlowchart.set_ManipulationMode(VantageShared.CaseManagement.CaseRendering
.ExtendedFlowchart.ExtendedFlowchart.EManipulationMode Value = VantageShared.CaseManagement.CaseRendering.ExtendedFlowchart.ExtendedFlowchart.E
ManipulationMode.Link) Line 65 + 0xf bytesBasic
AlphaLaw-CaseManagement.exe!AlphaLaw_CaseManagement.CaseManagement.uscCaseDefEdi
tor.set_Mode(AlphaLaw_CaseManagement.CaseManagement.uscCaseDefEditor.EditMode Value = AlphaLaw_CaseManagement.CaseManagement.uscCaseDefEditor.EditMode.LinkNodes) Line 563 + 0x1a bytesBasic
AlphaLaw-CaseManagement.exe!AlphaLaw_CaseManagement.CaseManagement.uscCaseDefEdi
tor.tbmEditCase_ToolClick(Object sender = {Infragistics.Win.UltraWinToolbars.UltraToolbarsManager}, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e = {Infragistics.Win.UltraWinToolbars.ToolClickEventArgs}) Line 1153 + 0xe bytesBasic
[External Code]


This is the call stack shown when I release the mouse button while drawing an arrow, the Behavior is set to Modify here:
>FlowChart.NET.dll!MindFusion.FlowChartX.FlowChart.Behavior.set(MindFusion.FlowC
hartX.BehaviorType value = Modify) Line 4823C#
AlphaLaw-CaseManagement.exe!AlphaLaw_CaseManagement.FlowchartScrollHelper.StopSc
roll() Line 80 + 0x15 bytesBasic
AlphaLaw-CaseManagement.exe!AlphaLaw_CaseManagement.FlowchartScrollHelper.flowch
art_Click(Object sender = {VantageShared.CaseManagement.CaseRendering.ExtendedFlowchart.ExtendedFlowchart}
, System.EventArgs e = {System.Windows.Forms.MouseEventArgs}) Line 89 + 0xa bytesBasic
[External Code]

That last assignment to Behavior is done before the flowchart handles the MouseUp event, so it breaks the arrow creation.

HTH
  
Back to top
 
IP Logged
 
Julie Roberts
Guest


Re: ArrowCreated event not being fired
Reply #13 - Aug 22nd, 2006 at 1:13pm
Print Post  
Found it! I actually inherited this code so don't know half of what it all does. It seems that there is a class I missed in all my searching which handles the flowchart click event and resets the behaviour. Obviously my handling of the mouseup event in the main class overrides this scrollhelper and enables the arrows to be created. I will have to investigate all this so that it doesn't mess with anything else.

Thank you so much in helping me to track down the problem  Cheesy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint