Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Custom Cursors (Read 2394 times)
Rich Cassell
Junior Member
**
Offline


I Love MindFusion!

Posts: 63
Joined: Sep 19th, 2012
Custom Cursors
May 22nd, 2014 at 2:47pm
Print Post  
Hello! Smiley

I have a diagramView containing a diagram and i drag components onto it. By default, the components append to any that are currently there but i've made it so that holding down CTRL will replace the component on the diagram. This all works nicely.

However, what i'd really like to do is to have a different cursor showing for when the user holds down CTRL (so that they know which operation it will do)... I already have a pre-made custom cursor class that i use elsewhere but i'm struggling to fit it into work alongside the MindFusion stuff... It uses the Windows.ItemDrag event to create the cursor, but that doesn't exist on MF DiagramViews. Also, it uses the GiveFeedback event, now, this seems to exist on there but i can't get it to fire and i'm not sure why.

If you could give me some pointers on this i'd be very grateful. I'm sure it's just because i've not set a boolean or something on the DiagramView settings but i'm a bit stuck other than that.

Thanks!

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Custom Cursors
Reply #1 - May 22nd, 2014 at 5:45pm
Print Post  
Hi,

During OLE drag-and-drop operations the cursor is set by the source control depending on current DragDropEffect value. So you must set the cursor from the source GiveFeedBack event handler (e.g. ShapeListBox or NodeListview's one) rather than target DiagramView's events.

Code
Select All
void nodeListView_GiveFeedback(object sender, GiveFeedbackEventArgs e)
{
	if (e.Effect == DragDropEffects.Copy)
	{
		e.UseDefaultCursors = false;
		Cursor.Current = Cursors.Help;
		return;
	}

	e.UseDefaultCursors = true;
} 



I hope that helps,
Stoyan
« Last Edit: May 23rd, 2014 at 7:03am by Stoyo »  
Back to top
 
IP Logged
 
Rich Cassell
Junior Member
**
Offline


I Love MindFusion!

Posts: 63
Joined: Sep 19th, 2012
Re: Custom Cursors
Reply #2 - May 23rd, 2014 at 7:05am
Print Post  
Hi Stoyan,

Ahh, i see, that's great. Thanks for your help! Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint