comparison dwt/widgets/Menu.d @ 259:c0d810de7093

Update SWT 3.4M7 to 3.4
author Frank Benoit <benoit@tionex.de>
date Sun, 29 Jun 2008 14:33:38 +0200
parents 5a30aa9820f3
children
comparison
equal deleted inserted replaced
257:cc1d3de0e80b 259:c0d810de7093
1 /******************************************************************************* 1 /*******************************************************************************
2 * Copyright (c) 2000, 2007 IBM Corporation and others. 2 * Copyright (c) 2000, 2008 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials 3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0 4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at 5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html 6 * http://www.eclipse.org/legal/epl-v10.html
7 * 7 *
42 * Note: Only one of BAR, DROP_DOWN and POP_UP may be specified. 42 * Note: Only one of BAR, DROP_DOWN and POP_UP may be specified.
43 * Only one of LEFT_TO_RIGHT or RIGHT_TO_LEFT may be specified. 43 * Only one of LEFT_TO_RIGHT or RIGHT_TO_LEFT may be specified.
44 * </p><p> 44 * </p><p>
45 * IMPORTANT: This class is <em>not</em> intended to be subclassed. 45 * IMPORTANT: This class is <em>not</em> intended to be subclassed.
46 * </p> 46 * </p>
47 *
48 * @see <a href="http://www.eclipse.org/swt/snippets/#menu">Menu snippets</a>
49 * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: ControlExample</a>
50 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
47 */ 51 */
48 public class Menu : Widget { 52 public class Menu : Widget {
49 int x, y; 53 int x, y;
50 bool hasLocation; 54 bool hasLocation;
51 MenuItem cascade, selectedItem; 55 MenuItem cascade, selectedItem;
57 61
58 /** 62 /**
59 * Constructs a new instance of this class given its parent, 63 * Constructs a new instance of this class given its parent,
60 * and sets the style for the instance so that the instance 64 * and sets the style for the instance so that the instance
61 * will be a popup menu on the given parent's shell. 65 * will be a popup menu on the given parent's shell.
66 * <p>
67 * After constructing a menu, it can be set into its parent
68 * using <code>parent.setMenu(menu)</code>. In this case, the parent may
69 * be any control in the same widget tree as the parent.
70 * </p>
62 * 71 *
63 * @param parent a control which will be the parent of the new instance (cannot be null) 72 * @param parent a control which will be the parent of the new instance (cannot be null)
64 * 73 *
65 * @exception IllegalArgumentException <ul> 74 * @exception IllegalArgumentException <ul>
66 * <li>ERROR_NULL_ARGUMENT - if the parent is null</li> 75 * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
88 * class, or must be built by <em>bitwise OR</em>'ing together 97 * class, or must be built by <em>bitwise OR</em>'ing together
89 * (that is, using the <code>int</code> "|" operator) two or more 98 * (that is, using the <code>int</code> "|" operator) two or more
90 * of those <code>DWT</code> style constants. The class description 99 * of those <code>DWT</code> style constants. The class description
91 * lists the style constants that are applicable to the class. 100 * lists the style constants that are applicable to the class.
92 * Style bits are also inherited from superclasses. 101 * Style bits are also inherited from superclasses.
102 * </p><p>
103 * After constructing a menu or menuBar, it can be set into its parent
104 * using <code>parent.setMenu(menu)</code> or <code>parent.setMenuBar(menuBar)</code>.
93 * </p> 105 * </p>
94 * 106 *
95 * @param parent a decorations control which will be the parent of the new instance (cannot be null) 107 * @param parent a decorations control which will be the parent of the new instance (cannot be null)
96 * @param style the style of menu to construct 108 * @param style the style of menu to construct
97 * 109 *
118 /** 130 /**
119 * Constructs a new instance of this class given its parent 131 * Constructs a new instance of this class given its parent
120 * (which must be a <code>Menu</code>) and sets the style 132 * (which must be a <code>Menu</code>) and sets the style
121 * for the instance so that the instance will be a drop-down 133 * for the instance so that the instance will be a drop-down
122 * menu on the given parent's parent. 134 * menu on the given parent's parent.
135 * <p>
136 * After constructing a drop-down menu, it can be set into its parentMenu
137 * using <code>parentMenu.setMenu(menu)</code>.
138 * </p>
123 * 139 *
124 * @param parentMenu a menu which will be the parent of the new instance (cannot be null) 140 * @param parentMenu a menu which will be the parent of the new instance (cannot be null)
125 * 141 *
126 * @exception IllegalArgumentException <ul> 142 * @exception IllegalArgumentException <ul>
127 * <li>ERROR_NULL_ARGUMENT - if the parent is null</li> 143 * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
142 /** 158 /**
143 * Constructs a new instance of this class given its parent 159 * Constructs a new instance of this class given its parent
144 * (which must be a <code>MenuItem</code>) and sets the style 160 * (which must be a <code>MenuItem</code>) and sets the style
145 * for the instance so that the instance will be a drop-down 161 * for the instance so that the instance will be a drop-down
146 * menu on the given parent's parent menu. 162 * menu on the given parent's parent menu.
163 * <p>
164 * After constructing a drop-down menu, it can be set into its parentItem
165 * using <code>parentItem.setMenu(menu)</code>.
166 * </p>
147 * 167 *
148 * @param parentItem a menu item which will be the parent of the new instance (cannot be null) 168 * @param parentItem a menu item which will be the parent of the new instance (cannot be null)
149 * 169 *
150 * @exception IllegalArgumentException <ul> 170 * @exception IllegalArgumentException <ul>
151 * <li>ERROR_NULL_ARGUMENT - if the parent is null</li> 171 * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>