Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Hide the drag corners (the 8 big squares) (Read 3857 times)
developer
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 5
Joined: Apr 9th, 2013
Hide the drag corners (the 8 big squares)
Jun 5th, 2013 at 8:16am
Print Post  
Hi,

I want to disabled the node edit and hide the drag corners (the 8 big squares) that appear around the corners. I tried:

node.EnabledHandles = AdjustmentHandles.None;

No result. How I get it?

Thanks!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Hide the drag corners (the 8 big squares)
Reply #1 - Jun 5th, 2013 at 11:12am
Print Post  
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
  
Back to top
 
IP Logged
 
developer
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 5
Joined: Apr 9th, 2013
Re: Hide the drag corners (the 8 big squares)
Reply #2 - Jun 5th, 2013 at 2:24pm
Print Post  
Hi,

Thanks for the reply.

I disabled the node edit and hide but i cant hide the drag corners (the 8 big squares) that appear around the node.

Could you upload a small example of how to override the function?

Thanks.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Hide the drag corners (the 8 big squares)
Reply #3 - Jun 6th, 2013 at 7:12am
Print Post  
Hi,

You can find a sample project here:
https://mindfusion.eu/_samples/HideHandles.zip

The code is in the page load handler of Views/Home/Index.cshtml.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
developer
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 5
Joined: Apr 9th, 2013
Re: Hide the drag corners (the 8 big squares)
Reply #4 - Jun 6th, 2013 at 7:29am
Print Post  
Yeah!. Thank you so much.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint