Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Drag and Drop RootNode (Read 3262 times)
Paulo
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Jul 9th, 2007
Drag and Drop RootNode
Jul 9th, 2007 at 7:01am
Print Post  
Good Morning.
I'm trying Flowchart.NET for create a OrgChart but it cannot do DragandDrop to the first node.
Could anyone help me with this, or ths is realy impossible???
Thanks
  
Back to top
 
IP Logged
 
Paulo
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Jul 9th, 2007
Re: Drag and Drop RootNode
Reply #1 - Jul 9th, 2007 at 8:37am
Print Post  
I have already found the soluction for Drag and Drop RootNode but i have another doubt can i Drag and Drop boxes on the same tree???
Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Drag and Drop RootNode
Reply #2 - Jul 9th, 2007 at 9:36am
Print Post  
Do you need to move the boxes within the same chart? This is done by first clicking a box to display its selection handles, and then dragging its center handle. You could set ModificationStart to AutoHandles to make the handles appear automatically when the mouse hovers over a box.

Stoyan
  
Back to top
 
IP Logged
 
Paulo
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Jul 9th, 2007
Re: Drag and Drop RootNode
Reply #3 - Jul 9th, 2007 at 11:04am
Print Post  
Thanks Stoyo for your fast Reply.
I want to change the parent from a child box with drag&drop it into the new parent.
It's this possible?
Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Drag and Drop RootNode
Reply #4 - Jul 9th, 2007 at 11:09am
Print Post  
You could handle the BoxModified event, which is raised after a user moves a box. Then check what other box is below the dropped one, and set it as an Origin of the droppedBox.IncomingArrows[0].

Stoyan
  
Back to top
 
IP Logged
 
Paulo
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Jul 9th, 2007
Re: Drag and Drop RootNode
Reply #5 - Jul 9th, 2007 at 11:54am
Print Post  
Hello again could you please post an example of drag & drop a box into the new parent?
I'm trying to do what you said but i can't find a solution.
Sorry my insistence.
Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Drag and Drop RootNode
Reply #6 - Jul 10th, 2007 at 5:14am
Print Post  
Code
Select All
private void fc_BoxModified(object sender, BoxMouseArgs e)
{
	Box box = e.Box;

	// lock the dropped box, so that GetBoxAt ignore it
	box.Locked = true;

	// find the box below the mouse cursor position
	Box newParent = fc.GetBoxAt(new PointF(e.X, e.Y));
	if (newParent != null)
	{
		if  (box.IncomingArrows.Count > 0)
			box.IncomingArrows[0].Origin = newParent;
		else
			fc.CreateArrow(newParent, box);

		TreeLayout tl = new TreeLayout(newParent);
		tl.KeepRootPosition = true;
		tl.Arrange(fc);
	}

	box.Locked = false;
}
 



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


I love YaBB 1G - SP1!

Posts: 5
Joined: Jul 9th, 2007
Re: Drag and Drop RootNode
Reply #7 - Jul 10th, 2007 at 7:19am
Print Post  
Many thanks Stoyo that work perfectly.
Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint