Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic InteractionState constructor changed from 6.0.3 to 6.3 (Read 1967 times)
Kyle Chen
Full Member
***
Offline


I Love MindFusion!

Posts: 104
Joined: Nov 29th, 2012
InteractionState constructor changed from 6.0.3 to 6.3
Jul 26th, 2016 at 7:14pm
Print Post  
Hi Stoyo,

Recently I'm working on upgrade my MindFusion from 6.0.3 to 6.3. I noticed there's a change in constructor of InterationState class. The first parameter was "selection" but now it's the Node. However I customized the ModifyBehavior to do selection duplication with Ctrl+Move.

If in 6.3 I pass the current ActivateItem, it will only move the active node. However I want all selection to be moved together.

Code (C++)
Select All
public override InteractionState StartDraw(PointF point)
{
    if ((Control.ModifierKeys & Keys.Control) != 0)
    {
        // duplicate
        if (_messageView.DuplicateSelection(true, _sourceElements, _duplicatedElements))
        {
            Selection selection = DiagramView.Diagram.Selection;
            if (selection != null && selection.Items.Count > 0)
            {
				AdjustmentHandle handle = new NodeAdjustmentHandle(NodeHandleType.Move);
				return new InteractionState([color=#ff0000]DiagramView.Diagram.ActiveItem[/color], handle, MindFusion.Diagramming.Action.Modify);
            }
        }
    }
    return base.StartDraw(point);
}
 



Is there any way to keep this? Thank you!
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: InteractionState constructor changed from 6.0.3 to 6.3
Reply #1 - Jul 26th, 2016 at 7:26pm
Print Post  
Hi there,

The first parameter has always been of type DiagramItem, which the Selection class derives from as well. So passing diagram.Selection to InteractionState constructor should still work. What changed is the second argument - from integer index to AdjustmentHandle reference. You should be able to pass NodeAdjustmentHandle.Move to it when you want to move multiple selection.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Kyle Chen
Full Member
***
Offline


I Love MindFusion!

Posts: 104
Joined: Nov 29th, 2012
Re: InteractionState constructor changed from 6.0.3 to 6.3
Reply #2 - Jul 26th, 2016 at 8:00pm
Print Post  
Correct! Sorry I didn't check it carefully. Thank you! Grin

Slavcho wrote on Jul 26th, 2016 at 7:26pm:
Hi there,

The first parameter has always been of type DiagramItem, which the Selection class derives from as well. So passing diagram.Selection to InteractionState constructor should still work. What changed is the second argument - from integer index to AdjustmentHandle reference. You should be able to pass NodeAdjustmentHandle.Move to it when you want to move multiple selection.

Regards,
Slavcho
Mindfusion

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint