Author: jackson
Date: 2006-07-15 18:23:39 -0400 (Sat, 15 Jul 2006)
New Revision: 62649

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

        - Use the client rectangle when setting the trees scrollbars, so
        border style is taken into account.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-07-15 21:11:57 UTC (rev 62648)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-07-15 22:23:39 UTC (rev 62649)
@@ -3,7 +3,9 @@
        * LabelEditTextBox.cs:
        * TreeView.cs: Use a new LabelEdit class for node editing, this
        class automatically 'closes' itself when it gets the enter key or
-       loses focus.    
+       loses focus.
+       - Use the client rectangle when setting the trees scrollbars, so
+       border style is taken into account.
        
 2006-07-14  Jackson Harper  <[EMAIL PROTECTED]>
 

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs      
2006-07-15 21:11:57 UTC (rev 62648)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs      
2006-07-15 22:23:39 UTC (rev 62649)
@@ -127,7 +127,6 @@
                        string_format.LineAlignment = StringAlignment.Center;
                        string_format.Alignment = StringAlignment.Center;
 
-                       
                        vbar = new ImplicitVScrollBar ();
                        hbar = new ImplicitHScrollBar ();
 
@@ -135,6 +134,7 @@
                        hbar.Visible = false;
                        vbar.ValueChanged += new EventHandler 
(VScrollBarValueChanged);
                        hbar.ValueChanged += new EventHandler 
(HScrollBarValueChanged);
+
                        SuspendLayout ();
                        Controls.AddImplicit (vbar);
                        Controls.AddImplicit (hbar);
@@ -532,6 +532,8 @@
                #region Protected Instance Methods
                protected override void CreateHandle () {
                        base.CreateHandle ();
+
+                       UpdateScrollBars ();
                }
 
                protected override void Dispose (bool disposing) {
@@ -783,7 +785,6 @@
                        return null;
                }
 
-               // TODO: we shouldn't have to compute this on the fly
                internal Rectangle ViewportRectangle {
                        get {
                                Rectangle res = ClientRectangle;
@@ -1270,7 +1271,6 @@
                        if (scrollable) {
                                OpenTreeNodeEnumerator walk = new 
OpenTreeNodeEnumerator (root_node);
                                
-                               
                                while (walk.MoveNext ()) {
                                        int r = walk.CurrentNode.Bounds.Right;
                                        int b = walk.CurrentNode.Bounds.Bottom;
@@ -1308,7 +1308,8 @@
 
                                if (!vbar_bounds_set) {
                                        vbar.Bounds = new Rectangle 
(ClientRectangle.Width - vbar.Width, 0, vbar.Width,
-                                                       Height - (hbar.Visible 
? SystemInformation.VerticalScrollBarWidth : 0));
+                                                       ClientRectangle.Height -
+                                                       (hbar.Visible ? 
SystemInformation.VerticalScrollBarWidth : 0));
                                        vbar_bounds_set = true;
                                }
 
@@ -1329,8 +1330,9 @@
                                */
 
                                if (!hbar_bounds_set) {
-                                       hbar.Bounds = new Rectangle (0, Height 
- hbar.Height,
-                                                       Width - (vbar.Visible ? 
SystemInformation.HorizontalScrollBarHeight : 0),
+                                       hbar.Bounds = new Rectangle (0, 
ClientRectangle.Height - hbar.Height,
+                                                       ClientRectangle.Width - 
(vbar.Visible ?
+                                                                       
SystemInformation.HorizontalScrollBarHeight : 0),
                                                        hbar.Height);
                                        hbar_bounds_set = true;
                                }
@@ -1348,14 +1350,15 @@
                                UpdateScrollBars ();
 
                        }
+
                        if (vbar.Visible) {
                                vbar.Bounds = new Rectangle 
(ClientRectangle.Width - vbar.Width, 0, vbar.Width,
-                                               Height - (hbar.Visible ? 
SystemInformation.VerticalScrollBarWidth : 0));
+                                               ClientRectangle.Height - 
(hbar.Visible ? SystemInformation.VerticalScrollBarWidth : 0));
                        }
 
                        if (hbar.Visible) {
-                               hbar.Bounds = new Rectangle (0, Height - 
hbar.Height,
-                                               Width - (vbar.Visible ? 
SystemInformation.HorizontalScrollBarHeight : 0), hbar.Height);
+                               hbar.Bounds = new Rectangle (0, 
ClientRectangle.Height - hbar.Height,
+                                               ClientRectangle.Width - 
(vbar.Visible ? SystemInformation.HorizontalScrollBarHeight : 0), hbar.Height);
                        }
                }
 

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

Reply via email to