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

x33g5p2x  于2022-01-24 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(119)

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

暂无

代码示例

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

void setLocationInPixels (Point location) {
  checkWidget();
  if (location == null) error (SWT.ERROR_NULL_ARGUMENT);
  setLocationInPixels (location.x, location.y);
}

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

void setLocationInPixels (Point location) {
  checkWidget();
  if (location == null) error (SWT.ERROR_NULL_ARGUMENT);
  setLocationInPixels (location.x, location.y);
}

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

void setLocationInPixels (Point location) {
  checkWidget();
  if (location == null) error (SWT.ERROR_NULL_ARGUMENT);
  setLocationInPixels (location.x, location.y);
}

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

/**
 * Sets the location of the receiver, which must be a popup,
 * to the point specified by the argument which is relative
 * to the display.
 * <p>
 * Note that this is different from most widgets where the
 * location of the widget is relative to the parent.
 * </p><p>
 * Note that the platform window manager ultimately has control
 * over the location of popup menus.
 * </p>
 *
 * @param location the new location for the receiver
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_NULL_ARGUMENT - if the point is null</li>
 * </ul>
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 *
 * @since 2.1
 */
public void setLocation (Point location) {
  checkWidget ();
  setLocationInPixels (DPIUtil.autoScaleUp (location));
}

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

/**
 * Sets the location of the receiver, which must be a popup,
 * to the point specified by the argument which is relative
 * to the display.
 * <p>
 * Note that this is different from most widgets where the
 * location of the widget is relative to the parent.
 * </p><p>
 * Note that the platform window manager ultimately has control
 * over the location of popup menus.
 * </p>
 *
 * @param location the new location for the receiver
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_NULL_ARGUMENT - if the point is null</li>
 * </ul>
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 *
 * @since 2.1
 */
public void setLocation (Point location) {
  checkWidget ();
  setLocationInPixels (DPIUtil.autoScaleUp (location));
}

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

/**
 * Sets the location of the receiver, which must be a popup,
 * to the point specified by the argument which is relative
 * to the display.
 * <p>
 * Note that this is different from most widgets where the
 * location of the widget is relative to the parent.
 * </p><p>
 * Note that the platform window manager ultimately has control
 * over the location of popup menus.
 * </p>
 *
 * @param location the new location for the receiver
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_NULL_ARGUMENT - if the point is null</li>
 * </ul>
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 *
 * @since 2.1
 */
public void setLocation (Point location) {
  checkWidget ();
  setLocationInPixels (DPIUtil.autoScaleUp (location));
}

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

/**
 * Sets the location of the receiver, which must be a popup,
 * to the point specified by the arguments which are relative
 * to the display.
 * <p>
 * Note that this is different from most widgets where the
 * location of the widget is relative to the parent.
 * </p><p>
 * Note that the platform window manager ultimately has control
 * over the location of popup menus.
 * </p>
 *
 * @param x the new x coordinate for the receiver
 * @param y the new y coordinate for the receiver
 *
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 */
public void setLocation (int x, int y) {
  checkWidget ();
  setLocationInPixels(DPIUtil.autoScaleUp(x), DPIUtil.autoScaleUp(y));
}

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

if (location == null) error (SWT.ERROR_NULL_ARGUMENT);
location = DPIUtil.autoScaleUp(location);
setLocationInPixels(location.x, location.y);

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

boolean showMenu (int x, int y, int detail) {
  Event event = new Event ();
  Rectangle eventRect = new Rectangle (x, y, 0, 0);
  event.setBounds (DPIUtil.autoScaleDown (eventRect));
  event.detail = detail;
  sendEvent (SWT.MenuDetect, event);
  //widget could be disposed at this point
  if (isDisposed ()) return false;
  if (event.doit) {
    if (menu != null && !menu.isDisposed ()) {
      boolean hooksKeys = hooks (SWT.KeyDown) || hooks (SWT.KeyUp);
      menu.createIMMenu (hooksKeys ? imHandle() : 0);
      Rectangle rect = DPIUtil.autoScaleUp (event.getBounds ());
      if (rect.x != x || rect.y != y) {
        menu.setLocationInPixels (rect.x, rect.y);
      }
      menu.setVisible (true);
      return true;
    }
  }
  return false;
}

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

boolean showMenu (int x, int y, int detail) {
  Event event = new Event ();
  Rectangle eventRect = new Rectangle (x, y, 0, 0);
  event.setBounds (DPIUtil.autoScaleDown (eventRect));
  event.detail = detail;
  sendEvent (SWT.MenuDetect, event);
  //widget could be disposed at this point
  if (isDisposed ()) return false;
  if (event.doit) {
    if (menu != null && !menu.isDisposed ()) {
      boolean hooksKeys = hooks (SWT.KeyDown) || hooks (SWT.KeyUp);
      menu.createIMMenu (hooksKeys ? imHandle() : 0);
      Rectangle rect = DPIUtil.autoScaleUp (event.getBounds ());
      if (rect.x != x || rect.y != y) {
        menu.setLocationInPixels (rect.x, rect.y);
      }
      menu.setVisible (true);
      return true;
    }
  }
  return false;
}

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

boolean showMenu (int x, int y, int detail) {
  Event event = new Event ();
  Rectangle eventRect = new Rectangle (x, y, 0, 0);
  event.setBounds (DPIUtil.autoScaleDown (eventRect));
  event.detail = detail;
  sendEvent (SWT.MenuDetect, event);
  //widget could be disposed at this point
  if (isDisposed ()) return false;
  if (event.doit) {
    if (menu != null && !menu.isDisposed ()) {
      boolean hooksKeys = hooks (SWT.KeyDown) || hooks (SWT.KeyUp);
      menu.createIMMenu (hooksKeys ? imHandle() : 0);
      Rectangle rect = DPIUtil.autoScaleUp (event.getBounds ());
      if (rect.x != x || rect.y != y) {
        menu.setLocationInPixels (rect.x, rect.y);
      }
      menu.setVisible (true);
      return true;
    }
  }
  return false;
}

相关文章