Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Starting dragDrop from Flowchart (Read 2104 times)
jf2020
Junior Member
**
Offline


I love FlowChart!

Posts: 63
Joined: Feb 23rd, 2006
Starting dragDrop from Flowchart
Dec 7th, 2009 at 6:53am
Print Post  
I have drag drop to FlowChart working fine, but now my users also want to have drag drop to another component from FlowChart.

I searched the forum and I have tried the following:

Code
Select All
private void flowChart_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
        {

            if ((ModifierKeys & Keys.Shift) != 0)
            {
                PointF mousePosition = diagramView.ClientToDoc(e.Location);
                ShapeNode sn = flowChart.GetNodeAt(mousePosition) as ShapeNode;
                if (sn != null)
                {
                    DiagramNode node = sn.Tag as DiagramNode;
                    if (node != null)
                    {
                        if (flowChart.Interaction != null)
                            flowChart.Interaction.CancelNow();
diagramView.DoDragDrop(Commands.GetDragDropDataObject(node.BusinessObject), DragDropEffects.All | DragDropEffects.Link);
                    }
                }
            }

 



It works (I can drag and drop to another component) but the current interaction sin't cancelled (always null in the code above) and when I realeased the mouse teh rubber band selection rectangle is drawn from the point that was clicked to the coordinates where the mouse was released!

I'm using FlowChart with diagramView.Behavior = Behavior.Modify; I have tried to set it to Behaviour DoNoting in teh handler above , but that didn't helped.

Any tip is welcomed Smiley
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Starting dragDrop from Flowchart
Reply #1 - Dec 7th, 2009 at 7:47am
Print Post  
Hi,

In one of the recent releases we made interaction to start only after the first mouse move. This avoids a problem where a reflexive link could be seen for a moment immediately after pressing the mouse button over a node. Now if you move that code to a MouseMove handler and add a "(MouseButtons & MouseButtons.Left) != 0" condition to the first if, it should work as expected.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
jf2020
Junior Member
**
Offline


I love FlowChart!

Posts: 63
Joined: Feb 23rd, 2006
Re: Starting dragDrop from Flowchart
Reply #2 - Dec 7th, 2009 at 4:02pm
Print Post  
Thanks, it works now!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint