dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dotgnu-pnet-commits] [SCM] DotGNU Portable.NET Class Library (pnetlib)


From: Heiko Weiss
Subject: [dotgnu-pnet-commits] [SCM] DotGNU Portable.NET Class Library (pnetlib) branch, master, updated. 48da4b9633e5e9d900d66afdc464a0600652a925
Date: Mon, 01 Mar 2010 11:31:52 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "DotGNU Portable.NET Class Library (pnetlib)".

The branch, master has been updated
       via  48da4b9633e5e9d900d66afdc464a0600652a925 (commit)
      from  75d055aceb87120740df2394e3f045a650e0049b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/pnetlib.git/commit/?id=48da4b9633e5e9d900d66afdc464a0600652a925

commit 48da4b9633e5e9d900d66afdc464a0600652a925
Author: Heiko Weiss <address@hidden>
Date:   Mon Mar 1 12:30:29 2010 +0100

    removed workaround for exception while removing controls,
    found the problem, fixed.

diff --git a/ChangeLog b/ChangeLog
index b43618a..3edcdec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-03-01  Heiko Weiss  <address@hidden>
+       
+       * System.Windows.Forms/ScrollableControl.cs: removed workaround for 
+       exception while removing controls, found the problem, fixed.
+
 2010-02-22  Heiko Weiss  <address@hidden>
        
        * System.Windows.Forms/ScrollableControl.cs: workaround for exception 
diff --git a/System.Windows.Forms/ScrollableControl.cs 
b/System.Windows.Forms/ScrollableControl.cs
index 9171653..b20a167 100644
--- a/System.Windows.Forms/ScrollableControl.cs
+++ b/System.Windows.Forms/ScrollableControl.cs
@@ -256,58 +256,53 @@ public class ScrollableControl : Control
                                AutoScrollMargin = new Size(x, y);
                        }
 
+       protected override void DestroyHandle()
+       {
+               base.DestroyHandle();
+               this.DestroyScrollBars();
+       }
+
        private void UpdateScrollBars()
                        {
-                               try 
-                               {
-                                       this.CheckAutoscrollPosition();
-                                       Rectangle rect = DisplayRectangle;
-       
-                                       if( null != vScrollBar ) {
-                                               
vScrollBar.SetBounds(rect.Right, 0, vScrollBar.Width, rect.Height);
-                                               if(DisplayRectangle.Height >= 
ScrollArea.Height)
-                                               {
-                                                       vScrollBar.Visible = 
false;
-                                               }
-                                               else
-                                               {
-       //                                              
vScrollBar.CreateControl();
-                                                       
-                                                       // set Maximum before 
setting the value, or we get an exception
-                                                       vScrollBar.Maximum = 
ScrollArea.Height - 1;
-                                                       vScrollBar.Value = 
-(autoScrollPosition.Y);
-                                                       // set 
Large/SmallChange after setting maximum, or display failure
-                                                       vScrollBar.LargeChange 
= DisplayRectangle.Height;
-                                                       vScrollBar.SmallChange 
= (DisplayRectangle.Height + 9 )/ 10;
-                                                       vScrollBar.Visible = 
vscroll;
-                                               }       
-                                       }
-       
-                                       if( null != hScrollBar ) {
-                                               hScrollBar.SetBounds(0, 
rect.Bottom, rect.Width, hScrollBar.Height);
-                                               if(DisplayRectangle.Width >= 
ScrollArea.Width)
-                                               {
-                                                       hScrollBar.Visible = 
false;
-                                               }
-                                               else
-                                               {
-                                                       // set Maximum before 
setting the value, or we get an exception
-                                                       hScrollBar.Maximum = 
ScrollArea.Width - 1;
-                                                       hScrollBar.Value = 
-(autoScrollPosition.X);
-                                                       // set 
Large/SmallChange after setting maximum, or display failure
-                                                       hScrollBar.LargeChange 
= DisplayRectangle.Width;                        
-                                                       hScrollBar.SmallChange 
= (DisplayRectangle.Width + 9) / 10;
-                                                       hScrollBar.Visible = 
hscroll;
-                                               }
+                               this.CheckAutoscrollPosition();
+                               Rectangle rect = DisplayRectangle;
+
+                               if( null != vScrollBar ) {
+                                       vScrollBar.SetBounds(rect.Right, 0, 
vScrollBar.Width, rect.Height);
+                                       if(DisplayRectangle.Height >= 
ScrollArea.Height)
+                                       {
+                                               vScrollBar.Visible = false;
                                        }
+                                       else
+                                       {
+//                                             vScrollBar.CreateControl();
+                                               
+                                               // set Maximum before setting 
the value, or we get an exception
+                                               vScrollBar.Maximum = 
ScrollArea.Height - 1;
+                                               vScrollBar.Value = 
-(autoScrollPosition.Y);
+                                               // set Large/SmallChange after 
setting maximum, or display failure
+                                               vScrollBar.LargeChange = 
DisplayRectangle.Height;
+                                               vScrollBar.SmallChange = 
(DisplayRectangle.Height + 9 )/ 10;
+                                               vScrollBar.Visible = vscroll;
+                                       }       
                                }
-                               catch 
-                               {
-                                       // ignore exception while updating 
scrollbars.
-                                       // exceptions might happen while 
clearing controls while disposing
-                                       // scrollbar tries to create graphics, 
but widget might be destroyed
-                                       // Xsharp.XInvalidOperationException
-                                       // this is not a fix, but a workaround
+
+                               if( null != hScrollBar ) {
+                                       hScrollBar.SetBounds(0, rect.Bottom, 
rect.Width, hScrollBar.Height);
+                                       if(DisplayRectangle.Width >= 
ScrollArea.Width)
+                                       {
+                                               hScrollBar.Visible = false;
+                                       }
+                                       else
+                                       {
+                                               // set Maximum before setting 
the value, or we get an exception
+                                               hScrollBar.Maximum = 
ScrollArea.Width - 1;
+                                               hScrollBar.Value = 
-(autoScrollPosition.X);
+                                               // set Large/SmallChange after 
setting maximum, or display failure
+                                               hScrollBar.LargeChange = 
DisplayRectangle.Width;                        
+                                               hScrollBar.SmallChange = 
(DisplayRectangle.Width + 9) / 10;
+                                               hScrollBar.Visible = hscroll;
+                                       }
                                }
                        }
 

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                 |    5 ++
 System.Windows.Forms/ScrollableControl.cs |   91 ++++++++++++++---------------
 2 files changed, 48 insertions(+), 48 deletions(-)


hooks/post-receive
-- 
DotGNU Portable.NET Class Library (pnetlib)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]