本文整理了Java中org.eclipse.swt.widgets.Table.hooks()
方法的一些代码示例,展示了Table.hooks()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.hooks()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Table
类名称:Table
方法名:hooks
暂无
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
boolean isCustomToolTip () {
return hooks (SWT.MeasureItem);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
@Override
void setBackgroundImage (int /*long*/ hBitmap) {
super.setBackgroundImage (hBitmap);
if (hBitmap != 0) {
setBackgroundTransparent (true);
} else {
if (!hooks (SWT.MeasureItem) && !hooks (SWT.EraseItem) && !hooks (SWT.PaintItem)) {
setBackgroundTransparent (false);
}
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
@Override
LRESULT WM_SIZE (int /*long*/ wParam, int /*long*/ lParam) {
if (ignoreResize) return null;
if (hooks (SWT.EraseItem) || hooks (SWT.PaintItem)) {
OS.InvalidateRect (handle, null, true);
}
if (resizeCount != 0) {
wasResized = true;
return null;
}
return super.WM_SIZE (wParam, lParam);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
boolean isOptimizedRedraw () {
if ((style & SWT.H_SCROLL) == 0 || (style & SWT.V_SCROLL) == 0) return false;
return !hasChildren () && !hooks (SWT.Paint) && !filters (SWT.Paint);
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
void redraw (int columnIndex) {
if (parent.currentItem == this || !isDrawing()) return;
/* redraw the full item if columnIndex == -1 */
NSTableView tableView = (NSTableView) parent.view;
NSRect rect = null;
if (columnIndex == -1 || parent.hooks (SWT.MeasureItem) || parent.hooks (SWT.EraseItem) || parent.hooks (SWT.PaintItem)) {
rect = tableView.rectOfRow (parent.indexOf (this));
} else {
int index;
if (parent.columnCount == 0) {
index = (parent.style & SWT.CHECK) != 0 ? 1 : 0;
} else {
if (0 <= columnIndex && columnIndex < parent.columnCount) {
index = parent.indexOf (parent.columns[columnIndex].nsColumn);
} else {
return;
}
}
rect = tableView.frameOfCellAtColumn (index, parent.indexOf (this));
}
tableView.setNeedsDisplayInRect (rect);
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
void highlightSelectionInClipRect(long /*int*/ id, long /*int*/ sel, long /*int*/ rect) {
if (hooks (SWT.EraseItem)) return;
if ((style & SWT.HIDE_SELECTION) != 0 && !hasFocus()) return;
NSRect clipRect = new NSRect ();
OS.memmove (clipRect, rect, NSRect.sizeof);
callSuper (id, sel, clipRect);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
if (hooks (SWT.MeasureItem) || hooks (SWT.EraseItem) || hooks (SWT.PaintItem)) {
OS.SendMessage (handle, OS.LVM_SETBKCOLOR, 0, OS.CLR_NONE);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
int getItemHeightInPixels () {
if (!painted && hooks (SWT.MeasureItem)) hitTestSelection (0, 0, 0);
int /*long*/ empty = OS.SendMessage (handle, OS.LVM_APPROXIMATEVIEWRECT, 0, 0);
int /*long*/ oneItem = OS.SendMessage (handle, OS.LVM_APPROXIMATEVIEWRECT, 1, 0);
return OS.HIWORD (oneItem) - OS.HIWORD (empty);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
if (hooks (SWT.MeasureItem) || hooks (SWT.EraseItem) || hooks (SWT.PaintItem)) {
if (drawCount++ == 0 && OS.IsWindowVisible (handle)) {
OS.DefWindowProc (handle, OS.WM_SETREDRAW, 0, 0);
if (hooks (SWT.MeasureItem) || hooks (SWT.EraseItem) || hooks (SWT.PaintItem)) {
if (--drawCount == 0 /*&& OS.IsWindowVisible (handle)*/) {
OS.SendMessage (handle, OS.LVM_SETBKCOLOR, 0, OS.CLR_NONE);
代码示例来源: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 (items, true);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
if (itemHeight != -1) setItemHeight (false);
if (!hooks (SWT.MeasureItem) && !hooks (SWT.EraseItem) && !hooks (SWT.PaintItem)) {
Control control = findBackgroundControl ();
if (control == null) control = this;
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
NSSize cellSize (long /*int*/ id, long /*int*/ sel) {
NSSize size = super.cellSize(id, sel);
NSCell cell = new NSCell(id);
NSImage image = cell.image();
if (image != null) size.width += imageBounds.width + IMAGE_GAP;
if (hooks(SWT.MeasureItem)) {
long /*int*/ [] outValue = new long /*int*/ [1];
OS.object_getInstanceVariable(id, Display.SWT_ROW, outValue);
long /*int*/ rowIndex = outValue [0];
TableItem item = _getItem((int)/*64*/rowIndex);
OS.object_getInstanceVariable(id, Display.SWT_COLUMN, outValue);
long /*int*/ tableColumn = outValue[0];
int columnIndex = 0;
for (int i=0; i<columnCount; i++) {
if (columns [i].nsColumn.id == tableColumn) {
columnIndex = i;
break;
}
}
sendMeasureItem (item, columnIndex, size, cell.isHighlighted());
}
return size;
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
NSRect expansionRect;
if (rect.width != 0 && rect.height != 0) {
if (hooks(SWT.MeasureItem)) {
expansionRect = cellRect;
NSSize cellSize = cell.cellSize();
if (hooks(SWT.MeasureItem)) {
expansionRect = cellRect;
NSSize cellSize = cell.cellSize();
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
void showItem (int index) {
if (!painted && hooks (SWT.MeasureItem)) hitTestSelection (index, 0, 0);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
if (hooks (SWT.MeasureItem)) {
redraw = getDrawing () && OS.IsWindowVisible (handle);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
boolean hitTestSelection (int index, int x, int y) {
int count = (int)/*64*/OS.SendMessage (handle, OS.LVM_GETITEMCOUNT, 0, 0);
if (count == 0) return false;
if (!hooks (SWT.MeasureItem)) return false;
boolean result = false;
if (0 <= index && index < count) {
TableItem item = _getItem (index);
int /*long*/ hDC = OS.GetDC (handle);
int /*long*/ oldFont = 0, newFont = OS.SendMessage (handle, OS.WM_GETFONT, 0, 0);
if (newFont != 0) oldFont = OS.SelectObject (hDC, newFont);
int /*long*/ hFont = item.fontHandle (0);
if (hFont != -1) hFont = OS.SelectObject (hDC, hFont);
Event event = sendMeasureItemEvent (item, index, 0, hDC);
if (event.getBoundsInPixels ().contains (x, y)) result = true;
if (hFont != -1) hFont = OS.SelectObject (hDC, hFont);
if (newFont != 0) OS.SelectObject (hDC, oldFont);
OS.ReleaseDC (handle, hDC);
// if (isDisposed () || item.isDisposed ()) return false;
}
return result;
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
boolean canDragRowsWithIndexes_atPoint(long /*int*/ id, long /*int*/ sel, long /*int*/ rowIndexes, NSPoint mouseDownPoint) {
if (!super.canDragRowsWithIndexes_atPoint(id, sel, rowIndexes, mouseDownPoint)) return false;
// If the current row is not selected and the user is not attempting to modify the selection, select the row first.
NSTableView widget = (NSTableView)view;
long /*int*/ row = widget.rowAtPoint(mouseDownPoint);
long /*int*/ modifiers = NSApplication.sharedApplication().currentEvent().modifierFlags();
boolean drag = (state & DRAG_DETECT) != 0 && hooks (SWT.DragDetect);
if (drag) {
if (!widget.isRowSelected(row) && (modifiers & (OS.NSCommandKeyMask | OS.NSShiftKeyMask | OS.NSAlternateKeyMask)) == 0) {
NSIndexSet set = (NSIndexSet)new NSIndexSet().alloc();
set = set.initWithIndex(row);
widget.selectRowIndexes (set, false);
set.release();
}
}
// The clicked row must be selected to initiate a drag.
return (widget.isRowSelected(row) && drag) || !hasFocus();
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
if (hooks (SWT.EraseItem) && nmcd.left != nmcd.right) {
OS.SaveDC (nmcd.hdc);
int /*long*/ hrgn = OS.CreateRectRgn (0, 0, 0, 0);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
if (hooks (SWT.PaintItem)) {
TableItem item = _getItem ((int)/*64*/nmcd.dwItemSpec);
sendPaintItemEvent (item, nmcd);
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
void sendMeasureEvent (int /*long*/ cell, int /*long*/ width, int /*long*/ height) {
if (!ignoreSize && OS.GTK_IS_CELL_RENDERER_TEXT (cell) && hooks (SWT.MeasureItem)) {
int /*long*/ iter = OS.g_object_get_qdata (cell, Display.SWT_OBJECT_INDEX2);
TableItem item = null;
内容来源于网络,如有侵权,请联系作者删除!