Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Node Handles (Read 1608 times)
dolfandon
Junior Member
**
Offline



Posts: 51
Location: Northern Virginia
Joined: Mar 12th, 2009
Node Handles
Sep 27th, 2010 at 8:12pm
Print Post  
Is there an easy way to create a shape node with more than the default number of handles? Along the same lines can I lock some of the handles when the node is created? I only want them to be able to stretch the node vertically.

Don Miller
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Node Handles
Reply #1 - Sep 28th, 2010 at 8:02am
Print Post  
It can be done only by deriving from the ShapeNode class. You can override AddHandlesToCanvas() to create custom handles. The control expects the handles to be Shape-derived objects, and you should add them to Diagram.DocumentPlane.Children.

Additionally, you could set the Tag of the handle's Shape object to an instance of the AdjustmentHandle class, and the built-in hit-testing should work automatically then. Otherwise you will have to also override the HitTestHandle method.

Finally, you will need to override the UpdateDrag method to update the node when the user drags a custom handle. You can reuse the built-in logic for move and resize by replacing ist.AdjustmentHandle with one that refers to the respective index of the built-in handles, and then calling base.UpdateDrag(ist).

You can lock the built-in handles by setting the EnabledHandles property. To disable custom handles, override the AllowDrag method.

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



Posts: 51
Location: Northern Virginia
Joined: Mar 12th, 2009
Re: Node Handles
Reply #2 - Sep 29th, 2010 at 3:24pm
Print Post  
OK, thanks Stoyan. I don't think we have the time for that in this release but we'll look at doing it next go around. We gave them a work around for their issue.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint