Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic DiagramNode DragOver indicator (Read 2210 times)
Sim
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 10
Joined: Oct 8th, 2014
DiagramNode DragOver indicator
Dec 30th, 2014 at 1:36pm
Print Post  
Is it possible to check if a DraggramNode is currently dragged over? I would like to check if a ContainerNode object is currently highlighted. I have fixed this by overriding the OnDragOver and OnDragOut and using a property:

Code (C++)
Select All
public override bool OnDragOver(DiagramItem item)
{
    this.IsHighlighted = base.OnDragOver(item);
    return this.IsHighlighted;
}

public override void OnDragOut(DiagramItem item)
{
    this.IsHighlighted = false;
    base.OnDragOut(item);
} 



Would it be possible to check if a DiagramNode is currently dragged over without using the code above?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DiagramNode DragOver indicator
Reply #1 - Dec 30th, 2014 at 2:19pm
Print Post  
You could call GetNodeAt while the mouse moves, e.g.

Code
Select All
private void diagramView_MouseMove(object sender, MouseEventArgs e)
{
	if (diagram.Interaction != null)
	{
		var nodeBehind = diagram.GetNodeAt(
			diagram.Interaction.CurrentPoint, false, true);
		if (nodeBehind != null)
		{
			nodeBehind.Brush = new SolidBrush(Color.Red);
			diagramView.RecreateCacheImage();
		}
	}
} 



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


I Love MindFusion!

Posts: 10
Joined: Oct 8th, 2014
Re: DiagramNode DragOver indicator
Reply #2 - Dec 30th, 2014 at 3:01pm
Print Post  
Thank you for your response. Would it be possible to check if the OnDragOver method has been called without resorting to using event handlers/the mouse position?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DiagramNode DragOver indicator
Reply #3 - Dec 30th, 2014 at 4:10pm
Print Post  
It's not possible via public API at this time. If you have the source code, you could add your checks to the DiagramView.OnDragOverNode method.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint