Community
Participate
Working Groups
build I20030618 The UI team has received a question on how to position a context menu so that it does not obscure a control that is located at the bottom of the window. Positioning of the menu can be achieved using the new MenuDetect event, however there is no way to determine the height of a Menu. They require methods like Menu.getSize() and/or Menu.getBounds(). There also seems to be no getLocation() to match up with setLocation().
We are also encountering problems with not being able to determine the height of a Menu or getting its bounds. This is information that we need to be able to get from a Menu to place it how we want to.
It won't happen for 3.0 because we are API frozen (unless mountains are moved with the PMC). Sorry about that. *** This bug has been marked as a duplicate of 38436 ***
The underlying window systems typically can not provide size information until after the menu has been popped up. They do however support the notion of "alignment" (e.g. pop up above, below, or centered on a point). If SWT provided access to this alignment capability, then it could be used to solve the problem identified by the original poster. Fixing this would require a new setAlignment() method on Menu (and supporting SWT.UP, SWT.CENTER, SWT.DOWN styles?), meaning that this would probably be done for R3.1. This bug is not a duplicate of 38436.
There's been no activity on this bug for more than 2 years. Can we get this on the list of things to be addressed for 3.3? The bug is showing up in our product.
McQ is right. Determining the height of a menu is most likely not what you want. Even if all the platforms could be convinced to give up the height, when items are added dynamically before a menu is shown, the height will change. Also, bug 38436 documents the fact that we can't get this information on the Mac anyways (yes, it does say it somewhere if you can ignore all the arguing with Tom). Are you after menu alignment instead?
*** Bug 97650 has been marked as a duplicate of this bug. ***
Yes, the alignment solution is perfect - actually the menu size is irrelevant in 90% of the cases. Could you decide on a "target milestone"?
Well, you have a perfect workaround (i.e. setting the menu alignment) that is readily implementable in Eclipse 3.6. Perhaps the number of votes or the venerable age of such a well bred bug are discouraging?
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.