Author: rolf
Date: 2006-12-04 12:10:17 -0500 (Mon, 04 Dec 2006)
New Revision: 68974

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
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuItem.cs
Log:
2006-12-04  Rolf Bjarne Kvinge  <[EMAIL PROTECTED]>

        * Form.cs: When a form's MdiParent is set add it directly
        on top of the z-order in stead of relying on MdiClient's
        ActivateChild to do it. Fixes #80135.
        
        * MdiClient.cs: 
        - Remove original_order, mdi_child_list is already doing
        the same thing.
        - Create mdi_child_list on construction in
        stead of first use (avoids a few null checks).

        * MenuItem.cs: Use an already existing list of mdi children
        to get the correct order of children and remove the other
        redundant list.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-12-04 17:08:54 UTC (rev 68973)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-12-04 17:10:17 UTC (rev 68974)
@@ -1,3 +1,19 @@
+2006-12-04  Rolf Bjarne Kvinge  <[EMAIL PROTECTED]>
+
+       * Form.cs: When a form's MdiParent is set add it directly
+       on top of the z-order in stead of relying on MdiClient's
+       ActivateChild to do it. Fixes #80135.
+       
+       * MdiClient.cs: 
+       - Remove original_order, mdi_child_list is already doing
+       the same thing.
+       - Create mdi_child_list on construction in
+       stead of first use (avoids a few null checks).
+
+       * MenuItem.cs: Use an already existing list of mdi children
+       to get the correct order of children and remove the other
+       redundant list.
+
 2006-12-04  Chris Toshok  <[EMAIL PROTECTED]>
 
        * PropertyGridView.cs: cached_splitter_location is only used in

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs  
2006-12-04 17:08:54 UTC (rev 68973)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs  
2006-12-04 17:10:17 UTC (rev 68974)
@@ -553,7 +553,6 @@
                                        throw new ArgumentException ();
 
                                if (mdi_parent != null) {
-                                       
mdi_parent.MdiContainer.original_order.Remove (this);
                                        mdi_parent.MdiContainer.Controls.Remove 
(this);
                                }
 
@@ -561,8 +560,8 @@
                                        mdi_parent = value;
                                        window_manager = new MdiWindowManager 
(this,
                                                        
mdi_parent.MdiContainer);
-                                       
mdi_parent.MdiContainer.original_order.Add (this);
                                        mdi_parent.MdiContainer.Controls.Add 
(this);
+                                       
mdi_parent.MdiContainer.Controls.SetChildIndex (this, 0);
 
                                        RecreateHandle ();
 

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiClient.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiClient.cs     
2006-12-04 17:08:54 UTC (rev 68973)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiClient.cs     
2006-12-04 17:10:17 UTC (rev 68974)
@@ -50,7 +50,6 @@
                internal ArrayList mdi_child_list;
                private string form_text;
                private bool setting_form_text;
-               internal ArrayList original_order = new ArrayList (); // The 
order the child forms are added (used by the main menu to show the window menu)
                private Form active_child;
 
                #endregion      // Local Variables
@@ -62,7 +61,6 @@
                        
                        public ControlCollection(MdiClient owner) : base(owner) 
{
                                this.owner = owner;
-                               owner.mdi_child_list = new ArrayList ();
                        }
 
                        public override void Add(Control value) {
@@ -96,6 +94,7 @@
                #region Public Constructors
                public MdiClient()
                {
+                       mdi_child_list = new ArrayList ();
                        BackColor = SystemColors.AppWorkspace;
                        Dock = DockStyle.Fill;
                        SetStyle (ControlStyles.Selectable, false);

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuItem.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuItem.cs      
2006-12-04 17:08:54 UTC (rev 68973)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuItem.cs      
2006-12-04 17:10:17 UTC (rev 68974)
@@ -610,10 +610,13 @@
                                        if (mdicontainer == null)
                                                break;
 
+                                       
                                        // Remove closed forms
-                                       foreach (MenuItem item in 
mdilist_items.Keys) {
+                                       MenuItem[] items = new 
MenuItem[mdilist_items.Count];
+                                       mdilist_items.Keys.CopyTo (items, 0);
+                                       foreach (MenuItem item in items) {
                                                Form mdichild = (Form) 
mdilist_items [item];
-                                               if 
(!mdicontainer.original_order.Contains (mdichild)) {
+                                               if 
(!mdicontainer.mdi_child_list.Contains(mdichild)) {
                                                        mdilist_items.Remove 
(item);
                                                        mdilist_forms.Remove 
(mdichild);
                                                        MenuItems.Remove (item);
@@ -621,8 +624,8 @@
                                        }
                                        
                                        // Add new forms and update state for 
existing forms.
-                                       for ( int i = 0; i < 
mdicontainer.original_order.Count; i++) {
-                                               Form mdichild = (Form) 
mdicontainer.original_order [i];
+                                       for (int i = 0; i < 
mdicontainer.mdi_child_list.Count; i++) {
+                                               Form mdichild = 
(Form)mdicontainer.mdi_child_list[i];
                                                MenuItem item;
                                                if (mdilist_forms.Contains 
(mdichild)) {
                                                        item = (MenuItem) 
mdilist_forms [mdichild];

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

Reply via email to