2007-01-16 Rolf Bjarne Kvinge <RKvinge@novell.com>
authorRolf Bjarne Kvinge <RKvinge@novell.com>
Tue, 16 Jan 2007 19:37:52 +0000 (19:37 -0000)
committerRolf Bjarne Kvinge <RKvinge@novell.com>
Tue, 16 Jan 2007 19:37:52 +0000 (19:37 -0000)
* MdiClient.cs: Add ActivatePreviousChild for
mdi child window navigation.
* Form.cs: Use MdiClient.ActivateNextChild/
ActivatePreviousChild instead of Form.SelectNextControl
to select the next/previous child since
SelectNextControl doesn't do it in the same order
as mdi children should do it.

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

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiClient.cs

index 572c88419bd9e8bdce74a7948b17c4c2774dac44..1c574cad501d60791b4dd6c6f7ef0c6c3fe49fdc 100644 (file)
@@ -1,3 +1,13 @@
+2007-01-16  Rolf Bjarne Kvinge  <RKvinge@novell.com>
+
+       * MdiClient.cs: Add ActivatePreviousChild for 
+       mdi child window navigation.
+       * Form.cs: Use MdiClient.ActivateNextChild/
+       ActivatePreviousChild instead of Form.SelectNextControl
+       to select the next/previous child since 
+       SelectNextControl doesn't do it in the same order
+       as mdi children should do it.
+
 2007-01-16  Chris Toshok  <toshok@ximian.com>
 
        * Control.cs: remove container_selected field.
index 75bd2311f31d9fa0fb55e9ba0fde0cb1db1049c4..6a456a5db791801ce7f5dc4b63543349be1b25c0 100644 (file)
@@ -1785,11 +1785,11 @@ namespace System.Windows.Forms {
                                        return true;
                                case Keys.Control | Keys.Tab:
                                case Keys.Control | Keys.F6:
-                                       MdiParent.SelectNextControl (MdiParent.ActiveControl, false, false, true, true);
+                                       MdiParent.MdiContainer.ActivateNextChild ();
                                        return true;
                                case Keys.Control | Keys.Shift | Keys.Tab:
                                case Keys.Control | Keys.Shift | Keys.F6:
-                                       MdiParent.SelectNextControl (MdiParent.ActiveControl, true, false, true, true);
+                                       MdiParent.MdiContainer.ActivatePreviousChild ();
                                        return true;
                                }
                        }
index 6b54d76151ae35288bfd20ac01edf645f75fe61a..d5367d520a5d612b0ea27f69ad09c4bbdb72fa28 100644 (file)
@@ -660,8 +660,18 @@ namespace System.Windows.Forms {
                        Form front = (Form) Controls [0];
                        Form form = (Form) Controls [1];
 
-                       front.SendToBack ();
                        ActivateChild (form);
+                       front.SendToBack ();
+               }
+
+               internal void ActivatePreviousChild ()
+               {
+                       if (Controls.Count <= 1)
+                               return;
+                       
+                       Form back = (Form) Controls [Controls.Count - 1];
+                       
+                       ActivateChild (back);
                }
 
                internal void ActivateChild (Form form)
@@ -684,7 +694,9 @@ namespace System.Windows.Forms {
                                XplatUI.InvalidateNC (form.Handle);
                        }
                        active_child = (Form) Controls [0];
-                       ParentForm.ActiveControl = active_child;
+                       
+                       if (active_child.Visible)
+                               ParentForm.ActiveControl = active_child;
                }
 
                internal override IntPtr AfterTopMostControl ()