Author: rolf
Date: 2007-05-16 14:35:36 -0400 (Wed, 16 May 2007)
New Revision: 77499

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiClient.cs
   
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiWindowManager.cs
Log:
* MaskedTextBox.cs: Small fix for Text that fixes a broken test.

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-05-16 18:00:27 UTC (rev 77498)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-05-16 18:35:36 UTC (rev 77499)
@@ -1,3 +1,7 @@
+2007-05-16  Rolf Bjarne Kvinge <[EMAIL PROTECTED]> 
+
+       * MaskedTextBox.cs: Small fix for Text that fixes a broken test.
+
 2007-05-16  Andreia Gaita <[EMAIL PROTECTED]> 
 
        * ContainerControl.cs: only process tab key if there are no 

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs       
2007-05-16 18:00:27 UTC (rev 77498)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs       
2007-05-16 18:35:36 UTC (rev 77499)
@@ -5232,10 +5232,11 @@
                        else {
                                if (parent != null && Focused) {
                                        Control container;
-
+                                       Form frm = this as Form;
+                                       
                                        // Need to start at parent, 
GetContainerControl might return ourselves if we're a container
                                        container = 
(Control)parent.GetContainerControl();
-                                       if (container != null) {
+                                       if (container != null && (frm == null 
|| !frm.IsMdiChild)) {
                                                
container.SelectNextControl(this, true, true, true, 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-05-16 18:00:27 UTC (rev 77498)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiClient.cs     
2007-05-16 18:35:36 UTC (rev 77499)
@@ -613,8 +613,13 @@
                                        next.WindowState = 
FormWindowState.Maximized;
                                ActivateChild (next);
                        }
-
+       
+                       form.Visible = false;
                        Controls.Remove (form);
+                       
+                       if (Controls.Count == 0) {
+                               ((MdiWindowManager) 
form.window_manager).RaiseDeactivate ();
+                       }
 
                        if (Controls.Count == 0) {
                                XplatUI.RequestNCRecalc (Parent.Handle);
@@ -695,8 +700,11 @@
                                        XplatUI.InvalidateNC (current.Handle);
                                if (form.IsHandleCreated)
                                        XplatUI.InvalidateNC (form.Handle);
-                               if (raise_deactivate)
-                                       current.OnDeactivateInternal ();
+                               if (raise_deactivate) {
+                                       MdiWindowManager current_wm = 
(MdiWindowManager) current.window_manager;
+                                       current_wm.RaiseDeactivate ();
+                                       
+                               }
                        }
                        active_child = (Form) Controls [0];
                        
@@ -704,7 +712,8 @@
                                bool raise_activated = ParentForm.ActiveControl 
!= active_child;
                                ParentForm.ActiveControl = active_child;
                                if (raise_activated) {
-                                       active_child.OnActivatedInternal ();
+                                       MdiWindowManager active_wm = 
(MdiWindowManager) active_child.window_manager;
+                                       active_wm.RaiseActivated ();
                                }
                        }
                }

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiWindowManager.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiWindowManager.cs  
    2007-05-16 18:00:27 UTC (rev 77498)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiWindowManager.cs  
    2007-05-16 18:35:36 UTC (rev 77499)
@@ -52,7 +52,25 @@
 
                private TitleButtons maximized_title_buttons;
                private bool is_visible_pending;
+               private byte last_activation_event; // 0 = none, 1 = activated, 
2 = deactivated.
 
+               public void RaiseActivated ()
+               {
+                       if (last_activation_event == 1)
+                               return;
+                       
+                       last_activation_event = 1;
+                       form.OnActivatedInternal ();
+               }
+               
+               public void RaiseDeactivate ()
+               {
+                       if (last_activation_event == 2)
+                               return;
+                       last_activation_event = 2;
+                       form.OnDeactivateInternal ();
+               }
+
                public override int MenuHeight {
                        get {
                                // Mdi children don't get menus on the form, 
they're shown on the main form.

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

Reply via email to