Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Directing Mouse input to Node UiElement (Read 3602 times)
Paul Eden
Full Member
***
Offline



Posts: 128
Joined: Aug 15th, 2007
Directing Mouse input to Node UiElement
Feb 10th, 2010 at 12:10pm
Print Post  
Hi Stoyan

I'm not sure if this has been asked before by myself or anyone else, but a search did not yeild what I was looking for - do you have a segement of code that demonstrates the ability to make a node ignore mouse input so tht the nodes UiElement can react to mouse input as if it was not in a DiagramNode?
An example is tryingto drag-select - the mousedown is caught by the node and the diagram objects start trying to interpret the movement. Initially we had used CancelDrag() within the Node.Modifying event off of the Diagram, but this would still seem to be interfering with the input.


Many thanks


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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Directing Mouse input to Node UiElement
Reply #1 - Feb 10th, 2010 at 2:22pm
Print Post  
Hi Paul,

We have some property to control this in the winforms version and can port it to wpf in a later release.

Currently the only way to implement this yourself is through a custom Behavior-derived class that doesn't call the base MouseDown/StartDraw when it detects there is such UIElement under the mouse pointer.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Directing Mouse input to Node UiElement
Reply #2 - Feb 11th, 2010 at 8:54am
Print Post  
Hi,

I couldn't run the samples because of missing licenses for the chart component you are using. However I can see your BehaviorEx class overrides only the StartDraw method - this is not enough because some common actions for all behaviors are executed outside this method. You must also override BehaviorBase.OnMouseDown, and do not call the base implementation when (node.UIElement is Chart).

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



Posts: 128
Joined: Aug 15th, 2007
Re: Directing Mouse input to Node UiElement
Reply #3 - Feb 12th, 2010 at 10:36am
Print Post  
Hi

While we can get almost perfect results in a test application, porting across to our mian app is proving a little more difficult - somewhere along the line something is interfering with the mouse input.  While we will continue to investigate this, do you have an idea as to when the WinForms property is due to be put into the WPF version to direct mouse input?

Many thanks

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Directing Mouse input to Node UiElement
Reply #4 - Feb 12th, 2010 at 4:39pm
Print Post  
Hi Paul,

The interaction actually starts in response to the first MouseMove event. Could you try overriding MouseMove in the same manner as MouseDown?

Stoyan
  
Back to top
 
IP Logged
 
Paul Eden
Full Member
***
Offline



Posts: 128
Joined: Aug 15th, 2007
Re: Directing Mouse input to Node UiElement
Reply #5 - Feb 15th, 2010 at 12:53pm
Print Post  
Hi

Overriding MouseMove seemed to have no additional effect.  I also took your suggestion a step further and ensured that BAse.MouseUp only fired when the mouse was not over the control UIElement in quesiton, but again without additional result.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Directing Mouse input to Node UiElement
Reply #6 - Feb 15th, 2010 at 3:03pm
Print Post  
It seems it's enough to override OnMouseMove like this:

Code
Select All
protected override void OnMouseMove(Point mousePosition)
{
	DiagramNode node = Diagram.GetNodeAt(mousePosition, true, false);
	if (node != null && node.UIElement is Chart)
	{
		Diagram.ReleaseMouseCapture();
		return;
	}

	base.OnMouseMove(mousePosition);
} 



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



Posts: 128
Joined: Aug 15th, 2007
Re: Directing Mouse input to Node UiElement
Reply #7 - Feb 22nd, 2010 at 4:32pm
Print Post  
Thanks Stoyan - that certainly helped us out.


Paul
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint