Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Node resizing constraints (Read 2375 times)
IgorS
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 13
Joined: Sep 22nd, 2008
Node resizing constraints
Dec 10th, 2008 at 2:57pm
Print Post  
Hi.

I have nodes, that can be resized by user. And I've set node.Constraints.MinWidth property, so when user drags the AdjustmentHandle, he can't make node width less than some value. But if user continues dragging, he can "swing" the node. But I don't want node's position to be changed. Can I disable this opportunity?
Thanks a lot.

Igor.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Node resizing constraints
Reply #1 - Dec 10th, 2008 at 5:38pm
Print Post  
Hi,

Unfortunately you can't disable it entirely, but at least could prevent the user from dropping the node at the mirrored position:

Code
Select All
private Rect originalRect;

private void OnNodeStartModifying(object sender, NodeValidationEventArgs e)
{
originalRect = e.Node.Bounds;
}

private void OnNodeModifying(object sender, NodeValidationEventArgs e)
{
	if (originalRect.Left != e.Node.Bounds.Left &&
		originalRect.Right != e.Node.Bounds.Right)
	{
		// it swinged horizontally
		e.Cancel = true;
	}
}
 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
IgorS
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 13
Joined: Sep 22nd, 2008
Re: Node resizing constraints
Reply #2 - Dec 12th, 2008 at 10:38am
Print Post  
Well, it's not not very good in my case. I don't think this mirroring is often needed. Maybe you could add this as option in NodeConstraints in future...  Anyway thanks.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Node resizing constraints
Reply #3 - Dec 19th, 2008 at 11:07am
Print Post  
This version adds a DisableMirroring option to NodeConstraints:
https://mindfusion.eu/_temp/wpfdiag_cdm.zip

We haven't tested yet how it works in combination with other constraints. Let me know if you see any issues.

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