Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Issue with move handles on shapenode with HandlesStyle.DashFrame (Read 2481 times)
j poz
Junior Member
**
Offline


I Love MindFusion!

Posts: 78
Joined: Nov 21st, 2012
Issue with move handles on shapenode with HandlesStyle.DashFrame
Feb 18th, 2015 at 5:23pm
Print Post  
We are using some very basic C# code, adapted from Tutorial 4, to demonstrate an issue we are having. Here is the code:

Code
Select All
this.diagram1.ShapeHandlesStyle = HandlesStyle.DashFrame;
this.diagram1.DefaultShape = Shapes.Rectangle;
ShapeNode b = diagram1.Factory.CreateShapeNode(10, 10, 140, 140);
b.AllowIncomingLinks = false;
b.AllowOutgoingLinks = false; 



What happens is that a shapenode is created on the canvas, but when I select it and then mouse over it to move it, the move cursor only appears inside of the shapenode after an area of padding where the mouse seems to stay in pointer mode and not allow moving.

  

comment_move_handle.png ( 6 KB | 122 Downloads )
comment_move_handle.png
Back to top
 
IP Logged
 
j poz
Junior Member
**
Offline


I Love MindFusion!

Posts: 78
Joined: Nov 21st, 2012
Re: Issue with move handles on shapenode with HandlesStyle.DashFrame
Reply #1 - Feb 18th, 2015 at 5:24pm
Print Post  
To further explain the above, the shapenode allows me to click on it and then move it from anywhere in the green, but the red area only gives me a pointer cursor and doesn't allow me to move the shapenode.

Is there anyway to fix this?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Issue with move handles on shapenode with HandlesStyle.DashFrame
Reply #2 - Feb 18th, 2015 at 7:44pm
Print Post  
Set HandlesStyle to Custom and handle the events like this:

Code
Select All
void OnDrawAdjustmentHandles(object sender, MindFusion.Diagramming.DrawItemEventArgs e)
{
	var node = (DiagramNode)e.Item;
	var style = node == diagram.ActiveItem ?
		diagram.ActiveItemHandlesStyle :
		diagram.SelectedItemHandlesStyle;

	InternalUtils.DrawSelHandles(
		e.Graphics,
		style,
		diagram.DisabledHandlesStyle,
		node.Bounds,
		node.RotationAngle,
		node.EnabledHandles,
		true,
		HandlesStyle.DashFrame,
		diagram.AdjustmentHandlesSize,
		new RenderOptions());
}

void OnHitTestAdjustmentHandles(object sender, HitTestEventArgs e)
{
	var node = (DiagramNode)e.Item;
	node.HandlesStyle = HandlesStyle.DashFrame;

	AdjustmentHandle handle = node.HitTestHandle(e.MousePosition);
	if (handle == null && !node.AllowOutgoingLinks &&
		node.ContainsPoint(e.MousePosition))
		handle = new NodeAdjustmentHandle(NodeHandleType.Move);
	e.HitResult = handle;
	node.HandlesStyle = HandlesStyle.Custom;
} 



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