Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic ShapeNode - displaced text (Read 4107 times)
dku
YaBB Newbies
*
Offline



Posts: 41
Joined: Jun 5th, 2008
ShapeNode - displaced text
Jun 12th, 2008 at 4:33pm
Print Post  
Hello,

I saw the topic about texts, but it is mentioning for additional text.

Is that the same for the text or does it give a way to put it above or below the node ? (centered with a max width and such things ...).

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ShapeNode - displaced text
Reply #1 - Jun 13th, 2008 at 5:11am
Print Post  
Hi,

You could create a new shape definition whose TextArea is below the Outline. For example

Code
Select All
using Shape = MindFusion.Diagramming.Wpf.Shape;
...
ElementTemplate[] textArea = new ElementTemplate[]
{
	new LineTemplate(-50, 100, 150, 100),
	new LineTemplate(150, 100, 150, 150),
	new LineTemplate(150, 150, -50, 150),
	new LineTemplate(-50, 150, -50, 100)
};

Shape textBelow = new Shape(
	Shapes.Rectangle.Outline, // copy the Rectangle outline definition
	null, // no decorations
	textArea,
	FillRule.Nonzero,
	"TextBelow");

ShapeNode node = new ShapeNode(diagram);
node.Shape = textBelow;
node.Text = "put it above or below the node";
diagram.Nodes.Add(node);
 



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



Posts: 41
Joined: Jun 5th, 2008
Re: ShapeNode - displaced text
Reply #2 - Jun 13th, 2008 at 8:48am
Print Post  
Thanks,
Works fine.
Didier
  
Back to top
 
IP Logged
 
dku
YaBB Newbies
*
Offline



Posts: 41
Joined: Jun 5th, 2008
Re: ShapeNode - displaced text
Reply #3 - Jun 13th, 2008 at 3:20pm
Print Post  
Hello,

If I've good understood, you define the the text area relative to the 'main' area.

Does it give a way to :
- Define the width or height in absolute ?
- Is it possible to choose where the text is aligned in the text area ?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ShapeNode - displaced text
Reply #4 - Jun 15th, 2008 at 10:21am
Print Post  
Hi,

Yes, the text area is defined as percents of the main area. At this time it is not possible to define it in absolute units, but you could create a second fixed-size node and call AttachTo to use it as a label for the main node. Text alignment is set through the TextFormat property.

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



Posts: 41
Joined: Jun 5th, 2008
Re: ShapeNode - displaced text
Reply #5 - Jun 16th, 2008 at 7:14am
Print Post  
Ok, thanks.

Didier
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint