diff options
author | Carolyn MacLeod <carolyn> | 2004-05-27 17:20:01 +0000 |
---|---|---|
committer | Carolyn MacLeod <carolyn> | 2004-05-27 17:20:01 +0000 |
commit | 153dc58747616ee30d16c5df09dda3c5f38b9e98 (patch) | |
tree | 7cfbd502bed09cc81d0d79aab1bd4c88ef1f07e0 | |
parent | 9a1df5cff14e54773610f3d6221e38995c3e8ef8 (diff) | |
download | eclipse.platform.swt-153dc58747616ee30d16c5df09dda3c5f38b9e98.tar.gz eclipse.platform.swt-153dc58747616ee30d16c5df09dda3c5f38b9e98.tar.xz eclipse.platform.swt-153dc58747616ee30d16c5df09dda3c5f38b9e98.zip |
*** empty log message ***
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java | 19 |
1 files changed, 11 insertions, 8 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 3cd0e1d484..35e3e826f1 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 @@ -1093,21 +1093,24 @@ public void setSelection (TreeItem [] items) { if (item.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT); int hOldItem = OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_CARET, 0); int hNewItem = hAnchor = item.handle; - boolean fixScroll = checkScroll (hNewItem); - if (fixScroll) OS.SendMessage (handle, OS.WM_SETREDRAW, 1, 0); - ignoreSelect = true; - OS.SendMessage (handle, OS.TVM_SELECTITEM, OS.TVGN_CARET, hNewItem); - ignoreSelect = false; /* - * Bug in Windows. When TVM_SELECTITEM is used to ensure - * that an item is visible and the client area of the tree is - * smaller that the size of one item, TVM_SELECTITEM makes + * Bug in Windows. When TVM_SELECTITEM is used to select and + * scroll an item to be visible and the client area of the tree + * is smaller that the size of one item, TVM_SELECTITEM makes * the next item in the tree visible by making it the top item * instead of making the desired item visible. The fix is to * detect the case when the client area is too small and make * the desired visible item be the top item in the tree. + * + * Note that TVM_SELECTITEM when called with TVGN_FIRSTVISIBLE + * also requires the work around for scrolling. */ + boolean fixScroll = checkScroll (hNewItem); + if (fixScroll) OS.SendMessage (handle, OS.WM_SETREDRAW, 1, 0); + ignoreSelect = true; + OS.SendMessage (handle, OS.TVM_SELECTITEM, OS.TVGN_CARET, hNewItem); + ignoreSelect = false; if (OS.SendMessage (handle, OS.TVM_GETVISIBLECOUNT, 0, 0) == 0) { OS.SendMessage (handle, OS.TVM_SELECTITEM, OS.TVGN_FIRSTVISIBLE, hNewItem); } |