Author: gonzalo
Date: 2006-06-01 18:53:03 -0400 (Thu, 01 Jun 2006)
New Revision: 61392

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBar.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBarButton.cs
Log:
2006-06-01 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>

        * ToolBar.cs: add SizeSpecified property.
        * ToolBarButton.cs: when the ButtonSize is calculated by the container,
        try to figure out our real size, otherwise fallback to what the
        container says.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-06-01 22:48:29 UTC (rev 61391)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-06-01 22:53:03 UTC (rev 61392)
@@ -1,3 +1,10 @@
+2006-06-01 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
+       * ToolBar.cs: add SizeSpecified property.
+       * ToolBarButton.cs: when the ButtonSize is calculated by the container,
+       try to figure out our real size, otherwise fallback to what the
+       container says.
+
 2006-06-01  Peter Dennis Bartok  <[EMAIL PROTECTED]> 
 
        * XplatUIX11.cs (DefWndProc): WM_MOUSEWHEEL needs to be passed up

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBar.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBar.cs       
2006-06-01 22:48:29 UTC (rev 61391)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBar.cs       
2006-06-01 22:53:03 UTC (rev 61392)
@@ -633,6 +633,10 @@
                        Refresh ();
                }
 
+               internal bool SizeSpecified {
+                       get { return size_specified; }
+               }
+
                const int text_padding = 3;
 
                private Size CalcButtonSize ()

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBarButton.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBarButton.cs 
2006-06-01 22:48:29 UTC (rev 61391)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBarButton.cs 
2006-06-01 22:53:03 UTC (rev 61392)
@@ -298,7 +298,14 @@
                        if (Parent == null || !Visible)
                                return;
 
-                       Layout (Parent.ButtonSize);
+                       Size psize = Parent.ButtonSize;
+                       Size size = psize;
+                       if (!Parent.SizeSpecified) {
+                               size = CalculateSize ();
+                               if (size.Width == 0 || size.Height == 0)
+                                       size = psize;
+                       }
+                       Layout (size);
                }
 
                internal void Layout (Size size)

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

Reply via email to