summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Northover <steve>2006-02-11 02:14:23 +0000
committerSteve Northover <steve>2006-02-11 02:14:23 +0000
commit02d745a32b10a8f685d12785397c35d7fec9a725 (patch)
tree224aff336e4fbf3cfea6f9a779009f4d87e426bc
parentc6e9619d897b0115821305c8c2b3861743ec8279 (diff)
downloadeclipse.platform.swt-02d745a32b10a8f685d12785397c35d7fec9a725.tar.gz
eclipse.platform.swt-02d745a32b10a8f685d12785397c35d7fec9a725.tar.xz
eclipse.platform.swt-02d745a32b10a8f685d12785397c35d7fec9a725.zip
fix vertical scroll bar to show and horizontal scroll bar to hide in owner draw tree
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java17
1 files changed, 12 insertions, 5 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 c6b127d42b..55b792261d 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
@@ -3381,7 +3381,7 @@ void updateImages () {
void updateScrollBar () {
if (hwndParent != 0) {
int columnCount = OS.SendMessage (hwndHeader, OS.HDM_GETITEMCOUNT, 0, 0);
- if (columnCount != 0) {
+ if (columnCount != 0 || scrollWidth != 0) {
SCROLLINFO info = new SCROLLINFO ();
info.cbSize = SCROLLINFO.sizeof;
info.fMask = OS.SIF_ALL;
@@ -4564,6 +4564,16 @@ LRESULT WM_SETFONT (int wParam, int lParam) {
}
LRESULT WM_SIZE (int wParam, int lParam) {
+ /*
+ * Bug in Windows. When TVS_NOHSCROLL is set when the
+ * size of the tree is zero, the scrol bar is shown the
+ * next time the tree resizes. The fix is to hide the
+ * scroll bar every time the tree is resized.
+ */
+ int bits = OS.GetWindowLong (handle, OS.GWL_STYLE);
+ if ((bits & OS.TVS_NOHSCROLL) != 0) {
+ if (!OS.IsWinCE) OS.ShowScrollBar (handle, OS.SB_HORZ, false);
+ }
if (ignoreResize) return null;
return super.WM_SIZE (wParam, lParam);
}
@@ -4848,10 +4858,7 @@ LRESULT wmNotifyChild (int wParam, int lParam) {
}
}
if (!ignoreItemHeight) {
- int itemHeight = OS.SendMessage (handle, OS.TVM_GETITEMHEIGHT, 0, 0);
- if (event.height > itemHeight) {
- OS.SendMessage (handle, OS.TVM_SETITEMHEIGHT, event.height, 0);
- }
+ if (event.height > getItemHeight ()) setItemHeight (event.height);
ignoreItemHeight = true;
}
}