Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Need to disallow links multiple selection (Read 4128 times)
anurodhora
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 103
Joined: Jan 19th, 2009
Need to disallow links multiple selection
Jun 15th, 2009 at 2:28pm
Print Post  
Hi Stoyo,

Please tell  us how can we disallow multiple selection on links.

Thanks,
Anurodh
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Need to disallow links multiple selection
Reply #1 - Jun 15th, 2009 at 3:26pm
Print Post  
Do you still need multiple selection of nodes?
  
Back to top
 
IP Logged
 
anurodhora
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 103
Joined: Jan 19th, 2009
Re: Need to disallow links multiple selection
Reply #2 - Jun 16th, 2009 at 5:26am
Print Post  
1) Yes we need multiselection on the nodes at the same time.

2) And suggest also on one more query -
    We have node with some links and we switch off the visibilty of this node we want that the associated links should also have their visibility off and when we again switch the visibility of node on the associated links should also get visible, automatically.

How to achieve this, please suggest.

Thanks,
Anurodh

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Need to disallow links multiple selection
Reply #3 - Jun 16th, 2009 at 11:25am
Print Post  
1) Handle LinkSelecting and set e.Cancel = true if diagram.Selection.Links.Count > 0.

2) Loop over the IncomingLinks and OutgoingLinks collections of the node and set the link visibility to match the node's.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Bala
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 156
Joined: Apr 21st, 2009
Re: Need to disallow links multiple selection
Reply #4 - Jul 3rd, 2009 at 7:01am
Print Post  
Hi Stoyan,

I have tried LinkSelecting event and put e.Cancel = true if diagram.Selection.Links.Count > 0, but its not working.Links are still selecting. Is there any other way ?

Thanks,
Bala




One thing which I have just saw, Links are appearing select but actually they are not select.
When I click over the link, link get selected and two selection point comes at the source and destination.These selection points are in white color, But I select all diagram items using mouse,Links appears select with gray selection point at the source and destination and in this case I always gets linkSelectionCount=0. that means links are virtually select but they are not.
I dont want even this gray selection point.How can I do this?

Plz help.

Thanks,
Bala
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Need to disallow links multiple selection
Reply #5 - Jul 3rd, 2009 at 11:58am
Print Post  
Hi Bala,

It seems in this case LinkSelecting is no good for several reasons, mostly because it is raised for all links before the Selection.Links collection is updated. Instead, try using SelectionChanged with some reentrancy protection for the case where you are changing the selection from inside the handler:

Code
Select All
private void OnSelectionChanged(object sender, EventArgs e)
{
	if (!inSelChanged)
	{
		inSelChanged = true;
		while (diagram.Selection.Links.Count > 1)
			diagram.Selection.Links[0].Selected = false;
		inSelChanged = false;
	}
}

private bool inSelChanged;
 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Bala
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 156
Joined: Apr 21st, 2009
Re: Need to disallow links multiple selection
Reply #6 - Jul 10th, 2009 at 8:17am
Print Post  
thanks stoyan , its working for me Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint