Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Print Manager using Flowchart (Read 4612 times)
luis
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: May 25th, 2010
Print Manager using Flowchart
May 25th, 2010 at 5:07pm
Print Post  
I must create an application and i would like to use Flowchart, having a diagram, diagramview, and ruler. The user designs by dragging and dropping custom shapes as rounded shapes,text etc.. once the user finished the design, it can generate a pdf file according with dimensions height and width defined priorly. It is that posible?.

I need to provide a combo thas allows users to define the size of the design surface supporting A4,letter,legal.  The pdf dimensions has the same size of design surface. How can i define the size of area of my diagram view according the units selected and my own page sizes?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Print Manager using Flowchart
Reply #1 - May 25th, 2010 at 5:44pm
Print Post  
Hi,

You can add to the combo box the members of the PageSize enum from the MindFusion.Pdf namespace. Then use this method to get the page size in points:

Code
Select All
public static SizeF GetPageSize(PageSize sizeE, PageOrientation orientation)
{
	SizeF size;
	switch (sizeE)
	{
	case MindFusion.Pdf.PageSize.Letter:
		size = PageSizes.Letter;
		break;
	case MindFusion.Pdf.PageSize.Note:
		size = PageSizes.Note;
		break;
	case MindFusion.Pdf.PageSize.Legal:
		size = PageSizes.Legal;
		break;
	case MindFusion.Pdf.PageSize.A0:
		size = PageSizes.A0;
		break;
	case MindFusion.Pdf.PageSize.A1:
		size = PageSizes.A1;
		break;
	case MindFusion.Pdf.PageSize.A2:
		size = PageSizes.A2;
		break;
	case MindFusion.Pdf.PageSize.A3:
		size = PageSizes.A3;
		break;
	case MindFusion.Pdf.PageSize.A4:
		size = PageSizes.A4;
		break;
	case MindFusion.Pdf.PageSize.A5:
		size = PageSizes.A5;
		break;
	case MindFusion.Pdf.PageSize.A6:
		size = PageSizes.A6;
		break;
	case MindFusion.Pdf.PageSize.B0:
		size = PageSizes.B0;
		break;
	case MindFusion.Pdf.PageSize.B1:
		size = PageSizes.B1;
		break;
	case MindFusion.Pdf.PageSize.B2:
		size = PageSizes.B2;
		break;
	case MindFusion.Pdf.PageSize.B3:
		size = PageSizes.B3;
		break;
	case MindFusion.Pdf.PageSize.B4:
		size = PageSizes.B4;
		break;
	case MindFusion.Pdf.PageSize.B5:
		size = PageSizes.B5;
		break;
	default:
		size = PageSizes.A4;
		break;
	}

	if (orientation == PageOrientation.Landscape)
		size = new SizeF(size.Height, size.Width);

	return size;
} 



You must either switch MeasureUnit to Point to use these values, or multiply the size by 25.4 / 72 to get it in millimeters. Then assign the size to diagram.Bounds to make the canvas as big as a page. You will also have to take care of the pdf page margins - either set them to 0, or subtract them from the canvas size.

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


I love YaBB 1G - SP1!

Posts: 5
Joined: May 25th, 2010
Re: Print Manager using Flowchart
Reply #2 - May 25th, 2010 at 9:53pm
Print Post  
Thanks for your response , i followed your instructions, i change the diagram size according with the pdf size, but when maximixed the application the ruler increase your values. For example i have letter (215.9 Width) the ruler Horizontally shows me 216 mm aprox, and that its ok, but when i maximize the application ruler, Horizontally shows me 240mm aprox.

What is going on?

Note : The effect doesn't occur Vertically.

I can send you the code of may app if you want.

Could i send you the code of the demo.

Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Print Manager using Flowchart
Reply #3 - May 26th, 2010 at 5:19am
Print Post  
Hi,

At this time the ruler scales stretch to fill the entire DiagramView area, and not only the diagram bounds. For now you could set diagram.ExteriorBrush = new SolidBrush(SystemColors.ControlDark) to show the inactive part of the view in gray. I suppose we can add an option for the scales to end at the right and bottom of diagram.Bounds when the view is larger.

Stoyan
  
Back to top
 
IP Logged
 
luis
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: May 25th, 2010
Re: Print Manager using Flowchart
Reply #4 - May 26th, 2010 at 7:52pm
Print Post  
Thanks for your answer.

Setting this.diagram.ExteriorBrush = new MindFusion.Drawing.SolidBrush("#FFA9A9A9");  is ok.

