Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Drag-n-Drop into Container Node (Read 1878 times)
Turtlebase
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 1
Location: FL
Joined: Jul 19th, 2011
Drag-n-Drop into Container Node
Jul 19th, 2011 at 4:40pm
Print Post  
I new to the Diagram Control and I would like to have a simple way to drag an item from a list box and drop it inside an existing container node. I have no probelms with draging and droping items from the list box into the diagram but when I try to drop the item inside a container node it is placed under the container node.  I'm sure that there is some simple way to have the drop place the new item in the container node.

Thank you, Advice?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Drag-n-Drop into Container Node
Reply #1 - Jul 19th, 2011 at 5:49pm
Print Post  
Are you calling ContainerNode.Add after creating the new node? You can use the Diagram.GetNodesAt method to get all nodes at the mouse position. Find the ContainerNode from the returned list that has highest ZIndex and add the new node to it.

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


I love YaBB 1G - SP1!

Posts: 7
Joined: Apr 6th, 2011
Re: Drag-n-Drop into Container Node
Reply #2 - Jul 21st, 2011 at 5:38pm
Print Post  
Thank You, I used the getNodesAt on the drag event to see what kind of node is was and if it was a container node returned it.  Worked fine, Whats the best way to resize the container after the drop? right now it gets real big after the drop!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Drag-n-Drop into Container Node
Reply #3 - Jul 21st, 2011 at 6:06pm
Print Post  
Call the container's UpdateBounds method, or if you set AutoShrink = true, it should get called automatically.

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