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

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

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

ToolBar.getClientWidth介绍

暂无

代码示例

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

Rectangle getBoundsInPixels () {
  checkWidget();
  parent.forceResize ();
  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 = allocation.width;
  int height = allocation.height;
  if ((parent.style & SWT.MIRRORED) != 0) x = parent.getClientWidth () - width - x;
  if ((style & SWT.SEPARATOR) != 0 && control != null) height = Math.max (height, 23);
  return new Rectangle (x, y, width, height);
}

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

Rectangle getBoundsInPixels () {
  checkWidget();
  parent.forceResize ();
  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 = allocation.width;
  int height = allocation.height;
  if ((parent.style & SWT.MIRRORED) != 0) x = parent.getClientWidth () - width - x;
  if ((style & SWT.SEPARATOR) != 0 && control != null) height = Math.max (height, 23);
  return new Rectangle (x, y, width, height);
}

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

Rectangle getBoundsInPixels () {
  checkWidget();
  parent.forceResize ();
  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 = allocation.width;
  int height = allocation.height;
  if ((parent.style & SWT.MIRRORED) != 0) x = parent.getClientWidth () - width - x;
  if ((style & SWT.SEPARATOR) != 0 && control != null) height = Math.max (height, 23);
  return new Rectangle (x, y, width, height);
}

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

long /*int*/ menuItemSelected (long /*int*/ widget, ToolItem item) {
  Event event = new Event ();
  switch (item.style) {
    case SWT.DROP_DOWN :
      /*
       * Feature in GTK. The DROP_DOWN item does not
       * contain arrow button in the overflow menu. So, it
       * is impossible to select the menu of that item.
       * The fix is to consider the item selection
       * as Arrow click, in order to popup the drop-down.
       */
      event.detail = SWT.ARROW;
      GtkAllocation allocation = new GtkAllocation ();
      OS.gtk_widget_get_allocation (widget, allocation);
      event.x = DPIUtil.autoScaleDown(allocation.x);
      if ((style & SWT.MIRRORED) != 0) event.x = DPIUtil.autoScaleDown (getClientWidth () - allocation.width) - event.x;
      event.y = DPIUtil.autoScaleDown(allocation.y + allocation.height);
      break;
    case SWT.RADIO :
      if ((style & SWT.NO_RADIO_GROUP) == 0)	item.selectRadio ();
      break;
    case SWT.CHECK :
      boolean currentSelection = item.getSelection();
      item.setSelection (!currentSelection);
  }
  item.sendSelectionEvent  (SWT.Selection, event, false);
  return 0;
}

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

int /*long*/ menuItemSelected (int /*long*/ widget, ToolItem item) {
  Event event = new Event ();
  switch (item.style) {
    case SWT.DROP_DOWN :
      /*
       * Feature in GTK. The DROP_DOWN item does not
       * contain arrow button in the overflow menu. So, it
       * is impossible to select the menu of that item.
       * The fix is to consider the item selection
       * as Arrow click, in order to popup the drop-down.
       */
      event.detail = SWT.ARROW;
      GtkAllocation allocation = new GtkAllocation ();
      OS.gtk_widget_get_allocation (widget, allocation);
      event.x = DPIUtil.autoScaleDown(allocation.x);
      if ((style & SWT.MIRRORED) != 0) event.x = DPIUtil.autoScaleDown (getClientWidth () - allocation.width) - event.x;
      event.y = DPIUtil.autoScaleDown(allocation.y + allocation.height);
      break;
    case SWT.RADIO :
      if ((style & SWT.NO_RADIO_GROUP) == 0)	item.selectRadio ();
      break;
    case SWT.CHECK :
      boolean currentSelection = item.getSelection();
      item.setSelection (!currentSelection);
  }
  item.sendSelectionEvent  (SWT.Selection, event, false);
  return 0;
}

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

int /*long*/ menuItemSelected (int /*long*/ widget, ToolItem item) {
  Event event = new Event ();
  switch (item.style) {
    case SWT.DROP_DOWN :
      /*
       * Feature in GTK. The DROP_DOWN item does not
       * contain arrow button in the overflow menu. So, it
       * is impossible to select the menu of that item.
       * The fix is to consider the item selection
       * as Arrow click, in order to popup the drop-down.
       */
      event.detail = SWT.ARROW;
      GtkAllocation allocation = new GtkAllocation ();
      OS.gtk_widget_get_allocation (widget, allocation);
      event.x = DPIUtil.autoScaleDown(allocation.x);
      if ((style & SWT.MIRRORED) != 0) event.x = DPIUtil.autoScaleDown (getClientWidth () - allocation.width) - event.x;
      event.y = DPIUtil.autoScaleDown(allocation.y + allocation.height);
      break;
    case SWT.RADIO :
      if ((style & SWT.NO_RADIO_GROUP) == 0)	item.selectRadio ();
      break;
    case SWT.CHECK :
      boolean currentSelection = item.getSelection();
      item.setSelection (!currentSelection);
  }
  item.sendSelectionEvent  (SWT.Selection, event, false);
  return 0;
}

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

OS.gtk_widget_get_allocation (topHandle, allocation);
event.x = DPIUtil.autoScaleDown(allocation.x);
if ((style & SWT.MIRRORED) != 0) event.x = DPIUtil.autoScaleDown (parent.getClientWidth ()- allocation.width) - event.x;
event.y = DPIUtil.autoScaleDown(allocation.y + allocation.height);

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

OS.gtk_widget_get_allocation (topHandle, allocation);
event.x = DPIUtil.autoScaleDown(allocation.x);
if ((style & SWT.MIRRORED) != 0) event.x = DPIUtil.autoScaleDown (parent.getClientWidth ()- allocation.width) - event.x;
event.y = DPIUtil.autoScaleDown(allocation.y + allocation.height);

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

OS.gtk_widget_get_allocation (topHandle, allocation);
event.x = DPIUtil.autoScaleDown(allocation.x);
if ((style & SWT.MIRRORED) != 0) event.x = DPIUtil.autoScaleDown (parent.getClientWidth ()- allocation.width) - event.x;
event.y = DPIUtil.autoScaleDown(allocation.y + allocation.height);

相关文章

ToolBar类方法