Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic ControlNode shifting in diagram view (Read 2700 times)
ewu
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 4
Joined: Oct 1st, 2012
ControlNode shifting in diagram view
Oct 3rd, 2012 at 9:36pm
Print Post  
I have a problem with displaying my diagram of ControlNodes (which are hosting .Net controls) in an overview window. I have already handled PaintControl so the nodes render as I want. However whenever I add a node with 2 or more outgoing or incoming links, the controls shift to the right a bit, causing the overview window to shown them offset (see attachment images).

Any ideas what could be causing this or how to fix it? Thanks.
  

Overview1.png (Attachment deleted)
Overview2.png (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ControlNode shifting in diagram view
Reply #1 - Oct 4th, 2012 at 7:14am
Print Post  
What does your PaintControl handler look like? You might have to convert some coordinates from pixels to diagram's MeasureUnit when drawing on the diagram's Graphics.

In any case, we now recommend using CompositeNodes instead of ControlNodes. CompositeNodes integrate much better with other diagram features such as Z order, zooming and printing. If you are only displaying an image with several labels in your custom controls, you can find the implementation of similar CompositeNodes in this tutorial:
http://www.mindfusion.eu/onlinehelp/flowchartnet/index.htm?Tutorial_3__Custom_co...

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


I Love MindFusion!

Posts: 4
Joined: Oct 1st, 2012
Re: ControlNode shifting in diagram view
Reply #2 - Oct 4th, 2012 at 9:36pm
Print Post  
Thank you for the reply. I solved the problem by using PaintRect's location.

The diagram now shows up in overview window and exports to image perfectly, however exporting to PDF (check image) and Print Preview still shows up blank nodes. I checked the sample Demo code and it calls the PaintControl code block with exporting to PDF and printpreview, but mine doesn't. I don't see anything different I'm doing to export to pdf or print preview (using PrintPreviewEX()). Any insight on this?

Also is there a way to change the background color of the node fill block in the overview?

Thank you so much for your time and help.
  

Overview3.png (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ControlNode shifting in diagram view
Reply #3 - Oct 5th, 2012 at 5:52am
Print Post  
Try enabling PrintOptions.PaintControls.

Quote:
Also is there a way to change the background color of the node fill block in the overview?


I think that's actually the node's shadow, whose color you can change via the node's ShadowBrush property. You will have to call graphics.FillRectangle from the paint event handler to get a filled rectangle representing the control's frame.

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


I Love MindFusion!

Posts: 4
Joined: Oct 1st, 2012
Re: ControlNode shifting in diagram view
Reply #4 - Oct 5th, 2012 at 2:09pm
Print Post  
Thanks for the reply. Enabling PrintOptions.PaintControl did the trick. However is there a way to set a different font setting (specifically font size) for print preview? The font I'm using for diagram_PaintControl works perfectly for the overview window, but in print preview, it's disproportionately large.

Also while enabling PrintOptions.PaintControls made print preview work, exporting to PDF is still showing up blanks, even though it's calling the diagram_PaintControl. I'm using MindFusion FlowChart.NET component, version 5.3.2 if that helps.

Thank you so much for all your help.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ControlNode shifting in diagram view
Reply #5 - Oct 5th, 2012 at 5:06pm
Print Post  
What Unit are you assigning to that font?

Regarding PDF, try using some alternative methods when drawing, e.g. DrawImage instead of DrawIcon, or DrawString(Rect) instead of DrawString(Point) - earlier versions of the PDF library had only methods used for drawing by standard node types implemented, and later one we added additional methods requested by users. Also if you call FillRectangle, does the rectangle appear at the correct position?
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint