Author: jordi
Date: 2005-04-13 14:17:05 -0400 (Wed, 13 Apr 2005)
New Revision: 42949

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs
Log:
2005-04-13  Jordi Mas i Hernandez <[EMAIL PROTECTED]>

        * Form.cs: Pospone menu assignation if the window has not been created 
yet
        * XplatUIWin32.cs: Fixes Win32SetWindowPos, then does not change window 
        size and position



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2005-04-13 18:16:45 UTC (rev 42948)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2005-04-13 18:17:05 UTC (rev 42949)
@@ -1,3 +1,9 @@
+2005-04-13  Jordi Mas i Hernandez <[EMAIL PROTECTED]>
+
+       * Form.cs: Pospone menu assignation if the window has not been created 
yet
+       * XplatUIWin32.cs: Fixes Win32SetWindowPos, then does not change window 
+       size and position
+
 2005-04-12  Jackson Harper  <[EMAIL PROTECTED]>
 
        * TreeView.cs: Set the TopNode properly when scrolling

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs  
2005-04-13 18:16:45 UTC (rev 42948)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs  
2005-04-13 18:17:05 UTC (rev 42949)
@@ -468,8 +468,10 @@
 
                                        menu.SetForm (this);
                                        MenuAPI.SetMenuBarWindow (menu.Handle, 
this);
-                                       
-                                       XplatUI.SetMenu(window.Handle, 
menu.Handle);
+                               
+                                       if (IsHandleCreated && menu != null) {  
+                                               XplatUI.SetMenu(window.Handle, 
menu.Handle);
+                                       }
 
                                        // FIXME - Do we still need this?
                                        this.SetBoundsCore(0, 0, 0, 0, 
BoundsSpecified.None);
@@ -1029,6 +1031,11 @@
 
                                this.is_visible = visible;
                        }
+                       
+                       if (menu != null) {
+                               XplatUI.SetMenu(window.Handle, menu.Handle);
+                       }
+                       
                        OnLoad(EventArgs.Empty);
 
                        // Send initial location

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs  
2005-04-13 18:16:45 UTC (rev 42948)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs  
2005-04-13 18:17:05 UTC (rev 42949)
@@ -1540,7 +1540,7 @@
 
                internal override void SetMenu(IntPtr handle, IntPtr 
menu_handle) {
                        // Trigger WM_NCCALC
-                       Win32SetWindowPos(handle, IntPtr.Zero, 0, 0, 0, 0, 
SetWindowPosFlags.SWP_FRAMECHANGED);
+                       Win32SetWindowPos(handle, IntPtr.Zero, 0, 0, 0, 0, 
SetWindowPosFlags.SWP_FRAMECHANGED | SetWindowPosFlags.SWP_NOMOVE | 
SetWindowPosFlags.SWP_NOSIZE);
                }
 
 

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

Reply via email to