Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Mixing Behavior.Modify and Behavior.DrawLinks (Read 5558 times)
matt.s
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 56
Joined: Apr 3rd, 2008
Mixing Behavior.Modify and Behavior.DrawLinks
Jan 5th, 2010 at 5:21pm
Print Post  
Hi,

We currently use Behavior.DrawLinks to draw links between nodes.

However, when clicking and dragging on the diagram surface we'd like to have the 'selection' behaviour that is present when Behavior.Modify is used.

Is there anyway we can achieve both of these behaviours at the same time?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Mixing Behavior.Modify and Behavior.DrawLinks
Reply #1 - Jan 5th, 2010 at 6:14pm
Print Post  
Hi,

You should get that selection behavior with DrawLinks too, unless AllowUnconnectedLinks is enabled.

If you need some more complicated unconnected links behavior, you could override DrawLinksBehavior.StartDraw() to return InteractionState(diagram.Selection, Action.Create) if there isn't any node under the mouse, otherwise return base.StartDraw(). Assign an instance of the derived behavior class to diagram.CustomBehavior.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
matt.s
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 56
Joined: Apr 3rd, 2008
Re: Mixing Behavior.Modify and Behavior.DrawLinks
Reply #2 - Jan 6th, 2010 at 12:10pm
Print Post  
Hi Stoyan,

Overriding the behaviour worked a treat.

Thanks!
  
Back to top
 
IP Logged
 
matt.s
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 56
Joined: Apr 3rd, 2008
Re: Mixing Behavior.Modify and Behavior.DrawLinks
Reply #3 - Jan 8th, 2010 at 10:16am
Print Post  
Hi Stoyan,

One more thing - using this method the selection does not show the square 'outline' box as the mouse is dragged.

Is there anyway to show this?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Mixing Behavior.Modify and Behavior.DrawLinks
Reply #4 - Jan 8th, 2010 at 12:42pm
Print Post  
Hi Matt,

This shows the selection rectangle fine in my test:
return new InteractionState(Diagram.Selection, -1, Action.Create);

What does your code look like?

Are you using the latest version? - I think we had similar problems with custom behaviors before but fixed them in one of the later releases.

Stoyan
  
Back to top
 
IP Logged
 
matt.s
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 56
Joined: Apr 3rd, 2008
Re: Mixing Behavior.Modify and Behavior.DrawLinks
Reply #5 - Jan 8th, 2010 at 12:50pm
Print Post  
Hi Stoyan,

Our code is the same as yours, except that we had tried 0 and 1 as the adjustment handle parameter. Have tried again with -1 to no avail.

We are using version 2.2.0. I can see there is an update to this, but the link on the email I received in Sept last year no longer works. How can I download the latest version?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Mixing Behavior.Modify and Behavior.DrawLinks
Reply #6 - Jan 8th, 2010 at 1:09pm
Print Post  
Hi Matt,

Create an account here to download it:
http://www.clientsarea.eu/

Stoyan
  
Back to top
 
IP Logged
 
matt.s
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 56
Joined: Apr 3rd, 2008
Re: Mixing Behavior.Modify and Behavior.DrawLinks
Reply #7 - Jan 8th, 2010 at 1:13pm
Print Post  
Hi Stoyan,

Sorry to be a complete pain - is there anyway I can find out what my order number was?

Matt
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Mixing Behavior.Modify and Behavior.DrawLinks
Reply #8 - Jan 8th, 2010 at 1:15pm
Print Post  
Hi Matt,

Enter your company name instead of order id.

Stoyan
  
Back to top
 
IP Logged
 
matt.s
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 56
Joined: Apr 3rd, 2008
Re: Mixing Behavior.Modify and Behavior.DrawLinks
Reply #9 - Jan 8th, 2010 at 3:26pm
Print Post  
Hi Stoyan,

Using version 2.1.1 has fixed it.

Thanks!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint