Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to implement editable tooltip on a node? (Read 2157 times)
Homam
Junior Member
**
Offline


I Love MindFusion!

Posts: 67
Joined: Feb 7th, 2012
How to implement editable tooltip on a node?
Oct 3rd, 2012 at 12:23pm
Print Post  
I'd like to show an advanced tool-tip similar to the one that MS. Excel could add on a cell. It should be editable within the same box and shows when the mouse is over the node.
It's only about UI since I'm saving the content in database.
Could you please guide me with the best solution or steps I should follow?

« Last Edit: Oct 4th, 2012 at 6:03am by Homam »  

0012.png (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to implement editable tooltip on a node?
Reply #1 - Oct 4th, 2012 at 6:56am
Print Post  
You could disable DiagramView.ShowToolTips to stop using the standard tooltips, and display a separate text control over the view as a tooltip when the mouse hovers over a node. Alternatively, you might create a ShapeNode displaying the tooltip text, which will also let you draw an arrow from the tooltip to the node as in the Excel screenshot:

Code
Select All
private ShapeNode ttipNode;

private void diagram_NodePointed(object sender, NodeEventArgs e)
{
	if (ttipNode != null)
		diagram.Nodes.Remove(ttipNode);

	RectangleF r = e.Node.Bounds;
	r.X += r.Width + 5;
	r.Y -= 10;
	ttipNode = diagram.Factory.CreateShapeNode(r);
	ttipNode.Text = e.Node.ToolTip;

	DiagramLink link = diagram.Factory.CreateDiagramLink(ttipNode, e.Node);
	link.AutoRoute = false;
	link.Shape = LinkShape.Polyline;
} 



With whatever approach you take, you will also have to hide the tooltip object after a timeout or when the mouse moves, from some timer or mouse event handlers.

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