int h= OS.GetMenuHeight(handle); if (h != -1) { int gdevice = OS.DMGetFirstScreenDevice(true); while (gdevice != 0) { int[] ptr = new int[1]; OS.memcpy(ptr, gdevice, 4); GDevice device = new GDevice(); OS.memcpy(device, ptr[0], GDevice.sizeof); Rect rect = new Rect(); OS.GetPixBounds(device.gdPMap, rect); Rectangle r= new Rectangle(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top); if (r.contains(left, top)) { int s= top+h+10 - r.height; if (s > 0) top -= s; } gdevice = OS.DMGetNextScreenDevice(gdevice, true); } }
public void _setVisible (boolean visible) {	if ((style & (SWT.BAR | SWT.DROP_DOWN)) != 0) return;	if (!visible) return;	int left = x, top = y;	if (!hasLocation) {		org.eclipse.swt.internal.carbon.Point where = new org.eclipse.swt.internal.carbon.Point ();		OS.GetGlobalMouse (where);		left = where.h; top = where.v;	}	int index = defaultItem != null ? indexOf (defaultItem) + 1 : lastIndex;	int result = OS.PopUpMenuSelect (handle, (short)top, (short)left, (short)(index));	lastIndex = OS.LoWord (result);}