Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Create link on a selection of several nodes (Read 2220 times)
ilafon
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: May 24th, 2009
Create link on a selection of several nodes
May 24th, 2009 at 11:35pm
Print Post  
Hi,

I have created my own Behavior class derived from the BehaviorBase. I have overrided the StartDraw method in order to have a move on click+drag of the left mouse button and a create link when the alt key is pressed. This is working fine for one node.

Now what i'd like to do, is to be able to have the same behavior when several nodes are selected.
I'd like be able to create a link from the selected nodes to a destination node, which will create, in the end, one link for each selected node to the destination node.

How can i do this?

I've remarked that my Startdraw method is not called when i have several nodes selected.

Thanks in advance for your help.
Isabelle.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Create link on a selection of several nodes
Reply #1 - May 25th, 2009 at 5:32am
Print Post  
Hi Isabelle,

You can't start drawing multiple items from StartDraw. You might create some additional links in response to LinkCreated, where you could loop over all selected nodes except e.Link.Origin and create a link from them to e.Link.Destination.

If there are multiple selected items, the control starts dragging the selection without calling StartDraw if the mouse pointer is over an adjustment handle. Is this the problem you are seeing?

Stoyan
  
Back to top
 
IP Logged
 
ilafon
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: May 24th, 2009
Re: Create link on a selection of several nodes
Reply #2 - May 25th, 2009 at 3:31pm
Print Post  
Hi,

Yes, this is the problem I'm seeing.
The control starts moving the selected nodes when the mouse pointer is over one of the selected node (I'm using InvisbleMove HandlesStyles) without calling StartDraw. So I cannot initiate the link creation on the node the mouse is over.

Isabelle.


  
Back to top
 
IP Logged
 
ilafon
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: May 24th, 2009
Re: Create link on a selection of several nodes
Reply #3 - May 26th, 2009 at 3:03pm
Print Post  
Hi,

Is this a known problem? Is there a way to workaround?

Thanks in advance for your help.
Isabelle.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Create link on a selection of several nodes
Reply #4 - May 26th, 2009 at 4:13pm
Print Post  
We'll have to move to the base StartDraw method the code that starts dragging the multiple selection, so you can override it. Currently it is called before StartDraw, and the latter is not called if the selection is being moved. We'll try to do that for the next release.

Stoyan
  
Back to top
 
IP Logged
 
ilafon
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: May 24th, 2009
Re: Create link on a selection of several nodes
Reply #5 - May 28th, 2009 at 11:53am
Print Post  
Hi,

Can you give me an approximative date of when the next release with the modification for the StartDraw with multiselection will be available ?

Thanks in advance for the information.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Create link on a selection of several nodes
Reply #6 - May 28th, 2009 at 1:11pm
Print Post  
Hi Isabelle,

This version adds a virtual bool ShouldMoveSelection(Point point) method to BehaviorBase. Override it and return false if your multiple links drawing mode is enabled, and the control will call StartDraw.

https://mindfusion.eu/_beta/fcnet53.zip

Again, this won't let the user draw multiple links simultaneously, but you can create the additional links in response to LinkCreated. With some custom drawing you could also draw some lines while a link is being created, to simulate multiple links being drawn.

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