Dynamic tooltips on shapes


https://www.nevron.com/Forum/Topic8533.aspx
Print Topic | Close Window

By Andrew Shand - 10 Years Ago
Hi,

I see how to add a tooltip to a shape. Is there any way to create a dynamic tooltip - either getting a callback when the tooltip is about to be displayed, or overriding the getter for the tooltip - so that the text can be changed before being displayed?

Thanks
Andy

By Nevron Support - 10 Years Ago
Hi,

You can subscribe for the MouseMove event of the event sink service and request an arbitrary tooltip for the shape - like this.

...
document.EventSinkService.NodeMouseMove += new NodeMouseEventHandler(EventSinkService_NodeMouseMove);
...
void EventSinkService_NodeMouseMove(NNodeMouseEventArgs args)
{
// TODO: Get custom tooltip for the hit node.
INNode diagramNode = args.HitNode;
view.InteractivityManager.RequestTooltip("Custom Tooltip");
}
By Andrew Shand - 10 Years Ago
Thanks. I've tried subscribing to the NodeMouseMove event on the EventSinkService, but it doesn't seem to fire. The NodeSelected and NodeDeselected events do fire however.

So, I tried subscribing to MouseMove on each shape that I've created. This does fire. However, calling InteractivityManager.RequestTooltip() doesn't seem to have any effect? Is there something else I need to do to then display the tooltip?

Regards
Andy
By Andrew Shand - 10 Years Ago
I'm having no joy getting InteractivityManager.RequestTooltip to work? Can anyone shed any light - the documentation is less than helpful...

Andy