2976N/A * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. 2976N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2976N/A * This code is free software; you can redistribute it and/or modify it 2976N/A * under the terms of the GNU General Public License version 2 only, as 2976N/A * published by the Free Software Foundation. Oracle designates this 2976N/A * particular file as subject to the "Classpath" exception as provided 2976N/A * by Oracle in the LICENSE file that accompanied this code. 6983N/A * This code is distributed in the hope that it will be useful, but WITHOUT 2976N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 2976N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 2976N/A * version 2 for more details (a copy is included in the LICENSE file that 6983N/A * You should have received a copy of the GNU General Public License version 6983N/A * 2 along with this work; if not, write to the Free Software Foundation, 6983N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2976N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2976N/A * or visit www.oracle.com if you need additional information or have any 6606N/A /************************************************ 5728N/A ************************************************/ 2976N/A * If mouse button is clicked on item showing submenu 3262N/A * we have to hide its submenu. 5636N/A * This member saves the submenu under cursor 5636N/A /************************************************ 2976N/A ************************************************/ 2976N/A /************************************************ 5636N/A * Implementation of interface methods 2976N/A ************************************************/ * DEPRECATED: Replaced by setEnabled(boolean). * @see java.awt.peer.MenuItemPeer * DEPRECATED: Replaced by setEnabled(boolean). * @see java.awt.peer.MenuItemPeer * addSeparator routines are not used * in peers. Shared code invokes addItem("-") // Get menus from the target. //Fixed 6266513: Incorrect key handling in XAWT popup menu //No item should be selected when showing popup menu //Fix for 6267162: PIT: Popup Menu gets hidden below the screen when opened //near the periphery of the screen, XToolkit /************************************************ * Access to target's fields ************************************************/ //Fix for 6267144: PIT: Popup menu label is not shown, XToolkit //Fix for 6267144: PIT: Popup menu label is not shown, XToolkit //Fix for 6184485: Popup menu is not disabled on XToolkit even when calling setEnabled (false) /************************************************ ************************************************/ //Fix for 6267162: PIT: Popup Menu gets hidden below the screen when opened //near the periphery of the screen, XToolkit * Calculates placement of popup menu window * given origin in global coordinates and * size of menu window. Returns suggested * rectangle for menu window in global coordinates * @param origin the origin point specified in show() * function converted to global coordinates * @param windowSize the desired size of menu's window /************************************************ * Overriden XMenuWindow caption-painting functions * Necessary to fix 6267144: PIT: Popup menu label is not shown, XToolkit ************************************************/ * Returns height of menu window's caption. * Can be overriden for popup menus and tear-off menus * Paints menu window's caption. * Can be overriden for popup menus and tear-off menus. * Default implementation does nothing /************************************************ * Overriden XBaseMenuWindow functions ************************************************/ /************************************************ * Overriden XWindow general-purpose functions ************************************************/ /************************************************ * Overriden XWindow keyboard processing ************************************************/ * In previous version keys were handled in handleKeyPress. * Now we override this function do disable F10 explicit * processing. All processing is done using KeyEvent.