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

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

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

Table.hooks介绍

暂无

代码示例

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

  1. boolean isCustomToolTip () {
  2. return hooks (SWT.MeasureItem);
  3. }

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

  1. @Override
  2. void setBackgroundImage (int /*long*/ hBitmap) {
  3. super.setBackgroundImage (hBitmap);
  4. if (hBitmap != 0) {
  5. setBackgroundTransparent (true);
  6. } else {
  7. if (!hooks (SWT.MeasureItem) && !hooks (SWT.EraseItem) && !hooks (SWT.PaintItem)) {
  8. setBackgroundTransparent (false);
  9. }
  10. }
  11. }

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

  1. @Override
  2. LRESULT WM_SIZE (int /*long*/ wParam, int /*long*/ lParam) {
  3. if (ignoreResize) return null;
  4. if (hooks (SWT.EraseItem) || hooks (SWT.PaintItem)) {
  5. OS.InvalidateRect (handle, null, true);
  6. }
  7. if (resizeCount != 0) {
  8. wasResized = true;
  9. return null;
  10. }
  11. return super.WM_SIZE (wParam, lParam);
  12. }

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

  1. boolean isOptimizedRedraw () {
  2. if ((style & SWT.H_SCROLL) == 0 || (style & SWT.V_SCROLL) == 0) return false;
  3. return !hasChildren () && !hooks (SWT.Paint) && !filters (SWT.Paint);
  4. }

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

  1. void redraw (int columnIndex) {
  2. if (parent.currentItem == this || !isDrawing()) return;
  3. /* redraw the full item if columnIndex == -1 */
  4. NSTableView tableView = (NSTableView) parent.view;
  5. NSRect rect = null;
  6. if (columnIndex == -1 || parent.hooks (SWT.MeasureItem) || parent.hooks (SWT.EraseItem) || parent.hooks (SWT.PaintItem)) {
  7. rect = tableView.rectOfRow (parent.indexOf (this));
  8. } else {
  9. int index;
  10. if (parent.columnCount == 0) {
  11. index = (parent.style & SWT.CHECK) != 0 ? 1 : 0;
  12. } else {
  13. if (0 <= columnIndex && columnIndex < parent.columnCount) {
  14. index = parent.indexOf (parent.columns[columnIndex].nsColumn);
  15. } else {
  16. return;
  17. }
  18. }
  19. rect = tableView.frameOfCellAtColumn (index, parent.indexOf (this));
  20. }
  21. tableView.setNeedsDisplayInRect (rect);
  22. }

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

  1. void highlightSelectionInClipRect(long /*int*/ id, long /*int*/ sel, long /*int*/ rect) {
  2. if (hooks (SWT.EraseItem)) return;
  3. if ((style & SWT.HIDE_SELECTION) != 0 && !hasFocus()) return;
  4. NSRect clipRect = new NSRect ();
  5. OS.memmove (clipRect, rect, NSRect.sizeof);
  6. callSuper (id, sel, clipRect);
  7. }

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

  1. if (hooks (SWT.MeasureItem) || hooks (SWT.EraseItem) || hooks (SWT.PaintItem)) {
  2. OS.SendMessage (handle, OS.LVM_SETBKCOLOR, 0, OS.CLR_NONE);

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

  1. int getItemHeightInPixels () {
  2. if (!painted && hooks (SWT.MeasureItem)) hitTestSelection (0, 0, 0);
  3. int /*long*/ empty = OS.SendMessage (handle, OS.LVM_APPROXIMATEVIEWRECT, 0, 0);
  4. int /*long*/ oneItem = OS.SendMessage (handle, OS.LVM_APPROXIMATEVIEWRECT, 1, 0);
  5. return OS.HIWORD (oneItem) - OS.HIWORD (empty);
  6. }

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

  1. if (hooks (SWT.MeasureItem) || hooks (SWT.EraseItem) || hooks (SWT.PaintItem)) {
  2. if (drawCount++ == 0 && OS.IsWindowVisible (handle)) {
  3. OS.DefWindowProc (handle, OS.WM_SETREDRAW, 0, 0);
  4. if (hooks (SWT.MeasureItem) || hooks (SWT.EraseItem) || hooks (SWT.PaintItem)) {
  5. if (--drawCount == 0 /*&& OS.IsWindowVisible (handle)*/) {
  6. OS.SendMessage (handle, OS.LVM_SETBKCOLOR, 0, OS.CLR_NONE);

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

  1. void setFont (NSFont font) {
  2. super.setFont (font);
  3. setItemHeight (null, font, !hooks (SWT.MeasureItem));
  4. view.setNeedsDisplay (true);
  5. clearCachedWidth (items);
  6. setScrollWidth (items, true);
  7. }

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

  1. if (itemHeight != -1) setItemHeight (false);
  2. if (!hooks (SWT.MeasureItem) && !hooks (SWT.EraseItem) && !hooks (SWT.PaintItem)) {
  3. Control control = findBackgroundControl ();
  4. if (control == null) control = this;

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

  1. NSSize cellSize (long /*int*/ id, long /*int*/ sel) {
  2. NSSize size = super.cellSize(id, sel);
  3. NSCell cell = new NSCell(id);
  4. NSImage image = cell.image();
  5. if (image != null) size.width += imageBounds.width + IMAGE_GAP;
  6. if (hooks(SWT.MeasureItem)) {
  7. long /*int*/ [] outValue = new long /*int*/ [1];
  8. OS.object_getInstanceVariable(id, Display.SWT_ROW, outValue);
  9. long /*int*/ rowIndex = outValue [0];
  10. TableItem item = _getItem((int)/*64*/rowIndex);
  11. OS.object_getInstanceVariable(id, Display.SWT_COLUMN, outValue);
  12. long /*int*/ tableColumn = outValue[0];
  13. int columnIndex = 0;
  14. for (int i=0; i<columnCount; i++) {
  15. if (columns [i].nsColumn.id == tableColumn) {
  16. columnIndex = i;
  17. break;
  18. }
  19. }
  20. sendMeasureItem (item, columnIndex, size, cell.isHighlighted());
  21. }
  22. return size;
  23. }

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

  1. NSRect expansionRect;
  2. if (rect.width != 0 && rect.height != 0) {
  3. if (hooks(SWT.MeasureItem)) {
  4. expansionRect = cellRect;
  5. NSSize cellSize = cell.cellSize();
  6. if (hooks(SWT.MeasureItem)) {
  7. expansionRect = cellRect;
  8. NSSize cellSize = cell.cellSize();

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

  1. void showItem (int index) {
  2. if (!painted && hooks (SWT.MeasureItem)) hitTestSelection (index, 0, 0);

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

  1. if (hooks (SWT.MeasureItem)) {
  2. redraw = getDrawing () && OS.IsWindowVisible (handle);

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

  1. boolean hitTestSelection (int index, int x, int y) {
  2. int count = (int)/*64*/OS.SendMessage (handle, OS.LVM_GETITEMCOUNT, 0, 0);
  3. if (count == 0) return false;
  4. if (!hooks (SWT.MeasureItem)) return false;
  5. boolean result = false;
  6. if (0 <= index && index < count) {
  7. TableItem item = _getItem (index);
  8. int /*long*/ hDC = OS.GetDC (handle);
  9. int /*long*/ oldFont = 0, newFont = OS.SendMessage (handle, OS.WM_GETFONT, 0, 0);
  10. if (newFont != 0) oldFont = OS.SelectObject (hDC, newFont);
  11. int /*long*/ hFont = item.fontHandle (0);
  12. if (hFont != -1) hFont = OS.SelectObject (hDC, hFont);
  13. Event event = sendMeasureItemEvent (item, index, 0, hDC);
  14. if (event.getBoundsInPixels ().contains (x, y)) result = true;
  15. if (hFont != -1) hFont = OS.SelectObject (hDC, hFont);
  16. if (newFont != 0) OS.SelectObject (hDC, oldFont);
  17. OS.ReleaseDC (handle, hDC);
  18. // if (isDisposed () || item.isDisposed ()) return false;
  19. }
  20. return result;
  21. }

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

  1. boolean canDragRowsWithIndexes_atPoint(long /*int*/ id, long /*int*/ sel, long /*int*/ rowIndexes, NSPoint mouseDownPoint) {
  2. if (!super.canDragRowsWithIndexes_atPoint(id, sel, rowIndexes, mouseDownPoint)) return false;
  3. // If the current row is not selected and the user is not attempting to modify the selection, select the row first.
  4. NSTableView widget = (NSTableView)view;
  5. long /*int*/ row = widget.rowAtPoint(mouseDownPoint);
  6. long /*int*/ modifiers = NSApplication.sharedApplication().currentEvent().modifierFlags();
  7. boolean drag = (state & DRAG_DETECT) != 0 && hooks (SWT.DragDetect);
  8. if (drag) {
  9. if (!widget.isRowSelected(row) && (modifiers & (OS.NSCommandKeyMask | OS.NSShiftKeyMask | OS.NSAlternateKeyMask)) == 0) {
  10. NSIndexSet set = (NSIndexSet)new NSIndexSet().alloc();
  11. set = set.initWithIndex(row);
  12. widget.selectRowIndexes (set, false);
  13. set.release();
  14. }
  15. }
  16. // The clicked row must be selected to initiate a drag.
  17. return (widget.isRowSelected(row) && drag) || !hasFocus();
  18. }

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

  1. if (hooks (SWT.EraseItem) && nmcd.left != nmcd.right) {
  2. OS.SaveDC (nmcd.hdc);
  3. int /*long*/ hrgn = OS.CreateRectRgn (0, 0, 0, 0);

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

  1. if (hooks (SWT.PaintItem)) {
  2. TableItem item = _getItem ((int)/*64*/nmcd.dwItemSpec);
  3. sendPaintItemEvent (item, nmcd);

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

  1. void sendMeasureEvent (int /*long*/ cell, int /*long*/ width, int /*long*/ height) {
  2. if (!ignoreSize && OS.GTK_IS_CELL_RENDERER_TEXT (cell) && hooks (SWT.MeasureItem)) {
  3. int /*long*/ iter = OS.g_object_get_qdata (cell, Display.SWT_OBJECT_INDEX2);
  4. TableItem item = null;

相关文章

Table类方法