Author: everaldo
Date: 2007-04-26 11:13:36 -0400 (Thu, 26 Apr 2007)
New Revision: 76330

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MainMenu.cs
Log:
2007-04-26  Everaldo Canuto  <[EMAIL PROTECTED]>

        * MainMenu.cs: In OnMenuChanged pass PaintEventArgs to Draw method, it
        fixes some menu draw problem on Windows with border diferent from 
default
        it also fixes #81403.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-04-26 15:13:29 UTC (rev 76329)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-04-26 15:13:36 UTC (rev 76330)
@@ -1,3 +1,9 @@
+2007-04-26  Everaldo Canuto  <[EMAIL PROTECTED]>
+
+       * MainMenu.cs: In OnMenuChanged pass PaintEventArgs to Draw method, it
+       fixes some menu draw problem on Windows with border diferent from 
default
+       it also fixes #81403.
+
 2007-04-26  Rolf Bjarne Kvinge <[EMAIL PROTECTED]> 
 
        * Form.cs: Refactor WndProc into separate methods, just like Control is

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MainMenu.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MainMenu.cs      
2007-04-26 15:13:29 UTC (rev 76329)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MainMenu.cs      
2007-04-26 15:13:36 UTC (rev 76330)
@@ -108,7 +108,6 @@
                {
                        if (Wnd.IsHandleCreated) {
                                Point pt = XplatUI.GetMenuOrigin 
(Wnd.window.Handle);
-                               
                                PaintEventArgs pevent = XplatUI.PaintEventStart 
(Wnd.window.Handle, false);
                                pevent.Graphics.SetClip (new Rectangle (rect.X 
+ pt.X, rect.Y + pt.Y, rect.Width, rect.Height));
                                Draw (pevent, Rect);
@@ -160,7 +159,14 @@
                        Rectangle clip = Rect;
                        Height = 0; /* need this so the theme code will 
re-layout the menu items
                                       (why is the theme code doing the layout? 
 argh) */
-                       Draw (clip);
+
+                       if (!Wnd.IsHandleCreated)
+                               return;
+                       
+                       PaintEventArgs pevent = XplatUI.PaintEventStart 
(Wnd.window.Handle, false);
+                       pevent.Graphics.SetClip (clip);
+                       
+                       Draw (pevent, clip);
                }
 
                /* Mouse events from the form */

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

Reply via email to