Author: pbartok
Date: 2005-10-10 17:02:09 -0400 (Mon, 10 Oct 2005)
New Revision: 51531

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Hwnd.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIDriver.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIOSX.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
Log:
2005-10-10  Peter Dennis Bartok  <[EMAIL PROTECTED]>

        * XplatUI.cs, XplatUIOSX.cs, XplatUIWin32.cs: Switched from BorderStyle 
to 
          FormBorderStyle enum
        * XplatUIX11.cs: Switched BorderStyle to FormBorderStyle, added 
          code to determine FormBorderStyles from CreateParams
        * Form.cs:
          - Fixed bug where we'd set the wrong window styles if we were
            not creating an MDI window
          - Added call to XplatUI.SetBorderStyle when form borders are set
        * Control.cs: Casting BorderStyles to accommodate changed XplatUI APIs
        * Hwnd.cs:
          - Removed obsolete edge style
          - Switched from BorderStyle to FormBorderStyle
        


Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2005-10-10 20:02:13 UTC (rev 51530)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2005-10-10 21:02:09 UTC (rev 51531)
@@ -1,3 +1,18 @@
+2005-10-10  Peter Dennis Bartok  <[EMAIL PROTECTED]>
+
+       * XplatUI.cs, XplatUIOSX.cs, XplatUIWin32.cs: Switched from BorderStyle 
to 
+         FormBorderStyle enum
+       * XplatUIX11.cs: Switched BorderStyle to FormBorderStyle, added 
+         code to determine FormBorderStyles from CreateParams
+       * Form.cs:
+         - Fixed bug where we'd set the wrong window styles if we were
+           not creating an MDI window
+         - Added call to XplatUI.SetBorderStyle when form borders are set
+       * Control.cs: Casting BorderStyles to accommodate changed XplatUI APIs
+       * Hwnd.cs:
+         - Removed obsolete edge style
+         - Switched from BorderStyle to FormBorderStyle
+       
 2005-10-10  Jackson Harper  <[EMAIL PROTECTED]>
 
        * Form.cs: Use the property to get the window handle instead of

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs       
2005-10-10 20:02:13 UTC (rev 51530)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs       
2005-10-10 21:02:09 UTC (rev 51531)
@@ -734,7 +734,7 @@
                                        border_style = value;
 
                                        if (IsHandleCreated) {
-                                               
XplatUI.SetBorderStyle(window.Handle, border_style);
+                                               
XplatUI.SetBorderStyle(window.Handle, (FormBorderStyle)border_style);
                                                Refresh();
                                        }
                                }
@@ -2846,7 +2846,7 @@
                        // Find out where the window manager placed us
                        UpdateStyles();
                        if ((CreateParams.Style & (int)WindowStyles.WS_CHILD) 
!= 0) {
-                               XplatUI.SetBorderStyle(window.Handle, 
border_style);
+                               XplatUI.SetBorderStyle(window.Handle, 
(FormBorderStyle)border_style);
                        }
                        UpdateBounds();
 

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs  
2005-10-10 20:02:13 UTC (rev 51530)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs  
2005-10-10 21:02:09 UTC (rev 51531)
@@ -317,8 +317,11 @@
                        }
                        set {
                                formBorderStyle = value;
+                               if (IsHandleCreated) {
+                                       XplatUI.SetBorderStyle(window.Handle, 
formBorderStyle);
+                               }
                                UpdateStyles();
-                       }
+                       } 
                }
 
                [DefaultValue(false)]
@@ -760,14 +763,11 @@
                                cp.Width = Width;
                                cp.Height = Height;
 
+                               cp.Style |= (int)WindowStyles.WS_CLIPCHILDREN | 
(int)WindowStyles.WS_CLIPSIBLINGS;
+
                                if (IsMdiChild) {
-                                       cp.Style |= (int)WindowStyles.WS_CHILD |
-                                       (int)WindowStyles.WS_CLIPCHILDREN |
-                                       (int)WindowStyles.WS_CLIPSIBLINGS;
+                                       cp.Style |= (int)WindowStyles.WS_CHILD;
                                        cp.Parent = Parent.Handle;
-                               } else {
-                                       cp.Style |= 
(int)WindowStyles.WS_CAPTION;
-                                       cp.ExStyle |= 
(int)WindowStyles.WS_EX_OVERLAPPEDWINDOW;
                                }
 
                                if (!IsMdiChild) {
@@ -1140,6 +1140,7 @@
 
                [EditorBrowsable(EditorBrowsableState.Advanced)]
                protected override void OnHandleCreated(EventArgs e) {
+                       XplatUI.SetBorderStyle(window.Handle, formBorderStyle);
                        base.OnHandleCreated (e);
                }
 

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Hwnd.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Hwnd.cs  
2005-10-10 20:02:13 UTC (rev 51530)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Hwnd.cs  
2005-10-10 21:02:09 UTC (rev 51531)
@@ -48,8 +48,7 @@
                internal IntPtr         whole_window;
                internal IntPtr         menu_handle;
                internal TitleStyle     title_style;
-               internal BorderStyle    border_style;
-               internal Border3DStyle  edge_style;
+               internal FormBorderStyle        border_style;
                internal int            x;
                internal int            y;
                internal int            width;
@@ -75,7 +74,7 @@
                        height = 0;
                        visible = false;
                        menu_handle = IntPtr.Zero;
-                       border_style = BorderStyle.None;
+                       border_style = FormBorderStyle.None;
                        client_window = IntPtr.Zero;
                        whole_window = IntPtr.Zero;
                        handle = IntPtr.Zero;
@@ -83,7 +82,6 @@
                        invalid = Rectangle.Empty;
                        expose_pending = false;
                        nc_expose_pending = false;
-                       edge_style = Border3DStyle.Raised;
                        client_rectangle = Rectangle.Empty;
                        erase_pending = true;
                        marshal_free_list = new ArrayList(2);
@@ -134,7 +132,7 @@
                        }
                }
 
-               public static Rectangle GetWindowRectangle(BorderStyle 
border_style, IntPtr menu_handle, TitleStyle title_style, Rectangle 
client_rect) {
+               public static Rectangle GetWindowRectangle(FormBorderStyle 
border_style, IntPtr menu_handle, TitleStyle title_style, Rectangle 
client_rect) {
                        Rectangle       rect;
 
                        rect = new Rectangle(client_rect.Location, 
client_rect.Size);
@@ -149,16 +147,22 @@
                                        
Console.WriteLine("Hwnd.GetWindowRectangle: No MENU for menu_handle = {0}", 
menu_handle);
                        }
 
-                       if (border_style == BorderStyle.Fixed3D) {
-                               rect.X -= 2;
-                               rect.Y -= 2;
-                               rect.Width += 4;
-                               rect.Height += 4;
-                       } else if (border_style == BorderStyle.FixedSingle) {
-                               rect.X -= 1;
-                               rect.Y -= 1;
-                               rect.Width += 2;
-                               rect.Height += 2;
+                       switch(border_style) {
+                               case FormBorderStyle.Fixed3D: {
+                                       rect.X -= 2;
+                                       rect.Y -= 2;
+                                       rect.Width += 4;
+                                       rect.Height += 4;
+                                       break;
+                               }
+
+                               case FormBorderStyle.FixedSingle: {
+                                       rect.X -= 1;
+                                       rect.Y -= 1;
+                                       rect.Width += 2;
+                                       rect.Height += 2;
+                                       break;
+                               }
                        }
 
                        if (title_style == TitleStyle.Normal) {
@@ -172,7 +176,7 @@
                        return rect;
                }
 
-               public static Rectangle GetClientRectangle(BorderStyle 
border_style, IntPtr menu_handle, TitleStyle title_style, int width, int 
height) {
+               public static Rectangle GetClientRectangle(FormBorderStyle 
border_style, IntPtr menu_handle, TitleStyle title_style, int width, int 
height) {
                        Rectangle rect;
 
                        rect = new Rectangle(0, 0, width, height);
@@ -187,12 +191,12 @@
                                        
Console.WriteLine("Hwnd.GetClientRectangle: No MENU for menu_handle = {0}", 
menu_handle);
                        }
 
-                       if (border_style == BorderStyle.Fixed3D) {
+                       if (border_style == FormBorderStyle.Fixed3D) {
                                rect.X += 2;
                                rect.Y += 2;
                                rect.Width -= 4;
                                rect.Height -= 4;
-                       } else if (border_style == BorderStyle.FixedSingle) {
+                       } else if (border_style == FormBorderStyle.FixedSingle) 
{
                                rect.X += 1;
                                rect.Y += 1;
                                rect.Width -= 2;
@@ -212,7 +216,7 @@
                #endregion      // Static Methods
 
                #region Instance Properties
-               public BorderStyle BorderStyle {
+               public FormBorderStyle BorderStyle {
                        get {
                                return border_style;
                        }
@@ -266,12 +270,12 @@
 
                                rect = new Rectangle(0, 0, width, height);
 
-                               if (border_style == BorderStyle.Fixed3D) {
+                               if (border_style == FormBorderStyle.Fixed3D) {
                                        rect.X += 2;
                                        rect.Y += 2;
                                        rect.Width -= 4;
                                        rect.Height -= 4;
-                               } else if (border_style == 
BorderStyle.FixedSingle) {
+                               } else if (border_style == 
FormBorderStyle.FixedSingle) {
                                        rect.X += 1;
                                        rect.Y += 1;
                                        rect.Width -= 2;
@@ -290,16 +294,6 @@
                        }
                }
 
-               public Border3DStyle EdgeStyle {
-                       get {
-                               return edge_style;
-                       }
-
-                       set {
-                               edge_style = value;
-                       }
-               }
-
                public bool ErasePending {
                        get {
                                return erase_pending;
@@ -355,10 +349,10 @@
 
                                pt = new Point(0, 0);
 
-                               if (border_style == BorderStyle.Fixed3D) {
+                               if (border_style == FormBorderStyle.Fixed3D) {
                                        pt.X += 2;
                                        pt.Y += 2;
-                               } else if (border_style == 
BorderStyle.FixedSingle) {
+                               } else if (border_style == 
FormBorderStyle.FixedSingle) {
                                        pt.X += 1;
                                        pt.Y += 1;
                                }

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs       
2005-10-10 20:02:13 UTC (rev 51530)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs       
2005-10-10 21:02:09 UTC (rev 51531)
@@ -596,7 +596,7 @@
                        driver.SetAllowDrop (handle, value);
                }
 
-               internal static void SetBorderStyle(IntPtr handle, BorderStyle 
border_style) {
+               internal static void SetBorderStyle(IntPtr handle, 
FormBorderStyle border_style) {
                        #if DriverDebug
                                Console.WriteLine("SetBorderStyle({0:X}, {1}): 
Called", handle.ToInt32(), border_style);
                        #endif

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIDriver.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIDriver.cs 
2005-10-10 20:02:13 UTC (rev 51530)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIDriver.cs 
2005-10-10 21:02:09 UTC (rev 51531)
@@ -132,7 +132,7 @@
                        return DragDropEffects.None;
                }
 
-               internal abstract void SetBorderStyle(IntPtr handle, 
BorderStyle border_style);
+               internal abstract void SetBorderStyle(IntPtr handle, 
FormBorderStyle border_style);
                internal abstract void SetMenu(IntPtr handle, IntPtr 
menu_handle);
 
                internal abstract bool GetText(IntPtr handle, out string text);

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIOSX.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIOSX.cs    
2005-10-10 20:02:13 UTC (rev 51530)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIOSX.cs    
2005-10-10 21:02:09 UTC (rev 51531)
@@ -684,31 +684,7 @@
                }
                
                private void SetHwndStyles(Hwnd hwnd, CreateParams cp) {
-                       if ((cp.Style & (int)WindowStyles.WS_CHILD) != 0) {
-                               if ((cp.Style & 
(int)WindowStyles.WS_THICKFRAME) != 0) {
-                                       hwnd.BorderStyle = BorderStyle.Fixed3D;
-                               } else if ((cp.Style & 
(int)WindowStyles.WS_BORDER) != 0) {
-                                       hwnd.BorderStyle = 
BorderStyle.FixedSingle;
-                               }
-                       }
-
-                       if ((cp.ExStyle & (int)WindowStyles.WS_EX_CLIENTEDGE) 
!= 0) {
-                               hwnd.edge_style = Border3DStyle.Sunken;
-                       } else if ((cp.ExStyle & 
(int)WindowStyles.WS_EX_STATICEDGE) != 0) {
-                               hwnd.edge_style = Border3DStyle.Flat;
-                       } else if ((cp.ExStyle & 
(int)WindowStyles.WS_EX_WINDOWEDGE) != 0) {
-                               hwnd.edge_style = Border3DStyle.Raised;
-                       } else if ((cp.ExStyle & 
(int)WindowStyles.WS_EX_WINDOWEDGE) != 0) {
-                               hwnd.edge_style = Border3DStyle.Raised;
-                       }
-
-                       if ((cp.Style & (int)WindowStyles.WS_CAPTION) != 0) {
-                               if ((cp.ExStyle & 
(int)WindowStyles.WS_EX_TOOLWINDOW) != 0) {
-                                       hwnd.title_style = TitleStyle.Tool;
-                               } else {
-                                       hwnd.title_style = TitleStyle.Normal;
-                               }
-                       }
+                       throw new NotImplementedException();
                }
                
                internal void ShowCaret () {
@@ -812,7 +788,7 @@
                }
                
                internal override bool CalculateWindowRect(IntPtr hWnd, ref 
Rectangle ClientRect, int Style, int ExStyle, IntPtr MenuHandle, out Rectangle 
WindowRect) {
-                       BorderStyle     border_style;
+                       FormBorderStyle border_style;
                        TitleStyle      title_style;
 
                        title_style = TitleStyle.None;
@@ -824,13 +800,23 @@
                                }
                        }
 
-                       border_style = BorderStyle.None;
-                       if ((Style & (int)WindowStyles.WS_CHILD) != 0) {
-                               if ((Style & (int)WindowStyles.WS_THICKFRAME) 
!= 0) {
-                                       border_style = BorderStyle.Fixed3D;
-                               } else if ((Style & 
(int)WindowStyles.WS_BORDER) != 0) {
-                                       border_style = BorderStyle.FixedSingle;
+                       border_style = FormBorderStyle.None;
+                       if ((ExStyle & (int)WindowStyles.WS_EX_WINDOWEDGE) != 
0) {
+                               if ((ExStyle & 
(int)WindowStyles.WS_EX_TOOLWINDOW) != 0) {
+                                       if ((Style & 
(int)WindowStyles.WS_THICKFRAME) != 0) {
+                                               border_style = 
FormBorderStyle.SizableToolWindow;
+                                       } else {
+                                               border_style = 
FormBorderStyle.FixedToolWindow;
+                                       }
+                               } else if ((ExStyle & 
(int)WindowStyles.WS_EX_DLGMODALFRAME) != 0) {
+                                       border_style = 
FormBorderStyle.FixedDialog;
+                               } else if ((ExStyle & 
(int)WindowStyles.WS_THICKFRAME) != 0) {
+                                       border_style = FormBorderStyle.Sizable;
+                               } else {
+                                       border_style = 
FormBorderStyle.FixedSingle;
                                }
+                       } else {
+                               border_style = FormBorderStyle.Fixed3D;
                        }
 
                        WindowRect = Hwnd.GetWindowRectangle(border_style, 
MenuHandle, title_style, ClientRect);
@@ -1605,7 +1591,7 @@
                        }
                }
                
-               internal override void SetBorderStyle(IntPtr handle, 
BorderStyle border_style) {
+               internal override void SetBorderStyle(IntPtr handle, 
FormBorderStyle border_style) {
                        Hwnd    hwnd;
 
                        hwnd = Hwnd.ObjectFromHandle(handle);

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs  
2005-10-10 20:02:13 UTC (rev 51530)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs  
2005-10-10 21:02:09 UTC (rev 51531)
@@ -1689,7 +1689,7 @@
                }
 
 
-               internal override void SetBorderStyle(IntPtr handle, 
BorderStyle border_style) {
+               internal override void SetBorderStyle(IntPtr handle, 
FormBorderStyle border_style) {
                        uint    style;
                        uint    exstyle;
 
@@ -1697,19 +1697,19 @@
                        exstyle = Win32GetWindowLong(handle, 
WindowLong.GWL_EXSTYLE);
 
                        switch (border_style) {
-                               case BorderStyle.None: {
+                               case FormBorderStyle.None: {
                                        style &= ~(uint)WindowStyles.WS_BORDER;
                                        exstyle &= 
~(uint)WindowStyles.WS_EX_CLIENTEDGE;
                                        break;
                                }
 
-                               case BorderStyle.FixedSingle: {
+                               case FormBorderStyle.FixedSingle: {
                                        style |= (uint)WindowStyles.WS_BORDER;
                                        exstyle &= 
~(uint)WindowStyles.WS_EX_CLIENTEDGE;
                                        break;
                                }
 
-                               case BorderStyle.Fixed3D: {
+                               case FormBorderStyle.Fixed3D: {
                                        style &= ~(uint)WindowStyles.WS_BORDER;
                                        exstyle |= 
(uint)WindowStyles.WS_EX_CLIENTEDGE;
                                        break;

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs    
2005-10-10 20:02:13 UTC (rev 51530)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs    
2005-10-10 21:02:09 UTC (rev 51531)
@@ -564,23 +564,25 @@
                }
 
                private void SetHwndStyles(Hwnd hwnd, CreateParams cp) {
-                       if ((cp.Style & (int)WindowStyles.WS_CHILD) != 0) {
-                               if ((cp.Style & 
(int)WindowStyles.WS_THICKFRAME) != 0) {
-                                       hwnd.BorderStyle = BorderStyle.Fixed3D;
-                               } else if ((cp.Style & 
(int)WindowStyles.WS_BORDER) != 0) {
-                                       hwnd.BorderStyle = 
BorderStyle.FixedSingle;
+                       hwnd.border_style = FormBorderStyle.None;
+                       if ((cp.ExStyle & (int)WindowStyles.WS_EX_WINDOWEDGE) 
!= 0) {
+                               if ((cp.ExStyle & 
(int)WindowStyles.WS_EX_TOOLWINDOW) != 0) {
+                                       if ((cp.Style & 
(int)WindowStyles.WS_THICKFRAME) != 0) {
+                                               hwnd.border_style = 
FormBorderStyle.SizableToolWindow;
+                                       } else {
+                                               hwnd.border_style = 
FormBorderStyle.FixedToolWindow;
+                                       }
+                               } else if ((cp.ExStyle & 
(int)WindowStyles.WS_EX_DLGMODALFRAME) != 0) {
+                                       hwnd.border_style = 
FormBorderStyle.FixedDialog;
+                               } else if ((cp.ExStyle & 
(int)WindowStyles.WS_THICKFRAME) != 0) {
+                                       hwnd.border_style = 
FormBorderStyle.Sizable;
+                               } else {
+                                       hwnd.border_style = 
FormBorderStyle.FixedSingle;
                                }
+                       } else {
+                               hwnd.border_style = FormBorderStyle.Fixed3D;
                        }
 
-                       if ((cp.ExStyle & (int)WindowStyles.WS_EX_CLIENTEDGE) 
!= 0) {
-                               hwnd.edge_style = Border3DStyle.Sunken;
-                       } else if ((cp.ExStyle & 
(int)WindowStyles.WS_EX_STATICEDGE) != 0) {
-                               hwnd.edge_style = Border3DStyle.Flat;
-                       } else if ((cp.ExStyle & 
(int)WindowStyles.WS_EX_WINDOWEDGE) != 0) {
-                               hwnd.edge_style = Border3DStyle.Raised;
-                       } else if ((cp.ExStyle & 
(int)WindowStyles.WS_EX_WINDOWEDGE) != 0) {
-                               hwnd.edge_style = Border3DStyle.Raised;
-                       }
 
                        if ((cp.Style & (int)WindowStyles.WS_CAPTION) != 0) {
                                if ((cp.ExStyle & 
(int)WindowStyles.WS_EX_TOOLWINDOW) != 0) {
@@ -819,7 +821,6 @@
                                        XTranslateCoordinates(DisplayHandle, 
XGetParent(hwnd.whole_window), RootWindow, xevent.ConfigureEvent.x, 
xevent.ConfigureEvent.y, out decoration_x, out decoration_y, out child);
                                        hwnd.x = xevent.ConfigureEvent.x - 
whole_x + decoration_x;
                                        hwnd.y = xevent.ConfigureEvent.y - 
whole_y + decoration_y;
-                                       Console.WriteLine("Got configureNotify, 
window is at {0},{1}, translated to {2},{3}", xevent.ConfigureEvent.x, 
xevent.ConfigureEvent.y, hwnd.x, hwnd.y);
                                }
 
                                hwnd.width = xevent.ConfigureEvent.width;
@@ -1542,7 +1543,7 @@
                }
 
                internal override bool CalculateWindowRect(IntPtr handle, ref 
Rectangle ClientRect, int Style, int ExStyle, IntPtr MenuHandle, out Rectangle 
WindowRect) {
-                       BorderStyle     border_style;
+                       FormBorderStyle border_style;
                        TitleStyle      title_style;
 
                        title_style = TitleStyle.None;
@@ -1554,13 +1555,23 @@
                                }
                        }
 
-                       border_style = BorderStyle.None;
-                       if ((Style & (int)WindowStyles.WS_CHILD) != 0) {
-                               if ((Style & (int)WindowStyles.WS_THICKFRAME) 
!= 0) {
-                                       border_style = BorderStyle.Fixed3D;
-                               } else if ((Style & 
(int)WindowStyles.WS_BORDER) != 0) {
-                                       border_style = BorderStyle.FixedSingle;
+                       border_style = FormBorderStyle.None;
+                       if ((ExStyle & (int)WindowStyles.WS_EX_WINDOWEDGE) != 
0) {
+                               if ((ExStyle & 
(int)WindowStyles.WS_EX_TOOLWINDOW) != 0) {
+                                       if ((Style & 
(int)WindowStyles.WS_THICKFRAME) != 0) {
+                                               border_style = 
FormBorderStyle.SizableToolWindow;
+                                       } else {
+                                               border_style = 
FormBorderStyle.FixedToolWindow;
+                                       }
+                               } else if ((ExStyle & 
(int)WindowStyles.WS_EX_DLGMODALFRAME) != 0) {
+                                       border_style = 
FormBorderStyle.FixedDialog;
+                               } else if ((ExStyle & 
(int)WindowStyles.WS_THICKFRAME) != 0) {
+                                       border_style = FormBorderStyle.Sizable;
+                               } else {
+                                       border_style = 
FormBorderStyle.FixedSingle;
                                }
+                       } else {
+                               border_style = FormBorderStyle.Fixed3D;
                        }
 
                        WindowRect = Hwnd.GetWindowRectangle(border_style, 
MenuHandle, title_style, ClientRect);
@@ -2650,7 +2661,7 @@
                                case XEventName.Expose: {
                                        if (!client) {
                                                switch (hwnd.border_style) {
-                                                       case 
BorderStyle.Fixed3D: {
+                                                       case 
FormBorderStyle.Fixed3D: {
                                                                Graphics g;
 
                                                                g = 
Graphics.FromHwnd(hwnd.whole_window);
@@ -2659,7 +2670,7 @@
                                                                break;
                                                        }
 
-                                                       case 
BorderStyle.FixedSingle: {
+                                                       case 
FormBorderStyle.FixedSingle: {
                                                                Graphics g;
 
                                                                g = 
Graphics.FromHwnd(hwnd.whole_window);
@@ -3192,7 +3203,7 @@
                        // We allow drop on all windows
                }
 
-               internal override void SetBorderStyle(IntPtr handle, 
BorderStyle border_style) {
+               internal override void SetBorderStyle(IntPtr handle, 
FormBorderStyle border_style) {
                        Hwnd    hwnd;
 
                        hwnd = Hwnd.ObjectFromHandle(handle);

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to