Author: ivanz
Date: 2008-02-11 11:44:56 -0500 (Mon, 11 Feb 2008)
New Revision: 95449

Modified:
   
branches/mono-1-9/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   
branches/mono-1-9/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyGrid.cs
   
branches/mono-1-9/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyGridView.cs
Log:
2008-02-11  Ivan N. Zlatev  <[EMAIL PROTECTED]>

        * PropertyGridView.cs: 
         - Fix height for drawing the grid entry
         text value, so that it clips multiline text properly.
         - Fix unfocusing to match MSFT.
Imaginary Buffer Line
        * PropertyGrid.cs: Do not populate subgriditems unless expandable.
        Fixes a bug where on repopulation after value changed items become
        expandable.



Modified: 
branches/mono-1-9/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- 
branches/mono-1-9/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
    2008-02-11 16:32:50 UTC (rev 95448)
+++ 
branches/mono-1-9/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
    2008-02-11 16:44:56 UTC (rev 95449)
@@ -1,3 +1,12 @@
+2008-02-11  Ivan N. Zlatev  <[EMAIL PROTECTED]>
+
+       * PropertyGridView.cs: 
+        - Fix height for drawing the grid entry
+        text value, so that it clips multiline text properly.
+        - Fix unfocusing to match MSFT.
+       * PropertyGrid.cs: Do not populate subgriditems unless expandable.
+       Fixes a bug where on repopulation after value changed items become
+       expandable.
 2008-02-08  Jonathan Pobst  <[EMAIL PROTECTED]>
        [Backport to 1.9]
        * Control.cs: Guard against an NRE in ShowFocusCues.

Modified: 
branches/mono-1-9/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyGrid.cs
===================================================================
--- 
branches/mono-1-9/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyGrid.cs
      2008-02-11 16:32:50 UTC (rev 95448)
+++ 
branches/mono-1-9/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyGrid.cs
      2008-02-11 16:44:56 UTC (rev 95449)
@@ -1557,13 +1557,15 @@
                                        rootItem.GridItems.Add (item);
                                }
 
-                               if (IsExpandable (item))
-                                       PopulateSubGridItems (item);
+                               PopulateSubGridItems (item);
                        }
                }
 
                private void PopulateSubGridItems (GridEntry parentItem)
                {
+                       if (!IsExpandable (parentItem))
+                               return;
+
                        object[] propertyOwners = parentItem.Values;
                        if (propertyOwners == null)
                                return;

Modified: 
branches/mono-1-9/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyGridView.cs
===================================================================
--- 
branches/mono-1-9/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyGridView.cs
  2008-02-11 16:32:50 UTC (rev 95448)
+++ 
branches/mono-1-9/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyGridView.cs
  2008-02-11 16:44:56 UTC (rev 95449)
@@ -260,7 +260,8 @@
                            && grid_textbox.Visible) {
                                switch (keyData) {
                                case Keys.Enter:
-                                       TrySetEntry (selectedItem, 
grid_textbox.Text);
+                                       if (TrySetEntry (selectedItem, 
grid_textbox.Text))
+                                               UnfocusSelection ();
                                        return true;
                                case Keys.Escape:
                                        if (selectedItem.IsEditable)
@@ -608,7 +609,8 @@
                        pevent.Graphics.DrawString (valueText, font,
                                                    brush,
                                                    new RectangleF (xLoc, 
rect.Y + ENTRY_SPACING,
-                                                                   
ClientRectangle.Width-(xLoc), row_height),string_format);
+                                                                   
ClientRectangle.Width-(xLoc), row_height - (ENTRY_SPACING*2 + 1)), 
+                                                   string_format);
                }
 
                private void DrawGridItem (GridEntry grid_item, PaintEventArgs 
pevent, int depth, ref int yLoc) {
@@ -699,8 +701,10 @@
                void AcceptListBoxSelection (object sender) 
                {
                        GridEntry entry = this.property_grid.SelectedGridItem 
as GridEntry;
-                       if (entry != null)
-                               TrySetEntry (entry, (string) ((ListBox) 
sender).SelectedItem);
+                       if (entry != null) {
+                               if (TrySetEntry (entry, (string) ((ListBox) 
sender).SelectedItem))
+                                       UnfocusSelection ();
+                       }
                        CloseDropDown ();
                }
 

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

Reply via email to