Author: rolf
Date: 2007-01-16 14:37:52 -0500 (Tue, 16 Jan 2007)
New Revision: 71169

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/MdiClient.cs
Log:
2007-01-16  Rolf Bjarne Kvinge  <[EMAIL PROTECTED]>

        * 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.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-01-16 19:19:02 UTC (rev 71168)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-01-16 19:37:52 UTC (rev 71169)
@@ -1,3 +1,13 @@
+2007-01-16  Rolf Bjarne Kvinge  <[EMAIL PROTECTED]>
+
+       * 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  <[EMAIL PROTECTED]>
 
        * Control.cs: remove container_selected field.

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs  
2007-01-16 19:19:02 UTC (rev 71168)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs  
2007-01-16 19:37:52 UTC (rev 71169)
@@ -1785,11 +1785,11 @@
                                        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;
                                }
                        }

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiClient.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiClient.cs     
2007-01-16 19:19:02 UTC (rev 71168)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiClient.cs     
2007-01-16 19:37:52 UTC (rev 71169)
@@ -660,10 +660,20 @@
                        Form front = (Form) Controls [0];
                        Form form = (Form) Controls [1];
 
+                       ActivateChild (form);
                        front.SendToBack ();
-                       ActivateChild (form);
                }
 
+               internal void ActivatePreviousChild ()
+               {
+                       if (Controls.Count <= 1)
+                               return;
+                       
+                       Form back = (Form) Controls [Controls.Count - 1];
+                       
+                       ActivateChild (back);
+               }
+
                internal void ActivateChild (Form form)
                {
                        if (Controls.Count < 1)
@@ -684,7 +694,9 @@
                                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 ()

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

Reply via email to