Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Problems when scaling TableNode (Read 4266 times)
caseopeia
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 17
Joined: Apr 8th, 2009
Problems when scaling TableNode
Aug 24th, 2009 at 10:27am
Print Post  
Problems when scaling TableNode

Dear Users, hello Stoyo (are you out there?)

below you can three pictures of the same node in the tree with different scaling:
* Picture 1: 100%
* Picture 2: 90%
* Picture 3: 110%

As you can see, I have problems in displaying: in one case I loose my Spaces, in the other case the text is extended in the next column.
For generating I use a own node derived from ContainerNode inside with a TableNode. I do not set any widths of the TableNode, the size is determined through the surrounding ContainerNode.
ResizeToFitText of TableNode is set to: tableNode.ResizeToFitText(true, false);

Can you give be advices or hints or do you have ideas how to solve this problem?



Greetings from Germany!
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Problems when scaling TableNode
Reply #1 - Aug 25th, 2009 at 7:27am
Print Post  
Hi,

I am trying to reproduce this bug here with no luck. What version of the control you are using? If you are using the latest version, is there a possibility to supply me with a sample illustrating the bug? Send the sample to meppy@mindfusion.eu.

Regards,
Meppy
  
Back to top
 
IP Logged
 
caseopeia
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 17
Joined: Apr 8th, 2009
Re: Problems when scaling TableNode
Reply #2 - Aug 25th, 2009 at 9:25am
Print Post  
Hello,

I am using the latest version 5.3.1 - I will try to create a downstripped sample. Please be patient for a short time. I will post the sample here.

Sincerly, Dirk.
  
Back to top
 
IP Logged
 
caseopeia
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 17
Joined: Apr 8th, 2009
Re: Problems when scaling TableNode
Reply #3 - Aug 26th, 2009 at 9:09am
Print Post  
Hello,

here is some demo code and the resulting problems for me as screeenshots:

Code
Select All
            ContainerNode node              = new ContainerNode(diagram1);
            node.Bounds                     = new RectangleF(100, 100, 100, 30);
            node.AnchorPattern              = AnchorPattern.TopInBottomOut;
            node.Obstacle                   = true;
            diagram1.Nodes.Add(node);

            RectangleF r                    = node.GetBounds();
            RectangleF rnew                 = new RectangleF(r.X, r.Y + r.Height + node.Margin, 0, 0);
            TableNode tableNode             = diagram1.Factory.CreateTableNode(rnew);
            tableNode.Style                 = TableStyle.Rectangle;
            tableNode.CaptionHeight         = 5;
            tableNode.CaptionFormat.Alignment = StringAlignment.Near;
            tableNode.HandlesStyle          = MindFusion.Diagramming.HandlesStyle.Custom;
            tableNode.Caption               = "<b><u>Prozessschritte:</b></u>";
            tableNode.Font                  = new Font("Arial", (float)3, GraphicsUnit.World);
            tableNode.Brush                 = new MindFusion.Drawing.SolidBrush(Color.White);
            tableNode.CellFrameStyle        = CellFrameStyle.Simple;
            tableNode.EnableStyledText      = true;
            tableNode.TextColor             = Color.Black;
            tableNode.ShadowOffsetX         = 0;
            tableNode.ShadowOffsetY         = 0;
            tableNode.AllowIncomingLinks    = false;
            tableNode.AllowOutgoingLinks    = false;

            #region *** Data
            tableNode.RedimTable(4, 3);
            tableNode.Columns[3].ColumnStyle = MindFusion.Diagramming.ColumnStyle.AutoWidth;
            tableNode[0, 0].Text            = "Name";
            tableNode[1, 0].Text            = "Typ";
            tableNode[2, 0].Text            = "[min]";
            tableNode[3, 0].Text            = "St";
            tableNode[3, 0].TextFormat.Alignment = StringAlignment.Center;

            tableNode[0, 1].Text            = "Schrankgestell Large 1410265DTMT";
            tableNode[1, 1].Text            = "1410265";
            tableNode[2, 1].Text            = "30,00";
            tableNode[3, 1].Image           = new Bitmap("C:\\tls\\TLS.PPT\\trunk\\src\\TLS.PPT.Gui.AppFramework\\Resources\\Images\\green.png");
            tableNode[3, 1].ImageAlign      = MindFusion.Drawing.ImageAlign.Center;

            tableNode[0, 2].Text            = "Netzteil QT-20 3X380-480/24VDC/20A1356387 Puls";
            tableNode[1, 2].Text            = "1356387";
            tableNode[2, 2].Text            = "20,00";
            tableNode[3, 2].Image           = new Bitmap("C:\\tls\\TLS.PPT\\trunk\\src\\TLS.PPT.Gui.AppFramework\\Resources\\Images\\green.png");
            tableNode[3, 2].ImageAlign      = MindFusion.Drawing.ImageAlign.Center;
            #endregion

            tableNode.ResizeToFitText(true, false);

            RectangleF rect = tableNode.Bounds;
            if (rect.Width < 100)
            {
                rect.Width = 100;
            }
            tableNode.Bounds = rect;

            node.Add(tableNode);
 


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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problems when scaling TableNode
Reply #4 - Aug 26th, 2009 at 2:46pm
Print Post  
Hi,

This version fixes the text measure problems:
https://mindfusion.eu/_beta/fcnet532.zip

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


I love YaBB 1G - SP1!

Posts: 17
Joined: Apr 8th, 2009
Re: Problems when scaling TableNode
Reply #5 - Aug 27th, 2009 at 8:31am
Print Post  
Hello and thank you for the short responding time!

I tried the version, the problem I described is solved, but now there is a new one, part of the strings are lost when zooming. The spaces are kept now.
Other thing, perpaps interessing for you: (I know V5.32 is a dev version) the performance of V5.32 is really slow.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problems when scaling TableNode
Reply #6 - Aug 27th, 2009 at 9:14am
Print Post  
Hi,

The original problem happens because fonts do not scale uniformly with the ScaleTransform applied to implement ZoomFactor. GDI+ chooses the nearest font size for which there are glyphs defined in the font file, and when you use styled text, the word positions calculated at 100% zoom must be recalculated at different zoom levels in order to preserve the space sizes. Now this updated version calculates the text layout for all items when you zoom in our out, so perhaps that's why you see some delay. If you do not need styled text, you could just set the tables' EnableStyledText = false and the text will be rendered with a single call to Graphics.DrawString; this should preserve both the text layout and space sizes.

Stoyan
  
Back to top
 
IP Logged
 
caseopeia
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 17
Joined: Apr 8th, 2009
Re: Problems when scaling TableNode
Reply #7 - Aug 27th, 2009 at 10:30am
Print Post  
Hello,

thank you for the description of the problems background!

Setting
Code
Select All
tableNode.EnableStyledText      = false; 


seems to solve my problem.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint