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

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

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

Shell.trimWidth介绍

暂无

代码示例

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

Point getMinimumSizeInPixels () {
  checkWidget ();
  int width = Math.max (1, minWidth + trimWidth ());
  int height = Math.max (1, minHeight + trimHeight ());
  return new Point (width, height);
}

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

Point getMinimumSizeInPixels () {
  checkWidget ();
  int width = Math.max (1, minWidth + trimWidth ());
  int height = Math.max (1, minHeight + trimHeight ());
  return new Point (width, height);
}

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

Point getMinimumSizeInPixels () {
  checkWidget ();
  int width = Math.max (1, minWidth + trimWidth ());
  int height = Math.max (1, minHeight + trimHeight ());
  return new Point (width, height);
}

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

void setMinimumSizeInPixels (int width, int height) {
  checkWidget ();
  GdkGeometry geometry = new GdkGeometry ();
  minWidth = geometry.min_width = Math.max (width, trimWidth ()) - trimWidth ();
  minHeight = geometry.min_height = Math.max (height, trimHeight ()) - trimHeight ();
  OS.gtk_window_set_geometry_hints (shellHandle, 0, geometry, OS.GDK_HINT_MIN_SIZE);
}

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

void setMinimumSizeInPixels (int width, int height) {
  checkWidget ();
  GdkGeometry geometry = new GdkGeometry ();
  minWidth = geometry.min_width = Math.max (width, trimWidth ()) - trimWidth ();
  minHeight = geometry.min_height = Math.max (height, trimHeight ()) - trimHeight ();
  OS.gtk_window_set_geometry_hints (shellHandle, 0, geometry, OS.GDK_HINT_MIN_SIZE);
}

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

void setMinimumSizeInPixels (int width, int height) {
  checkWidget ();
  GdkGeometry geometry = new GdkGeometry ();
  minWidth = geometry.min_width = Math.max (width, trimWidth ()) - trimWidth ();
  minHeight = geometry.min_height = Math.max (height, trimHeight ()) - trimHeight ();
  OS.gtk_window_set_geometry_hints (shellHandle, 0, geometry, OS.GDK_HINT_MIN_SIZE);
}

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

@Override
Point getSizeInPixels () {
  checkWidget ();
  GtkAllocation allocation = new GtkAllocation ();
  OS.gtk_widget_get_allocation (vboxHandle, allocation);
  int width = allocation.width;
  int height = allocation.height;
  int border = 0;
  if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.SHELL_TRIM)) == 0) {
    border = OS.gtk_container_get_border_width (shellHandle);
  }
  return new Point (width + trimWidth () + 2*border, height + trimHeight () + 2*border);
}

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

@Override
Point getSizeInPixels () {
  checkWidget ();
  GtkAllocation allocation = new GtkAllocation ();
  OS.gtk_widget_get_allocation (vboxHandle, allocation);
  int width = allocation.width;
  int height = allocation.height;
  int border = 0;
  if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.SHELL_TRIM)) == 0) {
    border = OS.gtk_container_get_border_width (shellHandle);
  }
  return new Point (width + trimWidth () + 2*border, height + trimHeight () + 2*border);
}

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

@Override
Point getSizeInPixels () {
  checkWidget ();
  GtkAllocation allocation = new GtkAllocation ();
  OS.gtk_widget_get_allocation (vboxHandle, allocation);
  int width = allocation.width;
  int height = allocation.height;
  int border = 0;
  if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.SHELL_TRIM)) == 0) {
    border = OS.gtk_container_get_border_width (shellHandle);
  }
  return new Point (width + trimWidth () + 2*border, height + trimHeight () + 2*border);
}

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

width = Math.max (1, Math.max (minWidth, width - trimWidth ()));
height = Math.max (1, Math.max (minHeight, height - trimHeight ()));

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

width = Math.max (1, Math.max (minWidth, width - trimWidth ()));
height = Math.max (1, Math.max (minHeight, height - trimHeight ()));

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

width = Math.max (1, Math.max (minWidth, width - trimWidth ()));
height = Math.max (1, Math.max (minHeight, height - trimHeight ()));

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

@Override
Rectangle getBoundsInPixels () {
  checkWidget ();
  int [] x = new int [1], y = new int [1];
  OS.gtk_window_get_position (shellHandle, x, y);
  GtkAllocation allocation = new GtkAllocation ();
  OS.gtk_widget_get_allocation (vboxHandle, allocation);
  int width = allocation.width;
  int height = allocation.height;
  int border = 0;
  if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.SHELL_TRIM)) == 0) {
    border = OS.gtk_container_get_border_width (shellHandle);
  }
  return new Rectangle (x [0], y [0], width + trimWidth () + 2*border, height + trimHeight () + 2*border);
}

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