But right now i want to create a arrow shape by code:

             Shape mys = new Shape(
           new ElementTemplate[] {
                 new LineTemplate(0, 0, 30, -30),
                 new LineTemplate(30,-30, 60, 0),
                 new LineTemplate(60, 0, 45, 0),
                 new LineTemplate(45, 0, 45, 50),
                 new LineTemplate(45, 50, 15, 50),
                 new LineTemplate(15, 50, 15, 0),
           },
           FillMode.Alternate, "Custom");

               ShapeNode b = this.diagram.Factory.CreateShapeNode(new RectangleF(10, 10, 40, 20),mys);
               b.AllowIncomingLinks = false;
               b.AllowOutgoingLinks = false;
               b.ShadowColor = Color.Transparent;
     }

The arrow appears ok but when i selected it, i noticed the arrow its not located in the center of shapenode because the coordinates given are relative to the left upper corner. How can i resolve this?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Print Manager using Flowchart
Reply #5 - May 26th, 2010 at 8:42pm
Print Post  
Hi,

The Shape coordinates specify percents of a node's bounding rectangle, i.e. the points from the 0-100 range of the shape definition are mapped to points from the node's Bounds range. So the center point is always 50, 50, and you should add the line elements symmetrically around it to have a centered shape.

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


I love YaBB 1G - SP1!

Posts: 5
Joined: May 25th, 2010
Re: Print Manager using Flowchart
Reply #6 - May 26th, 2010 at 9:35pm
Print Post  

That is right, my arrow is in middle of shape.

You have a great product.

I have others questions related with Custom nodes, but and i will let you know later   


Thanks
  
Back to top
 
IP Logged
 
luis
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: May 25th, 2010
Re: Print Manager using Flowchart
Reply #7 - May 27th, 2010 at 12:25am
Print Post  

Do exist functions that having a set of Nodes selected i can use in order to Align Lefts,Align Centers,Align Tops,Align Middles,Makes Same Width,Makes Same Height,Makes Same Size? 

Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Print Manager using Flowchart
Reply #8 - May 27th, 2010 at 5:07am
Print Post  
Hi,

There aren't any built-in alignment methods. You could loop over the selected nodes and change their location or Bounds according to the ActiveItem's one, e.g.

Code
Select All
// align left
foreach (DiagramNode node in diagram.Selection.Nodes)
{
	node.Move(
		diagram.ActiveItem.GetBounds().X,
		node.Bounds.Y);
} 



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


I love YaBB 1G - SP1!

Posts: 9
Joined: Jul 26th, 2010
Re: Print Manager using Flowchart
Reply #9 - Aug 4th, 2010 at 10:20pm
Print Post  
hi, my application allows to change the pagesize providing a combo containing the several pagesize available and everything is fine.

But i having the following problem.

1- I open de application, the letter pagesize is set by default.
2- I set the diagram.ExteriorBrush = new SolidBrush(SystemColors.ControlDark) to show the inactive part of the view in gray.

3- the vertical inactive area goes from 215.9mm to 330 mm that is ok.

4-the horizontal below inactive area it does not visible too much.

5- I change the pagesize to 1188.156mm Height X 839.6111 Width.

6- The diagram refreshes and now the ruler goes to 0 to +-840mm Horizontal and 0 to +-1190mm Vertical that is ok but both inactive areas disappeared.

7- How to make bigger those inactive areas in order to show those when bigger pagesize are used.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Print Manager using Flowchart
Reply #10 - Aug 5th, 2010 at 5:30am
Print Post  
Hi,

Currently ExteriorBrush is shown only if the diagram width or height is smaller than the view. Do you mean you need the view to always show some inactive margin area around the diagram?

Stoyan
  
Back to top
 
IP Logged
 
luisfernando
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Jul 26th, 2010
Re: Print Manager using Flowchart
Reply #11 - Aug 5th, 2010 at 9:55pm
Print Post  
Exactly, Because the Vertical an Horizaontal scrollbars are occupying a small part of the diagramview area.

Having a inactive area always it does not happen
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Print Manager using Flowchart
Reply #12 - Aug 10th, 2010 at 7:57am
Print Post  
This version considers the space occupied by a scrollbar when setting the range of the other scrollbar, so the bottommost and rightmost parts of the diagram should stay visible:
https://mindfusion.eu/_beta/fcnet_scrollarea.zip

We'll also try to add some property for setting the DiagramView margins for the next release.

Stoyan
  
Back to top
 
IP Logged
 
luisfernando
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 9
Joined: Jul 26th, 2010
Re: Print Manager using Flowchart
Reply #13 - Aug 10th, 2010 at 3:03pm
Print Post  
Excellent, thanks for your help.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint