2008-06-27 Ivan N. Zlatev <contact@i-nz.net>
authorIvan Zlatev <ivan@ivanz.com>
Fri, 27 Jun 2008 02:01:11 +0000 (02:01 -0000)
committerIvan Zlatev <ivan@ivanz.com>
Fri, 27 Jun 2008 02:01:11 +0000 (02:01 -0000)
* XplatUIX11.cs, InternalWindowManager.cs:
If WS_EX_TOOLWINDOW is set in the CreateParams for a form MS
doesn't automagically update the FormBorderStyle, so we must
double check the CreateParams explicitly to determine if the
window is a toolwindow.
* ThemeWin32Classic.cs: Use InternalWindowManager.IsToolWindow
instead of doing custom checks.

Fixes toolwindows for the test case in bug #402446

svn path=/trunk/mcs/; revision=106722

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/InternalWindowManager.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs

index b5879a18f055c54687d72b13e4ca2a12066b5ee6..09e0568aa05f2d93edac038ecb8d5cd43ceb243e 100644 (file)
@@ -1,8 +1,22 @@
+2008-06-27  Ivan N. Zlatev  <contact@i-nz.net>
+
+       * XplatUIX11.cs, InternalWindowManager.cs: 
+       If WS_EX_TOOLWINDOW is set in the CreateParams for a form MS 
+       doesn't automagically update the FormBorderStyle, so we must 
+       double check the CreateParams explicitly to determine if the 
+       window is a toolwindow.
+       * ThemeWin32Classic.cs: Use InternalWindowManager.IsToolWindow 
+       instead of doing custom checks.
+
+       Fixes toolwindows for the test case in bug #402446
+
 2008-06-27  Ivan N. Zlatev  <contact@i-nz.net>
 
        * Control.cs: Visibility of the control should be false 
        when the handle is destroyed in WmDestroy and not immediately 
-       in Dispose().
+       in Dispose(). This is effectively where the disposing process 
+       ends even though the control is marked as Disposed immediately 
+       after calling Dispose().
        [Fixes bug #402446]
 
 2008-06-27  Ivan N. Zlatev  <contact@i-nz.net>
index 02ed43ad85997f502a63fcd752762ba9bc1cd108..79b4de50ade663f03124e4a2529d9700bbd81466 100644 (file)
@@ -714,7 +714,8 @@ namespace System.Windows.Forms {
                public bool IsToolWindow {
                        get {
                                if (form.FormBorderStyle == FormBorderStyle.SizableToolWindow ||
-                                               form.FormBorderStyle == FormBorderStyle.FixedToolWindow)
+                                   form.FormBorderStyle == FormBorderStyle.FixedToolWindow || 
+                                   form.GetCreateParams().IsSet (WindowExStyles.WS_EX_TOOLWINDOW))
                                        return true;
                                return false;
                        }
index 5d1a57e5d3a8e867689b0c36cd14614efd062bf0..87cc7c28848a07f8cf05f20f9508982ae24c6889 100644 (file)
@@ -6073,7 +6073,7 @@ namespace System.Windows.Forms
 
                public override int ManagedWindowBorderWidth (InternalWindowManager wm)
                {
-                       if (wm is ToolWindowManager && wm.form.FormBorderStyle == FormBorderStyle.FixedToolWindow)
+                       if (wm.IsToolWindow)
                                return 3;
                        else
                                return 4;
index 6c69838d15436ef914d1622844e51afeaaff49d4..57619c3cbb167a8dce4123e367e76c21f23bf6ff 100644 (file)
@@ -5141,9 +5141,13 @@ namespace System.Windows.Forms {
 
                internal override void SetBorderStyle(IntPtr handle, FormBorderStyle border_style) {
                        Form form = Control.FromHandle (handle) as Form;
-                       if (form != null && form.window_manager == null && (border_style == FormBorderStyle.FixedToolWindow ||
-                                       border_style == FormBorderStyle.SizableToolWindow)) {
-                               form.window_manager = new ToolWindowManager (form);
+                       if (form != null && form.window_manager == null) {
+                               CreateParams cp = form.GetCreateParams ();
+                               if (border_style == FormBorderStyle.FixedToolWindow ||
+                                    border_style == FormBorderStyle.SizableToolWindow || 
+                                    cp.IsSet (WindowExStyles.WS_EX_TOOLWINDOW)) {
+                                       form.window_manager = new ToolWindowManager (form);
+                               }
                        }
                        
                        RequestNCRecalc(handle);