private bool lock_sizing;
private bool initializing_scrollbars;
private int prev_bottom;
- private LayoutEventHandler initial_layout_handler;
private bool setting_windowstates = false;
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);
prev_bottom = Bottom;
}
- private void FormLocationChanged (object sender, EventArgs e)
- {
- SizeScrollBars ();
- }
-
internal void ArrangeIconicWindows ()
{
int xspacing = 160;
}
}
} while (!success);
- Console.WriteLine("IconicBounds = {0}", rect);
wm.IconicBounds = rect;
form.Bounds = wm.IconicBounds;
}
Controls.Remove (form);
form.Close ();
+
+ XplatUI.RequestNCRecalc (Handle);
+ if (Controls.Count == 0) {
+ XplatUI.RequestNCRecalc (Parent.Handle);
+ ParentForm.PerformLayout ();
+ }
+ SizeScrollBars ();
+ SetParentText (false);
}
internal void ActivateNextChild ()
{
if (Controls.Count < 1)
return;
-
+
+ if (ParentForm.is_changing_visible_state)
+ return;
+
Form current = (Form) Controls [0];
form.SuspendLayout ();
form.BringToFront ();
SetWindowStates ((MdiWindowManager) form.window_manager);
form.ResumeLayout (false);
if (current != form) {
+ form.has_focus = false;
XplatUI.InvalidateNC (current.Handle);
XplatUI.InvalidateNC (form.Handle);
}
+ active_child = (Form) Controls [0];
}
internal bool SetWindowStates (MdiWindowManager wm)
internal Form ActiveMdiChild {
get {
+#if NET_2_0
+ if (!ParentForm.Visible)
+ return null;
+#endif
if (Controls.Count < 1)
return null;
- return (Form) Controls [0];
+
+ if (!ParentForm.IsHandleCreated)
+ return null;
+
+ if (!ParentForm.has_been_visible)
+ return null;
+
+ if (!ParentForm.Visible)
+ return active_child;
+
+ active_child = null;
+ for (int i = 0; i < Controls.Count; i++) {
+ if (Controls [i].Visible) {
+ active_child = (Form) Controls [i];
+ break;
+ }
+ }
+ return active_child;
}
set {
ActivateChild (value);
}
}
+
+ internal void ActivateActiveMdiChild ()
+ {
+ if (ParentForm.is_changing_visible_state)
+ return;
+
+ for (int i = 0; i < Controls.Count; i++) {
+ if (Controls [i].Visible) {
+ ActivateChild ((Form) Controls [i]);
+ return;
+ }
+ }
+ }
}
}