Author: calberto
Date: 2007-02-23 20:11:10 -0500 (Fri, 23 Feb 2007)
New Revision: 73381

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

        This is a first set of changes to make the Virtual mode works,
        by avoiding the retrieval of ListViewItem instances until
        draw time.

        * ListView.cs: Store item position in the ListView instead of the
        ListViewItem, this way we don't request the Bounds property of
        ListViewItem inside the ListView calculations, as well as cache the item
        size in item_size field. Store indexes instead of ListViewItem
        instances in the matrix used by icon view. Add a ItemMatrixLocation
        struct to hold the row and col info of the matrix info.

        * ListViewItem.cs: Don't store the location anymore, and only cache
        the rectangles for GetBounds. Use the ListView.GetItemLocation
        method to retrieve the actual location.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-02-24 00:11:35 UTC (rev 73380)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-02-24 01:11:10 UTC (rev 73381)
@@ -1,3 +1,20 @@
+2007-02-23  Carlos Alberto Cortez <[EMAIL PROTECTED]>
+
+       This is a first set of changes to make the Virtual mode works,
+       by avoiding the retrieval of ListViewItem instances until
+       draw time.
+
+       * ListView.cs: Store item position in the ListView instead of the
+       ListViewItem, this way we don't request the Bounds property of
+       ListViewItem inside the ListView calculations, as well as cache the item
+       size in item_size field. Store indexes instead of ListViewItem
+       instances in the matrix used by icon view. Add a ItemMatrixLocation
+       struct to hold the row and col info of the matrix info.
+
+       * ListViewItem.cs: Don't store the location anymore, and only cache
+       the rectangles for GetBounds. Use the ListView.GetItemLocation
+       method to retrieve the actual location.
+
 2007-02-23  Jonathan Pobst  <[EMAIL PROTECTED]>
 
        * TextRenderer.cs: Add clipping support, thanks to George.

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListViewItem.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListViewItem.cs  
2007-02-24 00:11:35 UTC (rev 73380)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListViewItem.cs  
2007-02-24 01:11:10 UTC (rev 73381)
@@ -581,16 +581,15 @@
 
                        case ItemBoundsPortion.Entire:
                                rect = bounds;
-                               rect.X -= owner.h_marker;
-                               rect.Y -= owner.v_marker;
-                               return rect;
+                               break;
 
                        default:
                                throw new ArgumentException ("Invalid value for 
portion.");
                        }
 
-                       rect.X += bounds.X - owner.h_marker;
-                       rect.Y += bounds.Y - owner.v_marker;
+                       Point item_loc = owner.GetItemLocation (Index);
+                       rect.X += item_loc.X;
+                       rect.Y += item_loc.Y;
                        return rect;
                }
 
@@ -631,37 +630,19 @@
                internal Rectangle CheckRectReal {
                        get {
                                Rectangle rect = checkbox_rect;
-                               rect.X += bounds.X - owner.h_marker;
-                               rect.Y += bounds.Y - owner.v_marker;
+                               Point item_loc = owner.GetItemLocation (Index);
+                               rect.X += item_loc.X;
+                               rect.Y += item_loc.Y;
                                return rect;
                        }
                }
                
-               internal Point Location {
-                       set {
-                               if (bounds.X == value.X && bounds.Y == value.Y)
-                                       return;
-
-                               Rectangle prev = Bounds;
-                               bounds.X = value.X;
-                               bounds.Y = value.Y;
-                               if (owner != null) {
-                                       if (prev != Rectangle.Empty)
-                                               owner.item_control.Invalidate 
(prev);
-                                       owner.item_control.Invalidate (Bounds);
-                               }
-                       }
-               }
-
                internal ListView Owner {
                        set {
                                if (owner == value)
                                        return;
 
                                owner = value;
-                               if (owner != null)
-                                       Layout ();
-                               Invalidate ();
                        }
                }
 
@@ -693,12 +674,10 @@
 
                                icon_rect = label_rect = Rectangle.Empty;
                                icon_rect.X = checkbox_rect.Width + 2;
-                               item_ht = Math.Max (owner.CheckBoxSize.Height, 
text_size.Height);
+                               item_ht = owner.ItemSize.Height;
 
-                               if (owner.SmallImageList != null) {
-                                       item_ht = Math.Max (item_ht, 
owner.SmallImageList.ImageSize.Height);
+                               if (owner.SmallImageList != null)
                                        icon_rect.Width = 
owner.SmallImageList.ImageSize.Width;
-                               }
 
                                label_rect.Height = icon_rect.Height = item_ht;
                                checkbox_rect.Y = item_ht - 
checkbox_rect.Height;
@@ -1006,6 +985,12 @@
                        }
 
 #if NET_2_0
+                       internal int Height {
+                               get {
+                                       return bounds.Height;
+                               }
+                       }
+
                        internal void SetBounds (int x, int y, int width, int 
height)
                        {
                                bounds = new Rectangle (x, y, width, height);

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

Reply via email to