Author: jpobst
Date: 2007-09-27 11:40:26 -0400 (Thu, 27 Sep 2007)
New Revision: 86509

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RadioButton.cs
Log:
2007-09-27  Jonathan Pobst  <[EMAIL PROTECTED]>

        * Control.cs: Ask parent to perform a layout if control is AutoSize and
        the text changes.
        * RadioButton.cs: Implement GetPreferredSizeCore.
        [Fixes bug #328672]

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-09-27 15:40:06 UTC (rev 86508)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-09-27 15:40:26 UTC (rev 86509)
@@ -1,3 +1,10 @@
+2007-09-27  Jonathan Pobst  <[EMAIL PROTECTED]>
+
+       * Control.cs: Ask parent to perform a layout if control is AutoSize and
+       the text changes.
+       * RadioButton.cs: Implement GetPreferredSizeCore.
+       [Fixes bug #328672]
+
 2007-09-26  Jonathan Pobst  <[EMAIL PROTECTED]>
 
        * RichTextBox.cs, TextBoxBase.cs, WindowsFormsSynchronizationContext.cs:

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs       
2007-09-27 15:40:06 UTC (rev 86508)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs       
2007-09-27 15:40:26 UTC (rev 86509)
@@ -3180,6 +3180,11 @@
                                        text=value;
                                        UpdateWindowText ();
                                        OnTextChanged (EventArgs.Empty);
+
+#if NET_2_0
+                                       if (AutoSize && Parent != null)
+                                               Parent.PerformLayout (this, 
"Text");
+#endif
                                }
                        }
                }

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RadioButton.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RadioButton.cs   
2007-09-27 15:40:06 UTC (rev 86508)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RadioButton.cs   
2007-09-27 15:40:26 UTC (rev 86509)
@@ -162,6 +162,16 @@
                        ThemeEngine.Current.DrawRadioButton (pe.Graphics, 
this.ClientRectangle, this);
 #endif
                }
+
+#if NET_2_0
+               internal override Size GetPreferredSizeCore (Size proposedSize)
+               {
+                       if (this.AutoSize)
+                               return 
ThemeEngine.Current.CalculateRadioButtonAutoSize (this);
+
+                       return base.GetPreferredSizeCore (proposedSize);
+               }
+#endif
                #endregion      // Private Methods
 
                #region Public Instance Properties

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

Reply via email to