Author: jackson
Date: 2007-04-20 18:32:23 -0400 (Fri, 20 Apr 2007)
New Revision: 76029

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs
Log:

        * TreeView.cs: Simplify scrolling to the last node after
        * expanding
        all.
        - Fix some off by ones with setting the bottom.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-04-20 22:14:29 UTC (rev 76028)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-04-20 22:32:23 UTC (rev 76029)
@@ -1,3 +1,9 @@
+2007-04-20  Jackson Harper  <[EMAIL PROTECTED]>
+
+       * TreeView.cs: Simplify scrolling to the last node after expanding
+       all.
+       - Fix some off by ones with setting the bottom.
+
 2007-04-20  Jonathan Pobst  <[EMAIL PROTECTED]>
 
        * Control.cs: Use DefaultSize for Size, calculate ClientSize from

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs      
2007-04-20 22:14:29 UTC (rev 76028)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs      
2007-04-20 22:32:23 UTC (rev 76029)
@@ -672,13 +672,7 @@
                        if (!found)
                                return;
 
-                       // Walk all the way to the end, then walk back visible 
count
-                       //to find the new top node
-                       OpenTreeNodeEnumerator walk = new 
OpenTreeNodeEnumerator (root_node);
-                       while (walk.MoveNext ())
-                       { }
-
-                       SetTop (walk.CurrentNode);
+                       vbar.Value = vbar.Maximum - VisibleCount + 1;
                }
 
                
@@ -1123,7 +1117,7 @@
                                return;
                        }
 
-                       vbar.Value = Math.Min (node.visible_order, vbar.Maximum 
- VisibleCount);
+                       vbar.Value = Math.Min (node.visible_order, vbar.Maximum 
- VisibleCount + 1);
                }
 
                internal void SetBottom (TreeNode node)
@@ -1604,7 +1598,7 @@
                                
                                vbar.Visible = true;
                                if (skipped_nodes > 0) {
-                                       int skip = Math.Min (skipped_nodes, 
vbar.Maximum - VisibleCount);
+                                       int skip = Math.Min (skipped_nodes, 
vbar.Maximum - VisibleCount + 1);
                                        skipped_nodes = 0;
                                        vbar.Value = skip;
                                        skipped_nodes = skip;

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to