Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Add custom shape type (Read 3926 times)
Hamdy Ghanem
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 110
Location: Egypt
Joined: Mar 11th, 2009
Add custom shape type
May 11th, 2011 at 10:18am
Print Post  
like the Flowcharter in the sample
how to add items to shapes diagram in the right side  and dragdrop in the diagram it will load that custom shape
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Add custom shape type
Reply #1 - May 11th, 2011 at 10:39am
Print Post  
Do you mean you need to show custom DiagramNode-derived objects in the listbox, or only new Shapes?
  
Back to top
 
IP Logged
 
Hamdy Ghanem
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 110
Location: Egypt
Joined: Mar 11th, 2009
Re: Add custom shape type
Reply #2 - May 11th, 2011 at 10:40am
Print Post  
yes, DiagramNode-derived objects in the listbox
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Add custom shape type
Reply #3 - May 11th, 2011 at 11:09am
Print Post  
That's not supported in the ASP.NET version. You could add some placeholder shapes there, and replace ShapeNodes created from those shapes with your custom nodes when NodeCreated is raised.
  
Back to top
 
IP Logged
 
Hamdy Ghanem
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 110
Location: Egypt
Joined: Mar 11th, 2009
Re: Add custom shape type
Reply #4 - May 11th, 2011 at 11:11am
Print Post  
I created the shape but is there any sample for changing it(the second step u mentioned )
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Add custom shape type
Reply #5 - May 11th, 2011 at 11:23am
Print Post  
Try this, assuming ImageMap mode:

Code
Select All
private void OnNodeCreated(object sender, NodeEventArgs e)
{
	ShapeNode sn = (ShapeNode)e.Node;
	if (sn.Shape == "MyNode")
	{
		MyNode myNode = new MyNode();
		myNode.Bounds = e.Node.Bounds;
		diagram.Nodes.Add(myNode);
		diagram.Nodes.Remove(sn);
	}
} 

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint