Bug with tool tips on menu items [message #1842917] |
Tue, 06 July 2021 08:53 |
Stanislav Tartakowski Messages: 5 Registered: October 2015 |
Junior Member |
|
|
I have several menuContribution elements for a menu in my plugin.xml. Some of them are not visible at runtime due to visibleWhen condition, which is not evaluated to true. So the list of items in the menu is filtered at runtime. All menuContribution declare toolTip attribute.
Problem is: MenuItem has the field "index" which holds an integer which describes its position in the unfiltered Menu. Now, when hovering the mouse over a menu item, the method
org.eclipse.swt.widgets.Menu.wmTimer(long, long)
is called by eclipse and returns too early on some menu items, because the call
boolean success = OS.GetMenuItemRect (0, selectedMenuItem.parent.handle, selectedMenuItem.index, rect);
is called with a wrong selectedMenuItem.index value (its unfiltered and thus wrong)
Tooltip is only shown if this call succeeds.
When the menu is filetered through visibleWhen conditions, the menu must recompute the indexes of its menu items, else tooltips are not working.
I solved it by setting correct index via reflection but that's kind of a messy hack.
[Updated on: Tue, 06 July 2021 08:56] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03306 seconds