.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Which button is showing it's tooltip?

1 REPLY 1
SOLVED
Reply
Message 1 of 2
Anonymous
510 Views, 1 Reply

Which button is showing it's tooltip?

Hi!

 

I have successfully created a procedure to hook F1 keypresses when a tooltip for a ribbon item is displayed, allowing me to go to a URL with our help texts. To find the URL in a .NET programmatically created ribbon, I use HelpTopic. Every time a tooltip opens, I set a global variable currentTooltip which holds this HelpTopic value.

 

private static void ComponentManager_ToolTipOpened(object sender, EventArgs e)
{
  Autodesk.Internal.Windows.ToolTip tt = sender as Autodesk.Internal.Windows.ToolTip;
  if (tt == null)
    return;
  Autodesk.Windows.RibbonToolTip rtt = tt.Content as Autodesk.Windows.RibbonToolTip;
  currentTooltip = (rtt == null ? null : rtt.HelpTopic);
}

 

The problem is with ribbons defined with cui and stored in cuix files. The above function gets rtt == null. So for a cuix ribbon item, it seems the tooltip is not really a Autodesk.Windows.RibbonToolTip. And it seems that although tt (Autodesk.Internal.Windows.ToolTip) is not null, none of the properties have any value! I have tried writing tt.Name, tt.Content, tt.Uid, but they are all empty.

 

How can I find out which ribbon item triggered this tooltip, so I can map it to a URL? I do _not_ want to rewrite all the cuix definitions, but create a mapping "outside" of this.

 

Is there maybe an easy way to find out which ribbon item is currently under the cursor?

 

Thanks for any help!

1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

And as often before: right after asking, you find the answer yourself!

 

In ToolTipOpened, I can use:

 

Autodesk.Windows.RibbonItem ri = (e as Autodesk.Windows.RibbonItemToolTipEventArgs).Item;

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost