diff options
author | Steve Northover <steve> | 2006-02-11 01:11:01 +0000 |
---|---|---|
committer | Steve Northover <steve> | 2006-02-11 01:11:01 +0000 |
commit | 02c4a773531fc761803195e7ac8d95cf52024a71 (patch) | |
tree | d4846c31815a8d1b4b9b944f21e228287a88b66e | |
parent | 8285298456ad43389f54794e89847ef4d271ad7a (diff) | |
download | eclipse.platform.swt-02c4a773531fc761803195e7ac8d95cf52024a71.tar.gz eclipse.platform.swt-02c4a773531fc761803195e7ac8d95cf52024a71.tar.xz eclipse.platform.swt-02c4a773531fc761803195e7ac8d95cf52024a71.zip |
fix clipping and selection when zero columns
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java | 13 | ||||
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeItem.java | 11 |
2 files changed, 10 insertions, 14 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java index 805374ffca..c6b127d42b 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java @@ -4879,11 +4879,6 @@ LRESULT wmNotifyChild (int wParam, int lParam) { event.y = cellRect.top; event.width = cellRect.right - cellRect.left; event.height = cellRect.bottom - cellRect.top; - if (hwndHeader != 0) { - int count = OS.SendMessage (hwndHeader, OS.HDM_GETITEMCOUNT, 0, 0); - if (count == 0) event.width = Math.max (event.width, scrollWidth); - } - event.height = cellRect.bottom - cellRect.top; gc.setClipping (event.x, event.y, event.width, event.height); sendEvent (SWT.EraseItem, event); event.gc = null; @@ -5272,12 +5267,8 @@ LRESULT wmNotifyChild (int wParam, int lParam) { event.height = itemRect.bottom - itemRect.top; RECT cellRect = item.getBounds (index, true, true, true, true, true, hDC); int cellWidth = cellRect.right - cellRect.left; - if (hwndHeader != 0) { - int columnCount = OS.SendMessage (hwndHeader, OS.HDM_GETITEMCOUNT, 0, 0); - if (columnCount == 0) cellWidth = Math.max (cellWidth, scrollWidth); - } - gc.setClipping (cellRect.left, cellRect.top, cellWidth, cellRect.bottom - cellRect.top); - sendEvent (SWT.PaintItem, event); + int cellHeight = cellRect.bottom - cellRect.top; + gc.setClipping (cellRect.left, cellRect.top, cellWidth, cellHeight); sendEvent (SWT.PaintItem, event); event.gc = null; gc.dispose (); OS.RestoreDC (hDC, nSavedDC); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeItem.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeItem.java index 601d9e44de..eb838d2245 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TreeItem.java @@ -438,10 +438,15 @@ RECT getBounds (int index, boolean getText, boolean getImage, boolean fullText, } } if (fullText || fullImage || clip) { - if (hwndHeader != 0 && columnCount != 0) { + if (hwndHeader != 0) { RECT headerRect = new RECT (); - if (OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, index, headerRect) == 0) { - return new RECT (); + if (columnCount != 0) { + if (OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, index, headerRect) == 0) { + return new RECT (); + } + } else { + headerRect.right = parent.scrollWidth; + if (headerRect.right == 0) headerRect = rect; } if (fullText) rect.right = headerRect.right; if (fullImage) rect.left = headerRect.left; |