Author: calberto
Date: 2007-08-31 22:35:55 -0400 (Fri, 31 Aug 2007)
New Revision: 85158

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListViewItem.cs
Log:
2007-08-31  Carlos Alberto Cortez <[EMAIL PROTECTED]>

        * ListViewItem.cs: In ListViewItemCollection operations calculate
        Layout for owner as well as invalidate it. Fixes part of #82642.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-08-31 23:52:24 UTC (rev 85157)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-09-01 02:35:55 UTC (rev 85158)
@@ -1,3 +1,8 @@
+2007-08-31  Carlos Alberto Cortez <[EMAIL PROTECTED]>
+
+       * ListViewItem.cs: In ListViewItemCollection operations calculate
+       Layout for owner as well as invalidate it. Fixes part of #82642.
+
 2007-08-31  Jonathan Pobst  <[EMAIL PROTECTED]>
 
        * ToolStripItem.cs: Take Parent/Owner's Enabled state in to account

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListViewItem.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListViewItem.cs  
2007-08-31 23:52:24 UTC (rev 85157)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListViewItem.cs  
2007-09-01 02:35:55 UTC (rev 85158)
@@ -1190,8 +1190,10 @@
                        public ListViewSubItem this [int index] {
                                get { return (ListViewSubItem) list [index]; }
                                set { 
-                                       value.owner = this.owner;
+                                       value.owner = owner;
                                        list [index] = value;
+                                       owner.Layout ();
+                                       owner.Invalidate ();
                                }
                        }
 
@@ -1232,25 +1234,24 @@
                        #region Public Methods
                        public ListViewSubItem Add (ListViewSubItem item)
                        {
-                               item.owner = this.owner;
-                               list.Add (item);
+                               AddSubItem (item);
+                               owner.Layout ();
+                               owner.Invalidate ();
                                return item;
                        }
 
                        public ListViewSubItem Add (string text)
                        {
-                               ListViewSubItem item = new ListViewSubItem 
(this.owner, text);
-                               list.Add (item);
-                               return item;
+                               ListViewSubItem item = new ListViewSubItem 
(owner, text);
+                               return Add (item);
                        }
 
                        public ListViewSubItem Add (string text, Color 
foreColor,
                                                    Color backColor, Font font)
                        {
-                               ListViewSubItem item = new ListViewSubItem 
(this.owner, text,
+                               ListViewSubItem item = new ListViewSubItem 
(owner, text,
                                                                            
foreColor, backColor, font);
-                               list.Add (item);
-                               return item;
+                               return Add (item);
                        }
 
                        public void AddRange (ListViewSubItem [] items)
@@ -1261,8 +1262,10 @@
                                foreach (ListViewSubItem item in items) {
                                        if (item == null)
                                                continue;
-                                       this.Add (item);
+                                       AddSubItem (item);
                                }
+                               owner.Layout ();
+                               owner.Invalidate ();
                        }
 
                        public void AddRange (string [] items)
@@ -1273,8 +1276,10 @@
                                foreach (string item in items) {
                                        if (item == null)
                                                continue;
-                                       this.Add (item);
+                                       AddSubItem (new ListViewSubItem (owner, 
item));
                                }
+                               owner.Layout ();
+                               owner.Invalidate ();
                        }
 
                        public void AddRange (string [] items, Color foreColor,
@@ -1286,10 +1291,19 @@
                                foreach (string item in items) {
                                        if (item == null)
                                                continue;
-                                       this.Add (item, foreColor, backColor, 
font);
+
+                                       AddSubItem (new ListViewSubItem (owner, 
item, foreColor, backColor, font));
                                }
+                               owner.Layout ();
+                               owner.Invalidate ();
                        }
 
+                       void AddSubItem (ListViewSubItem subItem)
+                       {
+                               subItem.owner = owner;
+                               list.Add (subItem);
+                       }
+
                        public void Clear ()
                        {
                                list.Clear ();
@@ -1389,11 +1403,15 @@
                        {
                                item.owner = this.owner;
                                list.Insert (index, item);
+                               owner.Layout ();
+                               owner.Invalidate ();
                        }
 
                        public void Remove (ListViewSubItem item)
                        {
                                list.Remove (item);
+                               owner.Layout ();
+                               owner.Invalidate ();
                        }
 
 #if NET_2_0

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

Reply via email to