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: Radek Polak
Subject: [dotgnu-pnet-commits] pnetlib ChangeLog System.Windows.Forms/TabContr...
Date: Mon, 22 Oct 2007 04:46:19 +0000

CVSROOT:        /sources/dotgnu-pnet
Module name:    pnetlib
Changes by:     Radek Polak <radekp>    07/10/22 04:46:19

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

Log message:
        some tab control fixes

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

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/dotgnu-pnet/pnetlib/ChangeLog,v
retrieving revision 1.2516
retrieving revision 1.2517
diff -u -b -r1.2516 -r1.2517
--- ChangeLog   12 Oct 2007 15:10:54 -0000      1.2516
+++ ChangeLog   22 Oct 2007 04:46:18 -0000      1.2517
@@ -1,3 +1,9 @@
+2007-10-22  Radek Polak  <address@hidden>
+
+       * System.Windows.Forms/TabControl.cs: Fix index out of range and null
+       reference exceptions. Handle correctly case, when we set tabpage at
+       selected index - the tab content didnt appear.
+
 2007-10-12  Radek Polak  <address@hidden>
 
        * DotGNU.Misc/BlockingOperation.cs: Class for aborting operations

Index: System.Windows.Forms/TabControl.cs
===================================================================
RCS file: /sources/dotgnu-pnet/pnetlib/System.Windows.Forms/TabControl.cs,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- System.Windows.Forms/TabControl.cs  29 May 2006 11:47:23 -0000      1.30
+++ System.Windows.Forms/TabControl.cs  22 Oct 2007 04:46:18 -0000      1.31
@@ -130,9 +130,10 @@
                        //      return;
                        //}
                        SuspendLayout();
-                       if (prevSelectedIndex > -1)
+                       Control prevPage = GetChildByIndex( prevSelectedIndex );
+                       if(prevPage != null)
                        {
-                               GetChildByIndex( prevSelectedIndex ).Visible = 
false;
+                               prevPage.Visible = false;
                        }
 
                        Control selectedPage = GetChildByIndex( selectedIndex );
@@ -405,6 +406,10 @@
                                        tabpages.Insert(idx, value);
                                        tabOwner.Controls.Clear();
                                        
tabOwner.Controls.AddRange((TabPage[])tabpages.ToArray(typeof(TabPage)));
+                                       if(tabOwner.selectedIndex == idx)
+                                       {
+                                               ((Control)(value)).Visible = 
true;
+                                       }
                                }
                        }
 
@@ -688,9 +693,9 @@
                                                //if (SelectedIndex < TabCount)
                                                //{
                                                        // Check to see if we 
have selected a tab that isnt on the last row and move the tab row down
-                                               if( selectedIndex >= 0 ) {
-                                                       if 
(tabs[SelectedIndex].row != maxRow)
-                                                               RowToBottom(ref 
tabs, tabs[SelectedIndex].row, maxRow);
+                                               if( selectedIndex >= 0 && 
selectedIndex < tabs.Length) {
+                                                       if 
(tabs[selectedIndex].row != maxRow)
+                                                               RowToBottom(ref 
tabs, tabs[selectedIndex].row, maxRow);
                                                }
                                                //}
 




reply via email to

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