Author: pbartok
Date: 2006-08-26 20:35:44 -0400 (Sat, 26 Aug 2006)
New Revision: 64422

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
Log:
2006-08-23  Peter Dennis Bartok  <[EMAIL PROTECTED]> 

        * Form.cs (Activate): Only activate if the handle is created)
        * Control.c:
          - Mark window as invisible when it's disposed
          - Check if window handle is created when setting window visible, 
            instead of relying just on the is_created variable
          - Check if object is disposed when creating the control (Fixes #79155)



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-08-26 23:51:35 UTC (rev 64421)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-08-27 00:35:44 UTC (rev 64422)
@@ -1,3 +1,12 @@
+2006-08-23  Peter Dennis Bartok  <[EMAIL PROTECTED]> 
+
+       * Form.cs (Activate): Only activate if the handle is created)
+       * Control.c:
+         - Mark window as invisible when it's disposed
+         - Check if window handle is created when setting window visible, 
+           instead of relying just on the is_created variable
+         - Check if object is disposed when creating the control (Fixes #79155)
+
 2006-08-23  Peter Dennis Bartok  <[EMAIL PROTECTED]>
 
        * ScrollableWindow.cs (ScrollWindow): Don't actually perform layouting

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs       
2006-08-26 23:51:35 UTC (rev 64421)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs       
2006-08-27 00:35:44 UTC (rev 64422)
@@ -788,6 +788,7 @@
                                }
                        }
                        is_disposed = true;
+                       is_visible = false;
                        base.Dispose(disposing);
                }
                #endregion      // Public Constructors
@@ -2701,6 +2702,9 @@
                }
 
                public void CreateControl() {
+                       if (is_disposed) {
+                               throw new 
ObjectDisposedException(GetType().FullName.ToString());
+                       }
                        if (is_created) {
                                return;
                        }
@@ -3289,7 +3293,7 @@
                [EditorBrowsable(EditorBrowsableState.Advanced)]
                protected virtual void CreateHandle() {
                        if (IsDisposed) {
-                               throw new ObjectDisposedException(Name);
+                               throw new 
ObjectDisposedException(GetType().FullName.ToString());
                        }
 
                        if (IsHandleCreated && !is_recreating) {
@@ -3713,7 +3717,7 @@
 
                protected virtual void SetVisibleCore(bool value) {
                        if (value!=is_visible) {
-                               if (value && !is_created) {
+                               if (value && (window.Handle == IntPtr.Zero) || 
!is_created) {
                                        CreateControl();
                                }
 

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs  
2006-08-26 23:51:35 UTC (rev 64421)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs  
2006-08-27 00:35:44 UTC (rev 64422)
@@ -1132,9 +1132,11 @@
                        Form    active;
 
                        // The docs say activate only activates if our app is 
already active
-                       active = ActiveForm;
-                       if ((active != null) && (this != active)) {
-                               XplatUI.Activate(window.Handle);
+                       if (IsHandleCreated) {
+                               active = ActiveForm;
+                               if ((active != null) && (this != active)) {
+                                       XplatUI.Activate(window.Handle);
+                               }
                        }
                }
 

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

Reply via email to