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

x33g5p2x  于2022-01-29 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(147)

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

Shell.getSizeInPixels介绍

暂无

代码示例

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

void setMinimumSizeInPixels (int width, int height) {
  int widthLimit = 0, heightLimit = 0;
  int trim = SWT.TITLE | SWT.CLOSE | SWT.MIN | SWT.MAX;
  if ((style & SWT.NO_TRIM) == 0 && (style & trim) != 0) {
    widthLimit = OS.GetSystemMetrics (OS.SM_CXMINTRACK);
    if ((style & SWT.RESIZE) != 0) {
      heightLimit = OS.GetSystemMetrics (OS.SM_CYMINTRACK);
    } else {
      RECT rect = new RECT ();
      int bits1 = OS.GetWindowLong (handle, OS.GWL_STYLE);
      int bits2 = OS.GetWindowLong (handle, OS.GWL_EXSTYLE);
      OS.AdjustWindowRectEx (rect, bits1, false, bits2);
      heightLimit = rect.bottom - rect.top;
    }
  }
  minWidth = Math.max (widthLimit, width);
  minHeight = Math.max (heightLimit, height);
  Point size = getSizeInPixels ();
  int newWidth = Math.max (size.x, minWidth);
  int newHeight = Math.max (size.y, minHeight);
  if (minWidth <= widthLimit) minWidth = SWT.DEFAULT;
  if (minHeight <= heightLimit) minHeight = SWT.DEFAULT;
  if (newWidth != size.x || newHeight != size.y) setSizeInPixels (newWidth, newHeight);
}

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

Point size = getSizeInPixels ();
oldWidth = size.x - trimWidth ();
oldHeight = size.y - trimHeight ();

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

Point size = getSizeInPixels ();
oldWidth = size.x - trimWidth ();
oldHeight = size.y - trimHeight ();

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

Point size = getSizeInPixels ();
oldWidth = size.x - trimWidth ();
oldHeight = size.y - trimHeight ();

相关文章

微信公众号

最新文章

更多

Shell类方法