Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to set ContainerNode border? (Read 2773 times)
EricHu
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 4
Joined: Oct 11th, 2013
How to set ContainerNode border?
Oct 11th, 2013 at 11:26am
Print Post  
Three questions about ContainerNode:
1 Can caption text alignment be set?
2 Can caption brush be set separately?
3 How to set border style?
and another question:
Can mouse cursor be set hand when diagram behavior set 'Behavior.DoNothing',because need raise click node or link event.
Expecting your answer.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to set ContainerNode border?
Reply #1 - Oct 11th, 2013 at 12:00pm
Print Post  
1 and 2 are not available out of the box. You could use the onUpdateVisuals custom-draw callback to implement them:

Code
Select All
var Alignment = MindFusion.Diagramming.Alignment;

container.onUpdateVisuals = onUpdateVisuals;

function onUpdateVisuals(node)
{
	node.text.textAlignment = Alignment.Center;

	var captionBar = node.getBounds().clone();
	captionBar.height = node.captionHeight;
	captionBar.brush = "red";
	node.graphicsContainer.content.splice(1, 0, captionBar);
} 



You can use the setStroke and setStrokeThickness functions of DiagramItem to customize the border.

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


I Love MindFusion!

Posts: 4
Joined: Oct 11th, 2013
Re: How to set ContainerNode border?
Reply #2 - Oct 12th, 2013 at 1:35am
Print Post  
It works well,thank you very much.
But i can not find 'onUpdateVisuals ' in Online Documentation.Smiley

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to set ContainerNode border?
Reply #3 - Oct 12th, 2013 at 6:50am
Print Post  
It's a well-guarded secret Smiley I think our developer added it to let someone add extra icons to nodes, and forgot to document it after that. You can find several examples in the ASP.NET MVC and JavaScript forum boards if you are interested in custom-drawing.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint