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

x33g5p2x  于2022-01-18 转载在 其他  
字(8.7k)|赞(0)|评价(0)|浏览(109)

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

Composite.getClientWidth介绍

暂无

代码示例

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

Point getLocationInPixels () {
  checkWidget();
  int /*long*/ topHandle = topHandle ();
  GtkAllocation allocation = new GtkAllocation ();
  OS.gtk_widget_get_allocation (topHandle, allocation);
  int x = allocation.x;
  int y = allocation.y;
  if ((parent.style & SWT.MIRRORED) != 0) {
    int width = (state & ZERO_WIDTH) != 0 ? 0 : allocation.width;
    x = parent.getClientWidth () - width - x;
  }
  return new Point (x, y);
}

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

Point getLocationInPixels () {
  checkWidget();
  int /*long*/ topHandle = topHandle ();
  GtkAllocation allocation = new GtkAllocation ();
  OS.gtk_widget_get_allocation (topHandle, allocation);
  int x = allocation.x;
  int y = allocation.y;
  if ((parent.style & SWT.MIRRORED) != 0) {
    int width = (state & ZERO_WIDTH) != 0 ? 0 : allocation.width;
    x = parent.getClientWidth () - width - x;
  }
  return new Point (x, y);
}

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

Point getLocationInPixels () {
  checkWidget();
  long /*int*/ topHandle = topHandle ();
  GtkAllocation allocation = new GtkAllocation ();
  OS.gtk_widget_get_allocation (topHandle, allocation);
  int x = allocation.x;
  int y = allocation.y;
  if ((parent.style & SWT.MIRRORED) != 0) {
    int width = (state & ZERO_WIDTH) != 0 ? 0 : allocation.width;
    x = parent.getClientWidth () - width - x;
  }
  return new Point (x, y);
}

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

Rectangle getBoundsInPixels () {
  checkWidget();
  int /*long*/ topHandle = topHandle ();
  GtkAllocation allocation = new GtkAllocation ();
  OS.gtk_widget_get_allocation (topHandle, allocation);
  int x = allocation.x;
  int y = allocation.y;
  int width = (state & ZERO_WIDTH) != 0 ? 0 : allocation.width;
  int height = (state & ZERO_HEIGHT) != 0 ? 0 :allocation.height;
  if ((parent.style & SWT.MIRRORED) != 0) x = parent.getClientWidth () - width - x;
  return new Rectangle (x, y, width, height);
}

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

Rectangle getBoundsInPixels () {
  checkWidget();
  long /*int*/ topHandle = topHandle ();
  GtkAllocation allocation = new GtkAllocation ();
  OS.gtk_widget_get_allocation (topHandle, allocation);
  int x = allocation.x;
  int y = allocation.y;
  int width = (state & ZERO_WIDTH) != 0 ? 0 : allocation.width;
  int height = (state & ZERO_HEIGHT) != 0 ? 0 :allocation.height;
  if ((parent.style & SWT.MIRRORED) != 0) x = parent.getClientWidth () - width - x;
  return new Rectangle (x, y, width, height);
}

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

Rectangle getBoundsInPixels () {
  checkWidget();
  int /*long*/ topHandle = topHandle ();
  GtkAllocation allocation = new GtkAllocation ();
  OS.gtk_widget_get_allocation (topHandle, allocation);
  int x = allocation.x;
  int y = allocation.y;
  int width = (state & ZERO_WIDTH) != 0 ? 0 : allocation.width;
  int height = (state & ZERO_HEIGHT) != 0 ? 0 :allocation.height;
  if ((parent.style & SWT.MIRRORED) != 0) x = parent.getClientWidth () - width - x;
  return new Rectangle (x, y, width, height);
}

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

void setInitialBounds () {
  if ((state & ZERO_WIDTH) != 0 && (state & ZERO_HEIGHT) != 0) {
    /*
    * Feature in GTK.  On creation, each widget's allocation is
    * initialized to a position of (-1, -1) until the widget is
    * first sized.  The fix is to set the value to (0, 0) as
    * expected by SWT.
    */
    int /*long*/ topHandle = topHandle ();
    GtkAllocation allocation = new GtkAllocation();
    if ((parent.style & SWT.MIRRORED) != 0) {
      allocation.x = parent.getClientWidth ();
    } else {
      allocation.x = 0;
    }
    allocation.y = 0;
    if (OS.GTK3) {
      OS.gtk_widget_set_visible(topHandle, true);
    }
    OS.gtk_widget_set_allocation(topHandle, allocation);
  } else {
    resizeHandle (1, 1);
    forceResize ();
  }
}

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

void setInitialBounds () {
  if ((state & ZERO_WIDTH) != 0 && (state & ZERO_HEIGHT) != 0) {
    /*
    * Feature in GTK.  On creation, each widget's allocation is
    * initialized to a position of (-1, -1) until the widget is
    * first sized.  The fix is to set the value to (0, 0) as
    * expected by SWT.
    */
    long /*int*/ topHandle = topHandle ();
    GtkAllocation allocation = new GtkAllocation();
    if ((parent.style & SWT.MIRRORED) != 0) {
      allocation.x = parent.getClientWidth ();
    } else {
      allocation.x = 0;
    }
    allocation.y = 0;
    if (OS.GTK3) {
      OS.gtk_widget_set_visible(topHandle, true);
    }
    OS.gtk_widget_set_allocation(topHandle, allocation);
  } else {
    resizeHandle (1, 1);
    forceResize ();
  }
}

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

void setInitialBounds () {
  if ((state & ZERO_WIDTH) != 0 && (state & ZERO_HEIGHT) != 0) {
    /*
    * Feature in GTK.  On creation, each widget's allocation is
    * initialized to a position of (-1, -1) until the widget is
    * first sized.  The fix is to set the value to (0, 0) as
    * expected by SWT.
    */
    int /*long*/ topHandle = topHandle ();
    GtkAllocation allocation = new GtkAllocation();
    if ((parent.style & SWT.MIRRORED) != 0) {
      allocation.x = parent.getClientWidth ();
    } else {
      allocation.x = 0;
    }
    allocation.y = 0;
    if (OS.GTK3) {
      OS.gtk_widget_set_visible(topHandle, true);
    }
    OS.gtk_widget_set_allocation(topHandle, allocation);
  } else {
    resizeHandle (1, 1);
    forceResize ();
  }
}

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

event.detail = SWT.DRAG;
if ((parent.style & SWT.MIRRORED) != 0) event.x = DPIUtil.autoScaleDown (parent.getClientWidth () - width) - event.x;
sendSelectionEvent (SWT.Selection, event, true);
if (isDisposed ()) return 0;
  lastX = rect.x;
  lastY = rect.y;
  if ((parent.style & SWT.MIRRORED) != 0) lastX = parent.getClientWidth () - width - lastX;
  parent.update (true, (style & SWT.SMOOTH) == 0);
  drawBand (lastX, rect.y, width, height);

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

int controlWidth = (child.state & ZERO_WIDTH) != 0 ? 0 : allocation.width;
if (oldWidth > 0) x = oldWidth - controlWidth - x;
int clientWidth = getClientWidth ();
x = clientWidth - controlWidth - x;
if (child.enableWindow != 0) {

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

int controlWidth = (child.state & ZERO_WIDTH) != 0 ? 0 : allocation.width;
if (oldWidth > 0) x = oldWidth - controlWidth - x;
int clientWidth = getClientWidth ();
x = clientWidth - controlWidth - x;
if (child.enableWindow != 0) {

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

int controlWidth = (child.state & ZERO_WIDTH) != 0 ? 0 : allocation.width;
if (oldWidth > 0) x = oldWidth - controlWidth - x;
int clientWidth = getClientWidth ();
x = clientWidth - controlWidth - x;
if (child.enableWindow != 0) {

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

event.setBounds (DPIUtil.autoScaleDown (eventRect));
drawBand (lastX, lastY, width, height);
if ((parent.style & SWT.MIRRORED) != 0) event.x = DPIUtil.autoScaleDown (parent.getClientWidth () - width) - event.x;
sendSelectionEvent (SWT.Selection, event, true);
if (isDisposed ()) return result;

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

event.setBounds (DPIUtil.autoScaleDown (eventRect));
drawBand (lastX, lastY, width, height);
if ((parent.style & SWT.MIRRORED) != 0) event.x = DPIUtil.autoScaleDown (parent.getClientWidth () - width) - event.x;
sendSelectionEvent (SWT.Selection, event, true);
if (isDisposed ()) return result;

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

event.setBounds (DPIUtil.autoScaleDown (eventRect));
drawBand (lastX, lastY, width, height);
if ((parent.style & SWT.MIRRORED) != 0) event.x = DPIUtil.autoScaleDown (parent.getClientWidth () - width) - event.x;
sendSelectionEvent (SWT.Selection, event, true);
if (isDisposed ()) return result;

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

OS.memmove (rect, rectangles [0] + i * GdkRectangle.sizeof, GdkRectangle.sizeof);
event.setBounds (DPIUtil.autoScaleDown (new Rectangle(rect.x, rect.y, rect.width, rect.height)));
if ((style & SWT.MIRRORED) != 0) event.x = DPIUtil.autoScaleDown (getClientWidth ()) - event.width - event.x;
long /*int*/ damageRgn = OS.gdk_region_new ();
OS.gdk_region_union_with_rect (damageRgn, rect);

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

OS.memmove (rect, rectangles [0] + i * GdkRectangle.sizeof, GdkRectangle.sizeof);
event.setBounds (DPIUtil.autoScaleDown (new Rectangle(rect.x, rect.y, rect.width, rect.height)));
if ((style & SWT.MIRRORED) != 0) event.x = DPIUtil.autoScaleDown (getClientWidth ()) - event.width - event.x;
int /*long*/ damageRgn = OS.gdk_region_new ();
OS.gdk_region_union_with_rect (damageRgn, rect);

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

OS.memmove (rect, rectangles [0] + i * GdkRectangle.sizeof, GdkRectangle.sizeof);
event.setBounds (DPIUtil.autoScaleDown (new Rectangle(rect.x, rect.y, rect.width, rect.height)));
if ((style & SWT.MIRRORED) != 0) event.x = DPIUtil.autoScaleDown (getClientWidth ()) - event.width - event.x;
int /*long*/ damageRgn = OS.gdk_region_new ();
OS.gdk_region_union_with_rect (damageRgn, rect);

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

Rectangle rect = rects [i];
int x = rect.x;
if (parent != null && (parent.style & SWT.MIRRORED) != 0) x = parent.getClientWidth () - rect.width - x;
OS.gdk_draw_rectangle (window, gc, 0, x, rect.y, rect.width, rect.height);

相关文章

Composite类方法