Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Prevent from selecting diagram objects (Read 2188 times)
marcosabatini
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 2
Joined: Jun 21st, 2013
Prevent from selecting diagram objects
Jun 21st, 2013 at 8:28am
Print Post  
Hi everybody,
is there a way to prevent a user to select nodes and links?
Behavior.DoNothing doesn't suit to me, as I am using a layer on top of the component which manages diagram "logical" elements to edit/remove them, so I need them not to be selected.
Thank you!
  
Back to top
 
IP Logged
 
marcosabatini
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 2
Joined: Jun 21st, 2013
Re: Prevent from selecting diagram objects
Reply #1 - Jun 21st, 2013 at 8:31am
Print Post  
Oh, sorry, I've just found this one:

Stoyo wrote on Jun 5th, 2013 at 11:12am:
Hi,

We haven't implemented EnabeldHandles yet in the JavaScript library. At this time you can prevent both modification and selection by setting the Locked property.

If you want to let users select items but not modify them, call args.cancelDrag() from the nodeModifying event handler. In that case you can hide the handles by overriding the nodes' addHandlesToCanvas method:

Code
Select All
var originalAddHandles = ShapeNode.prototype.addHandlesToCanvas;
ShapeNode.prototype.addHandlesToCanvas = function (point)
{
	originalAddHandles.apply(this, []);
	Array.forEach(this.handles, function (handle)
	{
		handle.brush = "transparent";
		handle.pen = "transparent";
	});
}; 



I hope that helps,
Stoyan


I'm going to try it. Sorry again.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Prevent from selecting diagram objects
Reply #2 - Jun 21st, 2013 at 8:35am
Print Post  
Hi,

In WpfDiagram you can also prevent selection from the NodeSelecting validation event handler by setting e.Cancel.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint