本文整理了Java中org.eclipse.swt.widgets.Tree.setItemHeight()
方法的一些代码示例,展示了Tree.setItemHeight()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tree.setItemHeight()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Tree
类名称:Tree
方法名:setItemHeight
[英]Sets the height of the area which would be used to display one of the items in the tree.
[中]设置用于显示树中一个项目的区域的高度。
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
/*public*/ void setItemHeight (int itemHeight) {
checkWidget ();
if (itemHeight < -1) error (SWT.ERROR_INVALID_ARGUMENT);
if (itemHeight == -1) {
setItemHeight (null, null, true);
} else {
((NSOutlineView)view).setRowHeight (itemHeight);
}
}
代码示例来源: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
parent.setItemHeight (image, null, false);
代码示例来源: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;
}
内容来源于网络,如有侵权,请联系作者删除!