Esempio n. 1
0
 void releaseParent_pp() {
   super.releaseParent_pp();
   if (cascade != null) cascade.setMenu(null);
   if ((style & SWT.BAR) != 0 && this == parent.menuBar) {
     parent.setMenuBar(null);
   }
 }
Esempio n. 2
0
 /**
  * Returns <code>true</code> if the receiver is enabled and all of the receiver's ancestors are
  * enabled, and <code>false</code> otherwise. A disabled menu is typically not selectable from the
  * user interface and draws with an inactive or "grayed" look.
  *
  * @return the receiver's enabled state
  * @exception SWTException
  *     <ul>
  *       <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  *       <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
  *     </ul>
  *
  * @see #getEnabled
  */
 public boolean isEnabled() {
   checkWidget();
   Menu parentMenu = getParentMenu();
   if (parentMenu == null) {
     return getEnabled() && parent.isEnabled();
   }
   return getEnabled() && parentMenu.isEnabled();
 }
Esempio n. 3
0
 void releaseWidget_pp() {
   super.releaseWidget_pp();
   if (parent != null) parent.removeMenu(this);
   parent = null;
   cascade = null;
 }
Esempio n. 4
0
 /**
  * Returns the receiver's shell. For all controls other than shells, this simply returns the
  * control's nearest ancestor shell. Shells return themselves, even if they are children of other
  * shells.
  *
  * @return the receiver's shell
  * @exception SWTException
  *     <ul>
  *       <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  *       <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
  *     </ul>
  *
  * @see #getParent
  */
 public Shell getShell() {
   checkWidget();
   return parent.getShell();
 }
Esempio n. 5
0
 void createWidget(int index) {
   checkOrientation(parent);
   super.createWidget(index);
   parent.addMenu(this);
 }