Author: jackson
Date: 2005-09-27 23:15:36 -0400 (Tue, 27 Sep 2005)
New Revision: 50916
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
Log:
* Form.cs (CreateParams): Setup MDI forms correctly.
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2005-09-28 02:53:22 UTC (rev 50915)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2005-09-28 03:15:36 UTC (rev 50916)
@@ -1,5 +1,9 @@
2005-09-27 Jackson Harper <[EMAIL PROTECTED]>
+ * Form.cs (CreateParams): Setup MDI forms correctly.
+
+2005-09-27 Jackson Harper <[EMAIL PROTECTED]>
+
* MdiChildContext.cs:
* MonthCalendar.cs:
* UpDownBase.cs:
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
2005-09-28 02:53:22 UTC (rev 50915)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
2005-09-28 03:15:36 UTC (rev 50916)
@@ -724,19 +724,18 @@
#endregion // Public Instance Properties
#region Protected Instance Properties
- [MonoTODO("Need to add MDI support")]
+ [MonoTODO("Need to set start position properly")]
protected override CreateParams CreateParams {
get {
- CreateParams cp;
+ CreateParams cp = new CreateParams ();
- cp = new CreateParams();
-
cp.Caption = Text;
cp.ClassName = XplatUI.DefaultClassName;
cp.ClassStyle = 0;
cp.ExStyle = 0;
cp.Param = 0;
cp.Parent = IntPtr.Zero;
+
// if (start_position ==
FormStartPosition.WindowsDefaultLocation) {
cp.X = unchecked((int)0x80000000);
cp.Y = unchecked((int)0x80000000);
@@ -747,9 +746,19 @@
cp.Width = Width;
cp.Height = Height;
- cp.Style = (int)(WindowStyles.WS_CLIPSIBLINGS |
WindowStyles.WS_CLIPCHILDREN);
+ if (IsMdiChild) {
+ cp.Style |= (int)WindowStyles.WS_CHILD;
+ cp.Style |=
(int)WindowStyles.WS_CLIPCHILDREN;
+ cp.Style |=
(int)WindowStyles.WS_CLIPSIBLINGS;
+ cp.Parent = Parent.Handle;
+ } else {
+ cp.Style |=
(int)WindowStyles.WS_CAPTION;
+ cp.ExStyle |=
(int)WindowStyles.WS_EX_OVERLAPPEDWINDOW;
+ }
- switch (FormBorderStyle) {
+ if (!IsMdiChild) {
+ switch (FormBorderStyle) {
+
case FormBorderStyle.Fixed3D: {
cp.Style |=
(int)WindowStyles.WS_CAPTION;
cp.ExStyle |=
(int)WindowStyles.WS_EX_OVERLAPPEDWINDOW;
@@ -785,6 +794,7 @@
cp.ExStyle |=
(int)(WindowStyles.WS_EX_WINDOWEDGE | WindowStyles.WS_EX_TOOLWINDOW);
break;
}
+ }
}
if (ShowInTaskbar) {
@@ -806,6 +816,7 @@
if (HelpButton) {
cp.ExStyle |=
(int)WindowStyles.WS_EX_CONTEXTHELP;
}
+
return cp;
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches