* Menu.cs: MergeMenu: Check menu argument for null before looping over
authorRolf Bjarne Kvinge <RKvinge@novell.com>
Fri, 16 Mar 2007 19:43:52 +0000 (19:43 -0000)
committerRolf Bjarne Kvinge <RKvinge@novell.com>
Fri, 16 Mar 2007 19:43:52 +0000 (19:43 -0000)
  it.
* MdiWindowManager.cs: Add IsVisiblePending to track the pending
  visibility of mdi child forms. FormSizeChangedHandler: update the
  maximized size if size has changed while maximized.
* MdiClient.cs: SizeScrollbars/ArrangeWindows/ActivateChild: Avoid
  creating the handle.
* InternalWindowManager.cs: UpdateBorderStyle/FormSizeChangedHandler:
  avoid creating the handle if not created.
* XplatUI.cs: Update debug output.
* XplatUIStructs.cs: Added ToString's for a couple of structs.

svn path=/trunk/mcs/; revision=74481

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/InternalWindowManager.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiClient.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiWindowManager.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/Menu.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIStructs.cs

index 22a3af3ce33e3aec47396aee8f73afb81466b089..33c1bf52943751e32863162b059503a3341229ce 100644 (file)
@@ -1,3 +1,17 @@
+2007-03-16  Rolf Bjarne Kvinge <RKvinge@novell.com> 
+
+       * Menu.cs: MergeMenu: Check menu argument for null before looping over
+         it.
+       * MdiWindowManager.cs: Add IsVisiblePending to track the pending
+         visibility of mdi child forms. FormSizeChangedHandler: update the
+         maximized size if size has changed while maximized.
+       * MdiClient.cs: SizeScrollbars/ArrangeWindows/ActivateChild: Avoid
+         creating the handle.
+       * InternalWindowManager.cs: UpdateBorderStyle/FormSizeChangedHandler:
+         avoid creating the handle if not created.
+       * XplatUI.cs: Update debug output.
+       * XplatUIStructs.cs: Added ToString's for a couple of structs.
+
 2007-03-16  Jonathan Pobst <monkey@jpobst.com>
 
        * ContainerControl.cs: Give ToolStripManager the opportunity to handle
index d02df0981412919c8430c977e5fbb27fdb4c55df..8d374e8e711fbdcc0275d3dcc659e7efae350360 100644 (file)
@@ -341,7 +341,9 @@ namespace System.Windows.Forms {
 
                public virtual void UpdateBorderStyle (FormBorderStyle border_style)
                {
-                       XplatUI.SetBorderStyle (form.Handle, border_style);
+                       if (form.IsHandleCreated) {
+                               XplatUI.SetBorderStyle (form.Handle, border_style);
+                       }
 
                        if (ShouldRemoveWindowManager (border_style)) {
                                form.RemoveWindowManager ();
@@ -414,8 +416,10 @@ namespace System.Windows.Forms {
 
                private void FormSizeChangedHandler (object sender, EventArgs e)
                {
-                       ThemeEngine.Current.ManagedWindowSetButtonLocations (this);
-                       XplatUI.InvalidateNC (form.Handle);
+                       if (form.IsHandleCreated) {
+                               ThemeEngine.Current.ManagedWindowSetButtonLocations (this);
+                               XplatUI.InvalidateNC (form.Handle);
+                       }
                }
 
                protected virtual bool HandleRButtonDown (ref Message m)
index 3222010e23a0f3c5e092ce155fefd171dce84458..cb48ab1e68eef593263ef793bbb654a3a51a24e3 100644 (file)
@@ -355,6 +355,9 @@ namespace System.Windows.Forms {
                {
                        if (lock_sizing)
                                return;
+                       
+                       if (!IsHandleCreated)
+                               return;
 
                        if (Controls.Count == 0 || ((Form) Controls [0]).WindowState == FormWindowState.Maximized) {
                                if (hbar != null)
@@ -522,6 +525,9 @@ namespace System.Windows.Forms {
 
                private void ArrangeWindows ()
                {
+                       if (!IsHandleCreated)
+                               return;
+                               
                        int change = 0;
                        if (prev_bottom != -1)
                                change = Bottom - prev_bottom;
@@ -673,8 +679,10 @@ namespace System.Windows.Forms {
                        SetWindowStates (wm);
                        if (current != form) {
                                form.has_focus = false;
-                               XplatUI.InvalidateNC (current.Handle);
-                               XplatUI.InvalidateNC (form.Handle);
+                               if (current.IsHandleCreated)
+                                       XplatUI.InvalidateNC (current.Handle);
+                               if (form.IsHandleCreated)
+                                       XplatUI.InvalidateNC (form.Handle);
                        }
                        active_child = (Form) Controls [0];
                        
@@ -815,8 +823,8 @@ namespace System.Windows.Forms {
                        if (mdiclient_layout)
                                Parent.PerformLayout ();
 
-                       //XplatUI.RequestNCRecalc (Parent.Handle);
-                       //XplatUI.RequestNCRecalc (form.Handle);
+                       XplatUI.RequestNCRecalc (Parent.Handle);
+                       XplatUI.RequestNCRecalc (form.Handle);
                        if (!setting_windowstates)
                                SizeScrollBars ();
                }
index 13d5e626af5c531b4eed577e912dd240df8dbdbd..c991b31f9ddae6ce4fd8e13562366d4f5e2afdae 100644 (file)
@@ -51,7 +51,17 @@ namespace System.Windows.Forms {
                private bool icon_dont_show_popup;
 
                private TitleButtons maximized_title_buttons;
-               
+               private bool is_visible_pending;
+
+               internal bool IsVisiblePending {
+                       get {
+                               return is_visible_pending;
+                       }
+                       set {
+                               is_visible_pending = value;
+                       }
+               }
+
                private TitleButtons MaximizedTitleButtons {
                        get {
                                if (maximized_title_buttons == null) {
@@ -127,6 +137,9 @@ namespace System.Windows.Forms {
 
                private void FormSizeChangedHandler (object sender, EventArgs e)
                {
+                       if (form.window_state == FormWindowState.Maximized && form.Bounds != MaximizedBounds)
+                               form.Bounds = MaximizedBounds;
+                       
                        form.MdiParent.MdiContainer.SizeScrollBars ();
                }
        
index 068842a7637072e6d008d3eb9c05934840d20c53..dd6546a402c14bd1a40cd8f24a190791d2420537 100644 (file)
@@ -263,6 +263,9 @@ namespace System.Windows.Forms
                        if (menuSrc == this)
                                throw new ArgumentException ("The menu cannot be merged with itself");
                        
+                       if (menuSrc == null)
+                               return;
+                               
                        for (int i = 0; i < menuSrc.MenuItems.Count; i++) {
                                
                                MenuItem sourceitem = menuSrc.MenuItems[i];
index 85b379d4c27de4b3eee8095dcdfcbe3fa9322cd3..6ca2f6b6b10363f73e31002ad93abde2f261677c 100644 (file)
@@ -752,7 +752,7 @@ namespace System.Windows.Forms {
 
                internal static int SendInput (IntPtr hwnd, Queue keys) {
                        #if DriverDebug
-                               Console.WriteLine("SendInput({0}): Called", charCode);
+                               Console.WriteLine("SendInput({0}, {1}): Called", hwnd, keys);
                        #endif
                        return driver.SendInput (hwnd, keys);
                }
index 6c001ef7763307f9b2e2e0621240dc3d7ac51d47..27b13ebd71f105932d540b61d0738d376e4f377e 100644 (file)
@@ -378,6 +378,11 @@ namespace System.Windows.Forms {
                {
                        return new Point (x, y);
                }
+
+               public override string ToString ()
+               {
+                       return "Point {" + x.ToString () + ", " + y.ToString () + ")";
+               }
        }
        
        [StructLayout(LayoutKind.Sequential)] 
@@ -389,6 +394,11 @@ namespace System.Windows.Forms {
                internal uint   time;  
                internal POINT  pt;
                internal object refobject;
+
+               public override string ToString ()
+               {
+                       return String.Format ("msg=0x{0:x} ({1}) hwnd=0x{2:x} wparam=0x{3:x} lparam=0x{4:x} pt=0x{5:x}", (int) message, message.ToString (), hwnd.ToInt32 (), wParam.ToInt32 (), lParam.ToInt32 (), pt);
+               }
        }
 
        [Flags]