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

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

[dotgnu-pnet-commits] pnetlib ChangeLog System.Windows.Forms/TabContr...


From: Heiko Weiss
Subject: [dotgnu-pnet-commits] pnetlib ChangeLog System.Windows.Forms/TabContr...
Date: Mon, 07 Jan 2008 15:27:02 +0000

CVSROOT:        /sources/dotgnu-pnet
Module name:    pnetlib
Changes by:     Heiko Weiss <brubbel>   08/01/07 15:27:01

Modified files:
        .              : ChangeLog 
        System.Windows.Forms: TabControl.cs 

Log message:
        fixed clearing tab pages.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pnetlib/ChangeLog?cvsroot=dotgnu-pnet&r1=1.2528&r2=1.2529
http://cvs.savannah.gnu.org/viewcvs/pnetlib/System.Windows.Forms/TabControl.cs?cvsroot=dotgnu-pnet&r1=1.31&r2=1.32

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/dotgnu-pnet/pnetlib/ChangeLog,v
retrieving revision 1.2528
retrieving revision 1.2529
diff -u -b -r1.2528 -r1.2529
--- ChangeLog   7 Jan 2008 09:30:16 -0000       1.2528
+++ ChangeLog   7 Jan 2008 15:27:01 -0000       1.2529
@@ -1,3 +1,7 @@
+2008-01-07  Heiko Weiss <address@hidden>
+
+       * System.Windows.Forms/TabControl.cs: fixed clearing tab pages.
+
 2008-01-07  Radek Polak  <address@hidden>
 
        * samples/forms/forms.build: Fix wrong directory name.

Index: System.Windows.Forms/TabControl.cs
===================================================================
RCS file: /sources/dotgnu-pnet/pnetlib/System.Windows.Forms/TabControl.cs,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- System.Windows.Forms/TabControl.cs  22 Oct 2007 04:46:18 -0000      1.31
+++ System.Windows.Forms/TabControl.cs  7 Jan 2008 15:27:01 -0000       1.32
@@ -368,11 +368,19 @@
 
                        public override void Remove(Control control)
                        {
+                               int newIdx = -1;
                                base.Remove(control);
                                tabOwner.InvalidateTabs ();
                                tabOwner.SetTabPageBounds();
                        }
 
+                       public override void Clear()
+                       {
+                               base.Clear();
+                               tabOwner.InvalidateTabs ();
+                               tabOwner.SetTabPageBounds();
+                       }
+                       
                };
 
                // Collection of child control TabPages.
@@ -503,7 +511,9 @@
                        }
                        public void Clear()
                        {
-                               tabOwner.RemoveAll();
+                               // tabOwner.RemoveAll();        // Brubbel 
recursion endless !!!
+                               tabOwner.Controls.Clear();
+                               tabOwner.selectedIndex = -1;
                        }
                        bool IList.Contains(Object value)
                        {
@@ -1338,6 +1348,17 @@
 
                internal void InvalidateTabs()
                {
+                       // Brubbel
+                       int newIndex = selectedIndex;
+                       if( newIndex != -1 ) {
+                               if( newIndex >= tabPageCollection.Count ) {
+                                       newIndex = tabPageCollection.Count-1;
+                               }
+                               if( newIndex != -1 ) {
+                                       this.SelectedIndex = newIndex;
+                               }
+                       } 
+
                        positionInfo = null;
                        if (!IsHandleCreated)
                                return;




reply via email to

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