Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Restriction on create a new node (Read 3028 times)
qomo-peter
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Nov 4th, 2011
Restriction on create a new node
Nov 30th, 2011 at 4:31pm
Print Post  
When creating a new DiagramNode by moving the mouse on the diagram, either the width or the high of bounds is too small, the node will be canceled.
Is that right? and how to disable it. I want to create a node without restriction.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Restriction on create a new node
Reply #1 - Nov 30th, 2011 at 4:51pm
Print Post  
Try setting a very small MinimumNodeSize value.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
qomo-peter
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Nov 4th, 2011
Re: Restriction on create a new node
Reply #2 - Dec 1st, 2011 at 12:56am
Print Post  
Sad I have tried, but failed.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Restriction on create a new node
Reply #3 - Dec 1st, 2011 at 8:36am
Print Post  
In what way did you fail? Smiley Note that a zero size is the default, and the control interprets it as a MeasureUnit -indepent value of couple of millimeters. You will have to set it to something like 0.1 x 0.1 to have any effect.

If this is about the FreeLine class we discussed earlier, you could just override its AllowCreate method to disregard MinimumSize:

Code
Select All
protected override bool AllowCreate(Point current, InteractionState ist)
{
	return true;
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
qomo-peter
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Nov 4th, 2011
Re: Restriction on create a new node
Reply #4 - Dec 1st, 2011 at 2:04pm
Print Post  
Grin You got it, all about the freeline. I can't finished it without your help.

it works with setting:
diagram.AlignToGrid = false;

but override the AllowCreate works better.
Thanks

Another question, I can't draw a new line from an exist line or node, the cursor becomes  "select frame".How can I draw a line from any point of diagram?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Restriction on create a new node
Reply #5 - Dec 1st, 2011 at 3:12pm
Print Post  
Hi,

You should be able to draw a FreeLine from another FreeLine if the latter does not show selection frame. Make sure SelectAfterCreate is disabled and ModificationStart is not set to AutoHandles. To prevent interactive selection completely, set e.Cancel = true from the NodeSelecting handler.

To disable drawing standard DiagramLinks from a node, you will have to create a custom behavior class and assign its instance to the CustomBehavior property:

Code
Select All
class MyBehavior : DrawNodesBehavior
{
	public MyBehavior(Diagram diagram) : base(diagram) {}

	protected override DiagramNode CreateNode()
	{
		return new FreeLine();
	}
}

diagram.CustomBehavior = new MyBehavior(diagram); 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
qomo-peter
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Nov 4th, 2011
Re: Restriction on create a new node
Reply #6 - Dec 1st, 2011 at 3:27pm
Print Post  
Cheesy

Great, the FreeLine works perfect now.

Thanks a lot.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint