org.eclipse.swt.widgets.MenuItem.selectRadio()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(129)

本文整理了Java中org.eclipse.swt.widgets.MenuItem.selectRadio()方法的一些代码示例,展示了MenuItem.selectRadio()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MenuItem.selectRadio()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.MenuItem
类名称:MenuItem
方法名:selectRadio

暂无

代码示例

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

@Override
long /*int*/ gtk_activate (long /*int*/ widget) {
  if ((style & SWT.CASCADE) != 0 && menu != null) return 0;
  /*
  * Bug in GTK.  When an ancestor menu is disabled and
  * the user types an accelerator key, GTK delivers the
  * the activate signal even though the menu item cannot
  * be invoked using the mouse.  The fix is to ignore
  * activate signals when an ancestor menu is disabled.
  */
  if (!isEnabled ()) return 0;
  if ((style & SWT.RADIO) != 0) {
    if ((parent.getStyle () & SWT.NO_RADIO_GROUP) == 0) {
      selectRadio ();
    }
  }
  sendSelectionEvent (SWT.Selection);
  return 0;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

@Override
int /*long*/ gtk_activate (int /*long*/ widget) {
  if ((style & SWT.CASCADE) != 0 && menu != null) return 0;
  /*
  * Bug in GTK.  When an ancestor menu is disabled and
  * the user types an accelerator key, GTK delivers the
  * the activate signal even though the menu item cannot
  * be invoked using the mouse.  The fix is to ignore
  * activate signals when an ancestor menu is disabled.
  */
  if (!isEnabled ()) return 0;
  if ((style & SWT.RADIO) != 0) {
    if ((parent.getStyle () & SWT.NO_RADIO_GROUP) == 0) {
      selectRadio ();
    }
  }
  sendSelectionEvent (SWT.Selection);
  return 0;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

@Override
int /*long*/ gtk_activate (int /*long*/ widget) {
  if ((style & SWT.CASCADE) != 0 && menu != null) return 0;
  /*
  * Bug in GTK.  When an ancestor menu is disabled and
  * the user types an accelerator key, GTK delivers the
  * the activate signal even though the menu item cannot
  * be invoked using the mouse.  The fix is to ignore
  * activate signals when an ancestor menu is disabled.
  */
  if (!isEnabled ()) return 0;
  if ((style & SWT.RADIO) != 0) {
    if ((parent.getStyle () & SWT.NO_RADIO_GROUP) == 0) {
      selectRadio ();
    }
  }
  sendSelectionEvent (SWT.Selection);
  return 0;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

LRESULT wmCommandChild (int /*long*/ wParam, int /*long*/ lParam) {
  if ((style & SWT.CHECK) != 0) {
    setSelection (!getSelection ());
  } else {
    if ((style & SWT.RADIO) != 0) {
      if ((parent.getStyle () & SWT.NO_RADIO_GROUP) != 0) {
        setSelection (!getSelection ());
      } else {
        selectRadio ();
      }
    }
  }
  sendSelectionEvent (SWT.Selection);
  return null;
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

void sendSelection () {
  if ((style & SWT.CHECK) != 0) {
    setSelection (!getSelection ());
  } else {
    if ((style & SWT.RADIO) != 0) {
      if ((parent.getStyle () & SWT.NO_RADIO_GROUP) != 0) {
        setSelection (!getSelection ());
      } else {
        selectRadio ();
      }
    }
  }

  Event event = new Event ();
  sendSelectionEvent (SWT.Selection, event, nsItemAction != 0);
  // Widget may be disposed at this point
  if (isDisposed()) return;
  if (nsItemAction != 0) {
    if (event.doit) {
      NSApplication app = NSApplication.sharedApplication();
      app.sendAction(nsItemAction, nsItemTarget, app);
    }
  }
}

相关文章