@Override
Rectangle getBoundsInPixels () {
  checkWidget ();
  int [] x = new int [1], y = new int [1];
  OS.gtk_window_get_position (shellHandle, x, y);
  GtkAllocation allocation = new GtkAllocation ();
  OS.gtk_widget_get_allocation (vboxHandle, allocation);
  int width = allocation.width;
  int height = allocation.height;
  int border = 0;
  if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.SHELL_TRIM)) == 0) {
    border = OS.gtk_container_get_border_width (shellHandle);
  }
  return new Rectangle (x [0], y [0], width + trimWidth () + 2*border, height + trimHeight () + 2*border);
}

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

@Override
Rectangle getBoundsInPixels () {
  checkWidget ();
  int [] x = new int [1], y = new int [1];
  OS.gtk_window_get_position (shellHandle, x, y);
  GtkAllocation allocation = new GtkAllocation ();
  OS.gtk_widget_get_allocation (vboxHandle, allocation);
  int width = allocation.width;
  int height = allocation.height;
  int border = 0;
  if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.SHELL_TRIM)) == 0) {
    border = OS.gtk_container_get_border_width (shellHandle);
  }
  return new Rectangle (x [0], y [0], width + trimWidth () + 2*border, height + trimHeight () + 2*border);
}

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

@Override
Rectangle computeTrimInPixels (int x, int y, int width, int height) {
  checkWidget();
  Rectangle trim = super.computeTrimInPixels (x, y, width, height);
  int border = 0;
  if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.SHELL_TRIM)) == 0) {
    border = OS.gtk_container_get_border_width (shellHandle);
  }
  if (isCustomResize ()) {
    border = OS.gtk_container_get_border_width (shellHandle);
  }
  int trimWidth = trimWidth (), trimHeight = trimHeight ();
  trim.x -= (trimWidth / 2) + border;
  trim.y -= trimHeight - (trimWidth / 2) + border;
  trim.width += trimWidth + border * 2;
  trim.height += trimHeight + border * 2;
  if (menuBar != null) {
    forceResize ();
    GtkAllocation allocation = new GtkAllocation ();
    OS.gtk_widget_get_allocation (menuBar.handle, allocation);
    int menuBarHeight = allocation.height;
    trim.y -= menuBarHeight;
    trim.height += menuBarHeight;
  }
  return trim;
}

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

@Override
Rectangle computeTrimInPixels (int x, int y, int width, int height) {
  checkWidget();
  Rectangle trim = super.computeTrimInPixels (x, y, width, height);
  int border = 0;
  if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.SHELL_TRIM)) == 0) {
    border = OS.gtk_container_get_border_width (shellHandle);
  }
  if (isCustomResize ()) {
    border = OS.gtk_container_get_border_width (shellHandle);
  }
  int trimWidth = trimWidth (), trimHeight = trimHeight ();
  trim.x -= (trimWidth / 2) + border;
  trim.y -= trimHeight - (trimWidth / 2) + border;
  trim.width += trimWidth + border * 2;
  trim.height += trimHeight + border * 2;
  if (menuBar != null) {
    forceResize ();
    GtkAllocation allocation = new GtkAllocation ();
    OS.gtk_widget_get_allocation (menuBar.handle, allocation);
    int menuBarHeight = allocation.height;
    trim.y -= menuBarHeight;
    trim.height += menuBarHeight;
  }
  return trim;
}

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

@Override
Rectangle computeTrimInPixels (int x, int y, int width, int height) {
  checkWidget();
  Rectangle trim = super.computeTrimInPixels (x, y, width, height);
  int border = 0;
  if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.SHELL_TRIM)) == 0) {
    border = OS.gtk_container_get_border_width (shellHandle);
  }
  if (isCustomResize ()) {
    border = OS.gtk_container_get_border_width (shellHandle);
  }
  int trimWidth = trimWidth (), trimHeight = trimHeight ();
  trim.x -= (trimWidth / 2) + border;
  trim.y -= trimHeight - (trimWidth / 2) + border;
  trim.width += trimWidth + border * 2;
  trim.height += trimHeight + border * 2;
  if (menuBar != null) {
    forceResize ();
    GtkAllocation allocation = new GtkAllocation ();
    OS.gtk_widget_get_allocation (menuBar.handle, allocation);
    int menuBarHeight = allocation.height;
    trim.y -= menuBarHeight;
    trim.height += menuBarHeight;
  }
  return trim;
}

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

resized = true;
Point size = getSizeInPixels ();
oldWidth = size.x - trimWidth ();
oldHeight = size.y - trimHeight ();
sendEvent (SWT.Resize);

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

resized = true;
Point size = getSizeInPixels ();
oldWidth = size.x - trimWidth ();
oldHeight = size.y - trimHeight ();
sendEvent (SWT.Resize);

相关文章

微信公众号

最新文章

更多

Shell类方法