Nevron Forum

Dynamic tooltips on shapes

https://www.nevron.com/Forum/Topic8533.aspx

By Andrew Shand - Monday, April 7, 2014

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 - Monday, April 7, 2014

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 - Monday, April 7, 2014

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 - Thursday, April 24, 2014

I'm having no joy getting InteractivityManager.RequestTooltip to work? Can anyone shed any light - the documentation is less than helpful...

Andy