Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Newbie question (Read 3672 times)
chuckdawit
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 20
Joined: Sep 4th, 2009
Newbie question
Sep 4th, 2009 at 4:40pm
Print Post  
Hi,
I'm new to Flowchart.Net and can't figure out how to use the application to create a box with curved edges.
Can I do it with the mouse, or do I have to do it programmaticly? I see all the predefined shapes but can't do anything with them like drag and drop them into the design window.  The directions suck and don't explain much.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Newbie question
Reply #1 - Sep 4th, 2009 at 5:29pm
Print Post  
Hi,

If you need to let your users add shapes via drag-and-drop, add a ShapeListBox to your form and set the DiagramView.AllowDrop property. To let them draw a specific kind of shape with the mouse, set the Diagram.DefaultShape property.

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


I love YaBB 1G - SP1!

Posts: 20
Joined: Sep 4th, 2009
Re: Newbie question
Reply #2 - Sep 4th, 2009 at 6:48pm
Print Post  
would it be possible to get example code on creating a DividedEventShape? I can't seem to find anything and when I try to edit the code at the bottom of the shape designer it doesn't do anything.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Newbie question
Reply #3 - Sep 4th, 2009 at 6:59pm
Print Post  
If you need to create a node with that shape, call diagram.Factory.CreateShapeNode(rect, Shapes.DividedEvent). To let users draw it with the mouse, set diagram.DefaultShape to Shapes.DividedEvent.

You might as well modify the shape in the shape designer tool and give it a new ID. Then you could either copy the definition code to your application init method and use the shape by calling Shape.FromId, or save a shape library file and load it into the application by calling ShapeLibrary.LoadFrom().

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


I love YaBB 1G - SP1!

Posts: 20
Joined: Sep 4th, 2009
Re: Newbie question
Reply #4 - Sep 4th, 2009 at 7:07pm
Print Post  
This is what is in the code area of the designer. What would I need to change here????
// C# ShapeTemplate definition
   new ShapeTemplate(
      new ElementTemplate[]
      {
           new LineTemplate(0, 0, 92, 0),
           new LineTemplate(92, 0, 100, 100),
           new LineTemplate(100, 100, 0, 86),
           new LineTemplate(0, 86, 0, 0)
      },
      new ElementTemplate[]
      {
      },
null, FillMode.Winding,   "test" );
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Newbie question
Reply #5 - Sep 4th, 2009 at 7:40pm
Print Post  
You don't change anything in that code while in the shape designer tool. You drag control points in the area on the top-left, and that code is generated for you. You might insert new points into existing paths or add new paths using various context menu commands. Then copy that code to your project's init section and call Shape.FromId("test") to access the shape definition. You should add a DiagramView object to the project in order to show diagrams.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Newbie question
Reply #6 - Sep 4th, 2009 at 7:46pm
Print Post  
... if what you are trying to get is a custom shape with rounded corners, you could use the RoundedRect shape as a template. Its definition looks like this:

Code
Select All
// C# ShapeTemplate definition
new Shape(
	// outline
	new ElementTemplate[]
	{
		new RoundRectangleTemplate(0, 0, 100, 100, 6)
	},
	// decorations
	new ElementTemplate[]
	{
	},
	null, FillMode.Winding,   "test" );
 



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


I love YaBB 1G - SP1!

Posts: 20
Joined: Sep 4th, 2009
Re: Newbie question
Reply #7 - Sep 4th, 2009 at 8:52pm
Print Post  
great thanks, but how do I get this object to view in the designer? When I copy and paste this code into the screen at the bottom, what do I need to do to see the rectangle in the area above??
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Newbie question
Reply #8 - Sep 5th, 2009 at 12:40pm
Print Post  
I'm afraid the shape designer tool cannot parse code. You can find the RoundRect shape in the listbox on the right. Select it to get a rounded rectangle in the designer, and using the context menu insert any additional graphics you might need.

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