+2006-12-04 Rolf Bjarne Kvinge <RKvinge@novell.com>
+
+ * 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 <toshok@ximian.com>
* PropertyGridView.cs: cached_splitter_location is only used in
throw new ArgumentException ();
if (mdi_parent != null) {
- mdi_parent.MdiContainer.original_order.Remove (this);
mdi_parent.MdiContainer.Controls.Remove (this);
}
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 ();
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
public ControlCollection(MdiClient owner) : base(owner) {
this.owner = owner;
- owner.mdi_child_list = new ArrayList ();
}
public override void Add(Control value) {
#region Public Constructors
public MdiClient()
{
+ mdi_child_list = new ArrayList ();
BackColor = SystemColors.AppWorkspace;
Dock = DockStyle.Fill;
SetStyle (ControlStyles.Selectable, false);
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);
}
// 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];