Author: pbartok
Date: 2005-03-11 16:21:48 -0500 (Fri, 11 Mar 2005)
New Revision: 41724

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/XplatUIX11.cs
Log:
2005-03-11  Peter Bartok  <[EMAIL PROTECTED]>
        * Control.cs: Changed OnCreateControl behaviour based on a suggestion
          from Jonathan Gilbert; should fix bug #73606
        * XplatUIX11.cs: Fixed NC Mouse message coordinates, they need to be
          in Screen coordinates. Thanks, Jordi.
        * Form.cs: Added missing attribute



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2005-03-11 21:20:14 UTC (rev 41723)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2005-03-11 21:21:48 UTC (rev 41724)
@@ -5,6 +5,14 @@
 
 2005-03-11  Peter Bartok  <[EMAIL PROTECTED]>
 
+       * Control.cs: Changed OnCreateControl behaviour based on a suggestion
+         from Jonathan Gilbert; should fix bug #73606
+       * XplatUIX11.cs: Fixed NC Mouse message coordinates, they need to be
+         in Screen coordinates. Thanks, Jordi.
+       * Form.cs: Added missing attribute
+
+2005-03-11  Peter Bartok  <[EMAIL PROTECTED]>
+
        * Form.cs:
          - Rudimentary Mdi support
          - Removed outdated FormParent code

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs       
2005-03-11 21:20:14 UTC (rev 41723)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs       
2005-03-11 21:21:48 UTC (rev 41724)
@@ -62,6 +62,7 @@
                internal string                 name;                   // for 
object naming
 
                // State
+               private bool                    create_handled;         // true 
if OnCreateControl has been sent
                internal bool                   has_focus;              // true 
if control has focus
                internal bool                   is_visible;             // true 
if control is visible
                internal bool                   is_entered;             // is 
the mouse inside the control?
@@ -527,6 +528,7 @@
                        prev_size = Size.Empty;
                        anchor_style = AnchorStyles.Top | AnchorStyles.Left;
 
+                       create_handled = false;
                        is_visible = true;
                        is_captured = false;
                        is_disposed = false;
@@ -2036,18 +2038,19 @@
                                CreateHandle();
                        }
 
+                       if (!create_handled) {
+                               create_handled = true;
+                               OnCreateControl();
+                       }
+
                        for (int i=0; i<child_controls.Count; i++) {
-                               if (!child_controls[i].IsHandleCreated) {
-                                       child_controls[i].CreateHandle();
-                               }
+                               child_controls[i].CreateControl();
                        }
-
-                       OnCreateControl();
                }
 
                public Graphics CreateGraphics() {
                        if (!IsHandleCreated) {
-                               this.CreateHandle();
+                               this.CreateControl();
                        }
                        return Graphics.FromHwnd(this.window.Handle);
                }
@@ -2510,7 +2513,7 @@
 
                public void Show() {
                        if (!IsHandleCreated) {
-                               this.CreateHandle();
+                               this.CreateControl();
                        }
 
                        this.Visible=true;
@@ -2556,11 +2559,6 @@
                                window = new ControlNativeWindow(this);
                                window.CreateHandle(CreateParams);
 
-                               // window is only null if the handle is created 
for the first time; make sure OnCreateControl is triggered
-                               // This also causes our children to be created 
ona CreateHandle call, which shouldn't really be a problem 
-                               // but may not match MS
-                               CreateControl();
-
                                // Find out where the window manager placed us
                                UpdateBounds();
                                UpdateStyles();
@@ -2776,7 +2774,7 @@
                                        
((Control)child.Current).RecreateHandle();
                                }
                        } else {
-                               CreateHandle();
+                               CreateControl();
                        }
 
                        is_recreating = false;
@@ -3029,6 +3027,8 @@
                                        }
                                } else {
                                        this.CreateBuffers(bounds.Width, 
bounds.Height);
+
+                                       CreateControl();
                                }
 
                                if (value == false && parent != null) {
@@ -3810,7 +3810,7 @@
                        } else {
                                if (!is_disposed) {
                                        if (!this.IsHandleCreated) {
-                                               this.CreateHandle();
+                                               this.CreateControl();
                                        }
                                        PerformLayout();
                                }

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs  
2005-03-11 21:20:14 UTC (rev 41723)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs  
2005-03-11 21:21:48 UTC (rev 41724)
@@ -1150,6 +1150,7 @@
                }
 
                // LAMESPEC - Not documented that Form overrides 
ProcessDialogChar; class-status showed
+               [EditorBrowsable (EditorBrowsableState.Advanced)]
                protected override bool ProcessDialogChar(char charCode) {
                        return base.ProcessDialogChar (charCode);
                }

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs    
2005-03-11 21:20:14 UTC (rev 41723)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs    
2005-03-11 21:21:48 UTC (rev 41724)
@@ -1953,21 +1953,36 @@
                                        switch(xevent.ButtonEvent.button) {
                                                case 1: {
                                                        MouseState |= 
MouseButtons.Left;
-                                                       msg.message = client ? 
Msg.WM_LBUTTONDOWN : Msg.WM_NCLBUTTONDOWN;
+                                                       if (client) {
+                                                               msg.message = 
Msg.WM_LBUTTONDOWN;
+                                                       } else {
+                                                               msg.message = 
Msg.WM_NCLBUTTONDOWN;
+                                                               ClientToScreen 
(msg.hwnd, ref xevent.ButtonEvent.x, ref xevent.ButtonEvent.y);
+                                                       }
                                                        
msg.wParam=GetMousewParam(0);
                                                        break;
                                                }
 
                                                case 2: {
                                                        MouseState |= 
MouseButtons.Middle;
-                                                       msg.message = client ? 
Msg.WM_MBUTTONDOWN : Msg.WM_NCMBUTTONDOWN;
+                                                       if (client) {
+                                                               msg.message = 
Msg.WM_MBUTTONDOWN;
+                                                       } else {
+                                                               msg.message = 
Msg.WM_NCMBUTTONDOWN;
+                                                               ClientToScreen 
(msg.hwnd, ref xevent.ButtonEvent.x, ref xevent.ButtonEvent.y);
+                                                       }
                                                        
msg.wParam=GetMousewParam(0);
                                                        break;
                                                }
 
                                                case 3: {
                                                        MouseState |= 
MouseButtons.Right;
-                                                       msg.message = client ? 
Msg.WM_RBUTTONDOWN : Msg.WM_NCRBUTTONDOWN;
+                                                       if (client) {
+                                                               msg.message = 
Msg.WM_RBUTTONDOWN;
+                                                       } else {
+                                                               msg.message = 
Msg.WM_NCRBUTTONDOWN;
+                                                               ClientToScreen 
(msg.hwnd, ref xevent.ButtonEvent.x, ref xevent.ButtonEvent.y);
+                                                       }
                                                        
msg.wParam=GetMousewParam(0);
                                                        break;
                                                }

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

Reply via email to