Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Is there a way to change cursor for only 1 col? (Read 1102 times)
consolejoker
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 74
Joined: Dec 17th, 2007
Is there a way to change cursor for only 1 col?
Apr 1st, 2008 at 5:07pm
Print Post  
If I have a table node with 2 columns, I'd like the hand cursor only in the editable right hand column, leaving the standard mouse cursor for the left hand column.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Is there a way to change cursor for only 1 col
Reply #1 - Apr 1st, 2008 at 8:45pm
Print Post  
It's possible, but only through a custom Behavior object.

Code
Select All
public class MyBehavior : LinkTablesBehavior
{
	public MyBehavior(DiagramView view) : base(view)
	{
	}

	public override CursorHint SetMouseCursor(PointF point, out bool startInteraction)
	{
		CursorHint cursor = base.SetMouseCursor(point, out startInteraction);

		TableNode table = Diagram.GetNodeAt(point) as TableNode;
		if (table != null)
		{
			int row = 0, col = 0;
			if (table.CellFromPoint(point, ref row, ref col))
			{
				if (col == 0)
				{
					DiagramView.Cursor = Cursors.Arrow;
					cursor = CursorHint.DontChange;
				}
			}
		}

		return cursor;
	}
}
 



Assign an instance of that class to DiagramView.CustomBehavior.

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