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

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

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

Tree.setScrollWidth介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

boolean setScrollWidth () {
  return setScrollWidth (true, items, true);
}

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

void setScrollWidth () {
  if (hwndHeader == 0 || hwndParent == 0) return;
  int width = 0;
  HDITEM hdItem = new HDITEM ();
  for (int i=0; i<columnCount; i++) {
    hdItem.mask = OS.HDI_WIDTH;
    OS.SendMessage (hwndHeader, OS.HDM_GETITEM, i, hdItem);
    width += hdItem.cxy;
  }
  setScrollWidth (Math.max (scrollWidth, width));
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

public void setRedraw (boolean redraw) {
  checkWidget ();
  super.setRedraw (redraw);
  if (redraw && drawCount == 0) {
    checkItems ();
    setScrollWidth ();
  }
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

if (index == 0) parent.setScrollWidth (this);
if (0 <= index && index < count) redraw (index);

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

reloadPending = true;
setScrollWidth ();
if (this.itemCount == 0) imageBounds = null;
if (insertItem == item) insertItem = null;

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

void collapseItem_collapseChildren (long /*int*/ id, long /*int*/ sel, long /*int*/ itemID, boolean children) {
  TreeItem item = (TreeItem)display.getWidget(itemID);
  if (item == null) return;
  if (!ignoreExpand) item.sendExpand (false, children);
  ignoreExpand = true;
  super.collapseItem_collapseChildren (id, sel, itemID, children);
  ignoreExpand = false;
  if (isDisposed() || item.isDisposed()) return;
  setScrollWidth ();
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

void setFont (NSFont font) {
  super.setFont (font);
  setItemHeight (null, font, !hooks (SWT.MeasureItem));
  view.setNeedsDisplay (true);
  clearCachedWidth (items);
  setScrollWidth ();
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

/**
 * Removes all of the items from the receiver.
 * 
 * @exception SWTException <ul>
 *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 * </ul>
 */
public void removeAll () {
  checkWidget ();
  for (int i=0; i<items.length; i++) {
    TreeItem item = items [i];
    if (item != null && !item.isDisposed ()) item.release (false);
  }
  items = new TreeItem [4];
  itemCount = 0;
  imageBounds = null;
  insertItem = null;
  ignoreSelect = true;
  ((NSOutlineView) view).reloadData ();
  ignoreSelect = false;
  setScrollWidth ();
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

void expandItem_expandChildren (long /*int*/ id, long /*int*/ sel, long /*int*/ itemID, boolean children) {
  TreeItem item = (TreeItem)display.getWidget(itemID);
  if (item == null) return;
  if (!ignoreExpand) item.sendExpand (true, children);
  ignoreExpand = true;
  super.expandItem_expandChildren (id, sel, itemID, children);
  ignoreExpand = false;
  if (isDisposed() || item.isDisposed()) return;
  if (!children) {
    ignoreExpand = true;
    TreeItem[] items = item.items;
    for (int i = 0; i < item.itemCount; i++) {
      if (items[i] != null) items[i].updateExpanded ();
    }
    ignoreExpand = false;
  }
  setScrollWidth (false, item.items, true);
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

cached = true;
if (!expanded) {
  parent.setScrollWidth ();

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

boolean checkData (TreeItem item) {
  if (item.cached) return true;
  if ((style & SWT.VIRTUAL) != 0) {
    item.cached = true;
    Event event = new Event ();
    TreeItem parentItem = item.getParentItem ();
    event.item = item;
    event.index = parentItem == null ? indexOf (item) : parentItem.indexOf (item);
    ignoreRedraw = true;
    sendEvent (SWT.SetData, event);
    //widget could be disposed at this point
    ignoreRedraw = false;
    if (isDisposed () || item.isDisposed ()) return false;
    if (!setScrollWidth (item)) item.redraw (-1);
  }
  return true;
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

if (index == 0) parent.setScrollWidth (this);
if (0 <= index && index < count) redraw (index);

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

void setWidthInPixels (int width) {
  if (width < 0) return;
  int index = parent.indexOf (this);
  if (index == -1) return;
  int /*long*/ hwndHeader = parent.hwndHeader;
  if (hwndHeader == 0) return;
  HDITEM hdItem = new HDITEM ();
  hdItem.mask = OS.HDI_WIDTH;
  hdItem.cxy = width;
  OS.SendMessage (hwndHeader, OS.HDM_SETITEM, index, hdItem);
  RECT headerRect = new RECT ();
  OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, index, headerRect);
  parent.forceResize ();
  int /*long*/ hwnd = parent.handle;
  RECT rect = new RECT ();
  OS.GetClientRect (hwnd, rect);
  rect.left = headerRect.left;
  OS.InvalidateRect (hwnd, rect, true);
  parent.setScrollWidth ();
}

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

info.nPos = Math.max (0, headerRect.left - Tree.INSET / 2);
OS.SetScrollInfo (hwndParent, OS.SB_HORZ, info, true);
setScrollWidth ();

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

item.width = event.width;
item.width += widget.indentationPerLevel () * (1 + widget.levelForItem (item.handle));
if (setScrollWidth (item)) {
  widget.setNeedsDisplay(true);

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

OS.ShowWindow (hwndHeader, OS.SW_HIDE);
setScrollWidth ();
updateHeaderToolTips ();
updateScrollBar ();

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

Event sendMeasureItemEvent (TreeItem item, int index, int /*long*/ hDC, int detail) {
  RECT itemRect = item.getBounds (index, true, true, false, false, false, hDC);
  int nSavedDC = OS.SaveDC (hDC);
  GCData data = new GCData ();
  data.device = display;
  data.font = item.getFont (index);
  GC gc = GC.win32_new (hDC, data);
  Event event = new Event ();
  event.item = item;
  event.gc = gc;
  event.index = index;
  event.setBoundsInPixels(new Rectangle(itemRect.left, itemRect.top, itemRect.right - itemRect.left, itemRect.bottom - itemRect.top));
  event.detail = detail;
  sendEvent (SWT.MeasureItem, event);
  event.gc = null;
  gc.dispose ();
  OS.RestoreDC (hDC, nSavedDC);
  if (isDisposed () || item.isDisposed ()) return null;
  Rectangle rect = event.getBoundsInPixels ();
  if (hwndHeader != 0) {
    if (columnCount == 0) {
      if (rect.x + rect.width > scrollWidth) {
        setScrollWidth (scrollWidth = rect.x + rect.width);
      }
    }
  }
  if (rect.height > getItemHeightInPixels ()) setItemHeight (rect.height);
  return event;
}

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

items = new TreeItem [4];
scrollWidth = 0;
setScrollWidth ();
updateScrollBar ();

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

setScrollWidth (tree_column, item);
ignoreCell = 0;

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

setScrollWidth (tree_column, item);
ignoreCell = 0;

相关文章

Tree类方法