Page Index Toggle Pages: 1 2 [3]  Send TopicPrint
Very Hot Topic (More than 25 Replies) Moving shadow not the actual item (Read 15378 times)
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Moving shadow not the actual item
Reply #30 - Nov 20th, 2009 at 11:14am
Print Post  
Hi Anshul,

AutoHandles works both for nodes and links. If you need the handles to be drawn only if the link is selected, you could set the HandlesStyle to Custom and in the DrawAdjustmentHandles handler draw the link handles only in that case.

Stoyan
  
Back to top
 
IP Logged
 
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Re: Moving shadow not the actual item
Reply #31 - Nov 21st, 2009 at 8:57am
Print Post  
Hi Stoyan,

I have set link style to custom at the time of creation and in DrawAdjustmentHandles handler I am changing its style to SquareHandle. It is working fine for first time but once it passes through the DrawAdjustmentHandles handler link style gets changed to SquareHandle.
My question is where I can reset link's style to custom?

The code which I have written inside DrawAdjustmentHandles  is given below.

Code
Select All
if (e.Item is DiagramLink && e.Item.Selected)
			  {
				DiagramLink link = e.Item as DiagramLink;
				link.HandlesStyle = HandlesStyle.SquareHandles;
			  } 




Regards,
Anshul
  
Back to top
 
IP Logged
 
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Re: Moving shadow not the actual item
Reply #32 - Nov 23rd, 2009 at 6:55am
Print Post  
Hi Stoyan,

Any suggestion for this?

Regards,
Anshul
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Moving shadow not the actual item
Reply #33 - Nov 23rd, 2009 at 7:49am
Print Post  
Hi,

I suppose you are setting HandlesStyle = SquareHandles in order to make the link's DrawHandles method render the handles. So after calling e.Link.DrawHandles(), set link.HandlesStyle = Custom again.

Alternatively, you could simply loop over the link's ControlPoints and draw some rectangles around them:

Code
Select All
void diagram_DrawAdjustmentHandles(object sender, DrawItemEventArgs e)
{
	var link = e.Item as DiagramLink;
	if (link != null && link.Selected)
	{
		foreach (Point p in link.ControlPoints)
			DrawRect(e.Graphics, p, diagram.AdjustmentHandlesSize);
	}
}

private void DrawRect(DrawingContext dc, Point center, double size)
{
	dc.DrawRectangle(Brushes.White, new Pen(Brushes.Black, 1), new Rect(
		center.X - size / 2, center.Y - size / 2, size, size));
}
 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Re: Moving shadow not the actual item
Reply #34 - Nov 23rd, 2009 at 8:14am
Print Post  
Thanks Stoyan Smiley
  
Back to top
 
IP Logged
 
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Re: Moving shadow not the actual item
Reply #35 - Dec 3rd, 2009 at 5:26am
Print Post  
Hi Stoyan,

Try the Diagram.CancelDrag method from this version:
https://www.mindfusion.eu/_beta/wpfdiag_canceldrag.zip


I want to know, to fix this issue when we can get next licensed build of MindFusion.Diagramming.Wpf ?


Regards,
Anshul
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Moving shadow not the actual item
Reply #36 - Dec 3rd, 2009 at 8:54am
Print Post  
In January.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 2 [3] 
Send TopicPrint