Author: jackson
Date: 2007-03-06 11:55:48 -0500 (Tue, 06 Mar 2007)
New Revision: 73824

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: We can't get the bounds of the nodes before
        * raising
        the AfterSelect event, because that event could change the
node's
        bounds (scrolling, font change, etc).



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-03-06 16:47:53 UTC (rev 73823)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-03-06 16:55:48 UTC (rev 73824)
@@ -1,3 +1,9 @@
+2007-03-06  Jackson Harper  <[EMAIL PROTECTED]>
+
+       * TreeView.cs: We can't get the bounds of the nodes before raising
+       the AfterSelect event, because that event could change the node's
+       bounds (scrolling, font change, etc).
+
 2007-03-06  Rolf Bjarne Kvinge <[EMAIL PROTECTED]> 
 
        * XplatUIWin32.cs: When faking styles don't remove the WS_VISIBLE flag.

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs      
2007-03-06 16:47:53 UTC (rev 73823)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs      
2007-03-06 16:55:48 UTC (rev 73824)
@@ -1630,16 +1630,20 @@
 
                        Rectangle invalid;
                        if (!ce.Cancel) {
-                               if (focused_node != null) {
-                                       invalid = Rectangle.Union (Bloat 
(focused_node.Bounds),
-                                                       Bloat 
(highlighted_node.Bounds));
-                               } else {
-                                       invalid = Bloat 
(highlighted_node.Bounds);
-                               }
+                               TreeNode prev_focused_node = focused_node;
+                               TreeNode prev_highlighted_node = 
highlighted_node;
+                               
                                selected_node = highlighted_node;
                                focused_node = highlighted_node;
                                OnAfterSelect (new TreeViewEventArgs 
(selected_node, TreeViewAction.ByMouse));
 
+                               if (prev_focused_node != null) {
+                                       invalid = Rectangle.Union (Bloat 
(prev_focused_node.Bounds),
+                                                       Bloat 
(prev_highlighted_node.Bounds));
+                               } else {
+                                       invalid = Bloat 
(prev_highlighted_node.Bounds);
+                               }
+
                                Invalidate (invalid);
                        } else {
                                highlighted_node = focused_node;

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

Reply via email to