Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Moving text region of the shapenode (Read 6416 times)
Bala
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 156
Joined: Apr 21st, 2009
Moving text region of the shapenode
Feb 22nd, 2012 at 12:17pm
Print Post  
Hi,

Currently we are using below approach to specify text region of the Shapenode,

ShapeNode.Shape = new MindFusion.Diagramming.Wpf.Shape(
                  Shapes.Rectangle.Outline,// reuse the rectangular shape
                  null,// no decorations
                  new ElementTemplate[]// define text region
                     {
                           new LineTemplate(5, 50, 85, 50),
                           new LineTemplate(85,50, 85, 95),
                           new LineTemplate(95, 85, 5, 95),
                           new LineTemplate(5, 95, 5, 50)
                     },
                      FillRule.EvenOdd,// doesn't matter here
                      "textOnTheBelowImage"// to access the shape later using Shape.FromId
                  );

Problem:
We have a requirement to move the text on a button click, say if left button is clicked then node text should now be disaplayed to the left of the node. Similarly for right,top and bottom.

Please let know what are the different ways to achieve this. Considering we may need to apply this operation on 200 nodes at once - which appoach will suit us.

Could you please provide some code lines to achieve this?

Thanks,
Bala

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Moving text region of the shapenode
Reply #1 - Feb 22nd, 2012 at 12:51pm
Print Post  
Hi,

If you need to change the text alignment within this text area, set the TextAlignment and TextVerticalAlignment properties. If you must change the position of the text region, you could define four different shapes with left/right/top/bottom text locations and assign them to the nodes' Shape.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint