Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Re-position items without picking adjustment handl (Read 2685 times)
rajesh_patil74
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 220
Joined: Sep 3rd, 2009
Re-position items without picking adjustment handl
Aug 16th, 2010 at 7:11am
Print Post  
Hi Stoyo

To reposition the node, currently I need to select the center adjustment handle.

How one can achieve this without picking the center adjustment handle and reposition it ( For eq. with mouse down anywhere in the shape area should start moving the node and if control key is pressed it should start creating the link.)

Can you provide me the  the custom behavior class which will achive this requriement.

-Rajesh
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Re-position items without picking adjustment h
Reply #1 - Aug 16th, 2010 at 8:08am
Print Post  
Hi Rajesh,

Check how the EasyMove handles style works, possibly together with ModificationStart = AutoHandles.

If you prefer a custom behavior, it could look like this:

Code
Select All
public override InteractionState StartDraw(Point point)
{
	var node = Diagram.GetNodeAt(point, true);
	if (node != null && (Keyboard.Modifiers & ModifierKeys.Alt) != 0)
	{
		var link = CreateLink(node, point);
		Diagram.Links.Add(link);
		return new InteractionState(link, Action.Create, link.ControlPoints.Count - 1, point);
	}

	if (node != null)
		return new InteractionState(node, Action.Modify, 8, point);

	return base.StartDraw(point);
} 



The diagram reserves Control for drawing selection rectangle, so the code above checks for Alt instead.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
rajesh_patil74
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 220
Joined: Sep 3rd, 2009
Re: Re-position items without picking adjustment h
Reply #2 - Aug 16th, 2010 at 10:23am
Print Post  
Hi Stoyo

Thanks for the reply. With the provided code it is working as expected.

Now, with this move operation when movement is started, my node gets selected ( its adjustment handles are shown).

Any suggestion, to avoid this node selection when the move operation is active.

In my code, when node is selected and user tries to move the node (by mouse down anywhere in code) I want to perform another kind of operation instead of move.

-Rajesh
  
Back to top
WWW  
IP Logged
 
rajesh_patil74
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 220
Joined: Sep 3rd, 2009
Re: Re-position items without picking adjustment h
Reply #3 - Aug 16th, 2010 at 10:39am
Print Post  
Hi Stoyo

Sorry, The issue is fixed. The selection of node is done in my code.

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