Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic TableNode disobeying cell TextFormat rules (Read 2935 times)
consolejoker
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 74
Joined: Dec 17th, 2007
TableNode disobeying cell TextFormat rules
Dec 29th, 2007 at 4:17am
Print Post  
I have a 2 column table node. I have set the 2nd column to have a string that is longer than fits in the cell.

By default it wraps and does an ugly line break. So I did the following:

Code
Select All
		Node[1, 0].TextFormat.FormatFlags = StringFormatFlags.NoWrap;
		Node[1, 0].TextFormat.LineAlignment = StringAlignment.Center;
		Node[1, 0].TextFormat.Alignment = StringAlignment.Near;
		Node[1, 0].TextFormat.Trimming = StringTrimming.EllipsisCharacter; 



I've tried just about every combination and the best I can get it to do is to not break a line, but it ends up being right justified, even when I set it to be aligned to Near.

I've spent about an hour on it so I'm going to move on but hopefully someone can point me in the right direction.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: TableNode disobeying cell TextFormat rules
Reply #1 - Dec 29th, 2007 at 5:50am
Print Post  
Try that with EnableStyledText = false. At this time our text formatting algorithm used with styled text does not support StringTrimming.EllipsisCharacter. However, even with enabled styled text, I could not reproduce the alignment problem - I'm getting left-justified text, and the only difference from the standard .NET formatting is the missing ellipsis. Could you post here the code you are using to set up the table?

Stoyan
  
Back to top
 
IP Logged
 
consolejoker
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 74
Joined: Dec 17th, 2007
Re: TableNode disobeying cell TextFormat rules
Reply #2 - Dec 29th, 2007 at 6:59am
Print Post  
Here's my pretty insane code, which is a hack of many different experiments so who knows what damage I may have done Smiley

Code
Select All
    

« Last Edit: Dec 29th, 2007 at 3:45pm by consolejoker »  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: TableNode disobeying cell TextFormat rules
Reply #3 - Dec 29th, 2007 at 7:16am
Print Post  
I've tried this with your code, and the text in the second column is still left justified. Some TableNode property values are initialized from the Diagram's properties when you use that constructor, so could you also post your Diagram initialization code? Smiley

Stoyan
« Last Edit: Dec 29th, 2007 at 7:15pm by Stoyo »  
Back to top
 
IP Logged
 
consolejoker
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 74
Joined: Dec 17th, 2007
Re: TableNode disobeying cell TextFormat rules
Reply #4 - Dec 29th, 2007 at 8:03am
Print Post  
OK nevermind that stuff I just posted. I figured it out.

Get this, I was giving the *caption* 10 blank character spaces preceeding the actual caption text because I could not get the darn thing to be in the center of the caption bar, so I had to force it with blank space.

That apparently was messing up the table rendering so I guess this is a bug because it shouldn't affect it.

Removing the blank space fixed it, but now my caption is far left justified. Even setting the caption format to Far does not affect it, its still full flush left as far as can be and underneath my icon.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: TableNode disobeying cell TextFormat rules
Reply #5 - Dec 29th, 2007 at 9:45am
Print Post  
This worked fine in my test:

tableNode.Caption = "Centered";
tableNode.CaptionFormat.Alignment = StringAlignment.Center;

There is a

tableNode.CaptionFormat.Alignment = StringAlignment.Near;

assignment further down in your code. Perhaps it overrides the alignment if you add the Center assignment just after setting the caption (as had happened in my case before removing it)?

Stoyan
  
Back to top
 
IP Logged
 
consolejoker
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 74
Joined: Dec 17th, 2007
Re: TableNode disobeying cell TextFormat rules
Reply #6 - Dec 29th, 2007 at 4:10pm
Print Post  
Thanks, yes my stupid code was the problem.

So basically the recap for anyone following along is that extra blank text in the caption may cause wrapping issues for the cells of the table.

This is not a problem now since I now properly have used the caption format property and removed the redundant assignment.

Thanks Stoyan for all your help these last few days. I am starting to see how the API works and it is quite powerful and fast!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint