Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Expander button visibility issue (Read 2555 times)
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Expander button visibility issue
Sep 16th, 2009 at 1:51pm
Print Post  
Hi,

In our application, we want to display expander button on node only when mouse is over the node. As mouse enters to the node, expander button should be visible and on mouse leaves from that node expander button should be invisible.

We have used Diagram_MouseMove event for this. It is working fine except in one case.

If we move mouse rapidly over the nodes, some expander button remains on the node while mouse is not over them.

We have prepared a sample for the same and sending it to your support ID, please have a look at it.

To re-produce the issue:
Move mouse rapidly over the node from top to bottom and bottom to top.


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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Expander button visibility issue
Reply #1 - Sep 16th, 2009 at 3:48pm
Print Post  
You could keep a reference to the node that currently displays an expander, and always hide its expander before showing one for a new node.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Re: Expander button visibility issue
Reply #2 - Sep 17th, 2009 at 6:35am
Print Post  
Hi Stoyan,

Thanks for the reply.

As you have suggested, we have already kept a refrence of that node in the sample but still we are getting this issue.

Please have a look at the sample and suggest something.

Regards,
Anshul
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Expander button visibility issue
Reply #3 - Sep 17th, 2009 at 1:18pm
Print Post  
However you should hide the expand button of the previous node before setting the reference to point to the new node. So it should work fine if you swap the two if statements in the MouseMove handler:

Code
Select All
void diagram_MouseMove(object sender, MouseEventArgs e)
{
	Point mousePosition = e.GetPosition(diagram.DocumentPlane);
	DiagramItem item = diagram.GetItemAt(mousePosition, true);

	if (expandVisibleNode != null && !expandVisibleNode.Bounds.Contains(mousePosition))
	{
		ShapeNode expandNode = expandVisibleNode.SubordinateGroup.AttachedNodes[0] as ShapeNode;
		expandNode.Visible = false;
	}

	if (item != null)
	{
		ShapeNode node = item as ShapeNode;

		if (node != null && node.SubordinateGroup != null)
		{
			ShapeNode expandNode = node.SubordinateGroup.AttachedNodes[0] as ShapeNode;
			expandNode.Visible = true;
			expandVisibleNode = node;
		}
	}
}
 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Re: Expander button visibility issue
Reply #4 - Sep 17th, 2009 at 4:07pm
Print Post  
Thanks a lot stoyan Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint