Bug 39184 - Need to determine height of a Menu.
Summary: Need to determine height of a Menu.
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Steve Northover CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
: 97650 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-06-20 15:27 EDT by Nick Edgar CLA
Modified: 2021-11-04 14:04 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Edgar CLA 2003-06-20 15:27:31 EDT
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().
Comment 1 Greg Roberts CLA 2003-12-04 15:33:26 EST
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.
Comment 2 Steve Northover CLA 2004-05-18 09:16:51 EDT
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 ***
Comment 3 Mike Wilson CLA 2004-08-10 11:05:45 EDT
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. 
Comment 4 Pam Tobias CLA 2007-01-10 17:34:07 EST
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.
Comment 5 Steve Northover CLA 2007-01-11 14:49:57 EST
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?
Comment 6 Steve Northover CLA 2008-06-03 17:34:12 EDT
*** Bug 97650 has been marked as a duplicate of this bug. ***
Comment 7 Nobody - feel free to take it CLA 2008-11-26 09:22:02 EST
Yes, the alignment solution is perfect - actually the menu size is irrelevant in 90% of the cases.
Could you decide on a "target milestone"?
Comment 8 Nobody - feel free to take it CLA 2009-10-23 19:20:36 EDT
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?
Comment 9 Eclipse Webmaster CLA 2019-09-06 16:13:34 EDT
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.
Comment 10 Eclipse Genie CLA 2021-11-04 14:04:46 EDT
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.