Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Cursors (Read 3949 times)
JasonB
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 24
Joined: Jun 5th, 2008
Cursors
Jun 19th, 2008 at 6:50pm
Print Post  
Setting the Cursor property on the Diagram, nodes, etc. does not seem to work. If I set the cursor on my UIElement, it gets immediately changed back to what it was before. 

My problem is that I need to change the mouse cursor if a link that is being drawn is attempting to connect to an anchor point that it cannot connect to. The ValidateAnchorPoint event doesn't do quite what I want; I'm perfectly able to function without it, except for this cursor issue. The documentation mentions the CurrentCursor property but I wasn't able to find this.

Any ideas?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Cursors
Reply #1 - Jun 20th, 2008 at 7:45am
Print Post  
At each mouse-move notification, the Diagram sets the base Control.Cursor property to one of its own cursors, such us AllowLinkCursor, PanCursor, ... We'll add a CustomCursor property that will let you override that behavior, and upload the diagramming.dll here later today.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Cursors
Reply #2 - Jun 20th, 2008 at 12:01pm
Print Post  
We have added the Diagram.OverrideCursor property. If you assign a Cursor object to OverrideCursor, the default behavior where the cursor changes depending on the context is disabled. Set it to null to enable that behavior again.

https://mindfusion.eu/_beta/wpfdiag101pre.zip

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


I love YaBB 1G - SP1!

Posts: 24
Joined: Jun 5th, 2008
Re: Cursors
Reply #3 - Jun 20th, 2008 at 3:19pm
Print Post  
Thanks, this does exactly what I need.

There is a related problem, however, in that MouseLeave for the node does not fire as expected, and MouseLeave for my UIElement is firing any time I move the cursor to the left while the mouse button is pressed (as I'm creating a diagram link from one anchor to another node's anchor) even though the mouse cursur is still over the element. So MouseLeave will fire 50 or so times for every inch or so of screen movement. This doesn't occur if the mouse is moved to the right while over the element, just if moved to the left. This behavior does not occur in a stand alone test of normal UI elements (I tested with my UIElement, which is composed of a treeview).

Is there any chance something you are doing is causing MouseLeave to fire when it shouldn't be, or are purposefully causing this to fire?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Cursors
Reply #4 - Jun 20th, 2008 at 5:09pm
Print Post  
This might be related to the mouse cursor entering the UIElement of the link being drawn, and so leaving the node's UIElement. I suppose that could depend on the movement direction if the mouse position is aligned to left side of the screen pixel. Are there multiple Enter events raised too?
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint