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

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

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

Shell.forceResize介绍

暂无

代码示例

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

  1. @Override
  2. void forceResize () {
  3. GtkAllocation allocation = new GtkAllocation ();
  4. OS.gtk_widget_get_allocation (vboxHandle, allocation);
  5. forceResize (allocation.width, allocation.height);
  6. }

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

  1. @Override
  2. void forceResize () {
  3. GtkAllocation allocation = new GtkAllocation ();
  4. OS.gtk_widget_get_allocation (vboxHandle, allocation);
  5. forceResize (allocation.width, allocation.height);
  6. }

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

  1. @Override
  2. void forceResize () {
  3. GtkAllocation allocation = new GtkAllocation ();
  4. OS.gtk_widget_get_allocation (vboxHandle, allocation);
  5. forceResize (allocation.width, allocation.height);
  6. }

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

  1. void resizeBounds (int width, int height, boolean notify) {
  2. if (redrawWindow != 0) {
  3. OS.gdk_window_resize (redrawWindow, width, height);
  4. }
  5. if (enableWindow != 0) {
  6. OS.gdk_window_resize (enableWindow, width, height);
  7. }
  8. int border = OS.gtk_container_get_border_width (shellHandle);
  9. int boxWidth = width - 2*border;
  10. int boxHeight = height - 2*border;
  11. if (!OS.GTK3 || (style & SWT.RESIZE) == 0) {
  12. OS.gtk_widget_set_size_request (vboxHandle, boxWidth, boxHeight);
  13. }
  14. forceResize (boxWidth, boxHeight);
  15. if (notify) {
  16. resized = true;
  17. sendEvent (SWT.Resize);
  18. if (isDisposed ()) return;
  19. if (layout != null) {
  20. markLayout (false, false);
  21. updateLayout (false);
  22. }
  23. }
  24. }

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

  1. void resizeBounds (int width, int height, boolean notify) {
  2. if (redrawWindow != 0) {
  3. OS.gdk_window_resize (redrawWindow, width, height);
  4. }
  5. if (enableWindow != 0) {
  6. OS.gdk_window_resize (enableWindow, width, height);
  7. }
  8. int border = OS.gtk_container_get_border_width (shellHandle);
  9. int boxWidth = width - 2*border;
  10. int boxHeight = height - 2*border;
  11. if (!OS.GTK3 || (style & SWT.RESIZE) == 0) {
  12. OS.gtk_widget_set_size_request (vboxHandle, boxWidth, boxHeight);
  13. }
  14. forceResize (boxWidth, boxHeight);
  15. if (notify) {
  16. resized = true;
  17. sendEvent (SWT.Resize);
  18. if (isDisposed ()) return;
  19. if (layout != null) {
  20. markLayout (false, false);
  21. updateLayout (false);
  22. }
  23. }
  24. }

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

  1. void resizeBounds (int width, int height, boolean notify) {
  2. if (redrawWindow != 0) {
  3. OS.gdk_window_resize (redrawWindow, width, height);
  4. }
  5. if (enableWindow != 0) {
  6. OS.gdk_window_resize (enableWindow, width, height);
  7. }
  8. int border = OS.gtk_container_get_border_width (shellHandle);
  9. int boxWidth = width - 2*border;
  10. int boxHeight = height - 2*border;
  11. if (!OS.GTK3 || (style & SWT.RESIZE) == 0) {
  12. OS.gtk_widget_set_size_request (vboxHandle, boxWidth, boxHeight);
  13. }
  14. forceResize (boxWidth, boxHeight);
  15. if (notify) {
  16. resized = true;
  17. sendEvent (SWT.Resize);
  18. if (isDisposed ()) return;
  19. if (layout != null) {
  20. markLayout (false, false);
  21. updateLayout (false);
  22. }
  23. }
  24. }

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

  1. @Override
  2. Rectangle computeTrimInPixels (int x, int y, int width, int height) {
  3. checkWidget();
  4. Rectangle trim = super.computeTrimInPixels (x, y, width, height);
  5. int border = 0;
  6. if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.SHELL_TRIM)) == 0) {
  7. border = OS.gtk_container_get_border_width (shellHandle);
  8. }
  9. if (isCustomResize ()) {
  10. border = OS.gtk_container_get_border_width (shellHandle);
  11. }
  12. int trimWidth = trimWidth (), trimHeight = trimHeight ();
  13. trim.x -= (trimWidth / 2) + border;
  14. trim.y -= trimHeight - (trimWidth / 2) + border;
  15. trim.width += trimWidth + border * 2;
  16. trim.height += trimHeight + border * 2;
  17. if (menuBar != null) {
  18. forceResize ();
  19. GtkAllocation allocation = new GtkAllocation ();
  20. OS.gtk_widget_get_allocation (menuBar.handle, allocation);
  21. int menuBarHeight = allocation.height;
  22. trim.y -= menuBarHeight;
  23. trim.height += menuBarHeight;
  24. }
  25. return trim;
  26. }

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

  1. @Override
  2. Rectangle computeTrimInPixels (int x, int y, int width, int height) {
  3. checkWidget();
  4. Rectangle trim = super.computeTrimInPixels (x, y, width, height);
  5. int border = 0;
  6. if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.SHELL_TRIM)) == 0) {
  7. border = OS.gtk_container_get_border_width (shellHandle);
  8. }
  9. if (isCustomResize ()) {
  10. border = OS.gtk_container_get_border_width (shellHandle);
  11. }
  12. int trimWidth = trimWidth (), trimHeight = trimHeight ();
  13. trim.x -= (trimWidth / 2) + border;
  14. trim.y -= trimHeight - (trimWidth / 2) + border;
  15. trim.width += trimWidth + border * 2;
  16. trim.height += trimHeight + border * 2;
  17. if (menuBar != null) {
  18. forceResize ();
  19. GtkAllocation allocation = new GtkAllocation ();
  20. OS.gtk_widget_get_allocation (menuBar.handle, allocation);
  21. int menuBarHeight = allocation.height;
  22. trim.y -= menuBarHeight;
  23. trim.height += menuBarHeight;
  24. }
  25. return trim;
  26. }

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

  1. @Override
  2. Rectangle computeTrimInPixels (int x, int y, int width, int height) {
  3. checkWidget();
  4. Rectangle trim = super.computeTrimInPixels (x, y, width, height);
  5. int border = 0;
  6. if ((style & (SWT.NO_TRIM | SWT.BORDER | SWT.SHELL_TRIM)) == 0) {
  7. border = OS.gtk_container_get_border_width (shellHandle);
  8. }
  9. if (isCustomResize ()) {
  10. border = OS.gtk_container_get_border_width (shellHandle);
  11. }
  12. int trimWidth = trimWidth (), trimHeight = trimHeight ();
  13. trim.x -= (trimWidth / 2) + border;
  14. trim.y -= trimHeight - (trimWidth / 2) + border;
  15. trim.width += trimWidth + border * 2;
  16. trim.height += trimHeight + border * 2;
  17. if (menuBar != null) {
  18. forceResize ();
  19. GtkAllocation allocation = new GtkAllocation ();
  20. OS.gtk_widget_get_allocation (menuBar.handle, allocation);
  21. int menuBarHeight = allocation.height;
  22. trim.y -= menuBarHeight;
  23. trim.height += menuBarHeight;
  24. }
  25. return trim;
  26. }

相关文章

Shell类方法