Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Change Mouse Cursor (Read 2114 times)
Nedor
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Aug 6th, 2010
Change Mouse Cursor
Sep 7th, 2010 at 5:02am
Print Post  
I try to change the default mouse cursor for the DiagramView component. But it won't change.

I want to implement some different edit modes:
If the user wants to draw nodes, he has to choose a nodetype from a menu. In this case I set the behavior to "DrawShapes". And want to set another mousecursor to inform the user that he is in "CreateNodes-mode".

If he wants to draw links, he has to choose a link type from a menu. In this case i set the behavior to "DrawLinks" and want to set a new cursor, to inform the user that he is in "CreateLinks-mode".

If no mode is Selected (no linktype or nodetype) , I set the behavior to "Modify" and the default cursor should be displayed.

But I cant change the mousecursor of the DiagramView component. I tried DiagramView.CurrentCursor, DiagramView.Cursor and some other properties, but the Cursor won't change to another one.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Change Mouse Cursor
Reply #1 - Sep 7th, 2010 at 6:20am
Print Post  
The view automatically changes between several mouse cursors depending on the context. Try setting the PointerCursor property in your case. I think you can set CurrentCursor only from a custom Behavior-derived class.
  
Back to top
 
IP Logged
 
Nedor
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Aug 6th, 2010
Re: Change Mouse Cursor
Reply #2 - Sep 7th, 2010 at 7:17am
Print Post  
The hint with the PointerCursor worked well.
Thanks for your help.
  
Back to top
 
IP Logged
 
mikeaerni
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Apr 30th, 2007
Re: Change Mouse Cursor
Reply #3 - Sep 24th, 2010 at 9:46pm
Print Post  
I am trying to implement something similar and was able to accomplish it by changing the PointerCursor.  However, when the user starts drawing a zone, the Disallow Cursor is momentarily displayed till the size of the zone is not empty.  Is there a way to not display the Disallow Cursor.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Change Mouse Cursor
Reply #4 - Sep 25th, 2010 at 6:13am
Print Post  
You could override the BehaviorBase.OnMouseMove method and assign your preferred cursor to DiagramView.Cursor after calling the base method. Or use the OverrideCursor property from this version, it overrides all context-sensitive cursors until you set it back to null:
https://mindfusion.eu/_beta/fcnet_ovrcursor.zip

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint