private Form owner;
private Form.ControlCollection owned_forms;
private MdiClient mdi_container;
+ private MdiChildContext mdi_child_context;
private Form mdi_parent;
private bool key_preview;
private MainMenu menu;
private SizeGripStyle size_grip_style;
private Rectangle maximized_bounds;
private Rectangle default_maximized_bounds;
+ Color transparency_key;\r
+
#endregion // Local Variables
#region Private & Internal Methods
maximized_bounds = Rectangle.Empty;
default_maximized_bounds = Rectangle.Empty;
owned_forms = new Form.ControlCollection(this);
+ transparency_key = Color.Empty;
}
#endregion // Public Constructor & Destructor
}
}
- [DefaultValue(typeof(Size), "{Width=0, Height=0}")]
+ [DefaultValue("{Width=0, Height=0}")]
[Localizable(true)]
[RefreshProperties(RefreshProperties.Repaint)]
public Size MaximumSize {
}
set {
+ SuspendLayout ();
+
+ // TopLevel = true;
+
+ if (!value.IsMdiContainer)
+ throw new ArgumentException ();
+
if (mdi_parent != null) {
- mdi_parent.Controls.Remove(this);
+ mdi_parent.MdiContainer.Controls.Remove (this);
}
mdi_parent = value;
if (mdi_parent != null) {
- mdi_parent.Controls.Add(this);
+ mdi_child_context = new MdiChildContext (this);
+ mdi_parent.MdiContainer.Controls.Add (this);
}
+
+ ResumeLayout ();
}
}
+ internal MdiClient MdiContainer {
+ get { return mdi_container; }
+ }
+
[DefaultValue(null)]
public MainMenu Menu {
get {
}
}
- [DefaultValue(typeof(Size), "{Width=0, Height=0}")]
+ [DefaultValue("{Width=0, Height=0}")]
[Localizable(true)]
[RefreshProperties(RefreshProperties.Repaint)]
public Size MinimumSize {
[Localizable(false)]
public Size Size {
get {
- return Size;
+ return base.Size;
}
set {
}
set {
+ if (!value && IsMdiContainer)
+ throw new ArgumentException ("MDI Container forms must be top level.");
SetTopLevel(value);
}
}
}
}
+ public Color TransparencyKey {\r
+ get {\r
+ return transparency_key;\r
+ }\r
+\r
+ set {\r
+ AllowTransparency = true;\r
+ transparency_key = value;\r
+ // TODO: change window attributes; a new driver call\r
+ }\r
+ }\r
+
[DefaultValue(FormWindowState.Normal)]
public FormWindowState WindowState {
get {
[EditorBrowsable(EditorBrowsableState.Advanced)]
protected override void WndProc(ref Message m) {
+
+ if (IsMdiChild && mdi_child_context.HandleMessage (ref m)) {
+ return;
+ }
+
switch((Msg)m.Msg) {
case Msg.WM_CLOSE: {
CancelEventArgs args = new CancelEventArgs();
}
case Msg.WM_SETFOCUS: {
-#if not
if (this.ActiveControl != null) {
ActiveControl.Focus();
+ return; // FIXME - do we need to run base.WndProc, even though we just changed focus?
}
-#endif
base.WndProc(ref m);
return;
}