Browse Source

Revert rev.68635 changes to Form.cs and PrintPreviewDialog.cs

* Form.cs: Revert previous change (remove call UpdateBounds
from form constructor), because it messes with the handle creation
order, and that one needs lots and lots of love.

* PrintPreviewDialog.cs: Revert change to CreateHandle (add check
for valid printer and throw InvalidPrinterException if document
is set but printer not valid), adding a MonoTODO. Once 
handle creation is done properly, we can put this back in.

2006-11-29  Andreia Gaita  <[email protected]>

svn path=/trunk/mcs/; revision=68671
Andreia Gaita 19 năm trước cách đây
mục cha
commit
2b52ca9008

+ 10 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog

@@ -1,3 +1,13 @@
+2006-11-29  Andreia Gaita  <[email protected]>
+	
+	* Form.cs: Revert previous change (remove call UpdateBounds
+	from form constructor), because it messes with the handle creation
+	order, and that one needs lots and lots of love.
+	* PrintPreviewDialog.cs: Revert change to CreateHandle (add check
+	for valid printer and throw InvalidPrinterException if document
+	is set but printer not valid), adding a MonoTODO. Once 
+	handle creation is done properly, we can put this back in.
+
 2006-11-28  Everaldo Canuto  <[email protected]>
 
 	* MenuItem.cs: Create a invalidate method for menu item, to be

+ 3 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs

@@ -177,6 +177,9 @@ namespace System.Windows.Forms {
 			owned_forms = new Form.ControlCollection(this);
 			transparency_key = Color.Empty;
 
+			// FIXME: this should disappear just as soon as the handle creation is done in the right place (here is too soon()
+			UpdateBounds();
+
 		}
 		#endregion	// Public Constructor & Destructor
 

+ 5 - 3
mcs/class/Managed.Windows.Forms/System.Windows.Forms/PrintPreviewDialog.cs

@@ -879,10 +879,12 @@ namespace System.Windows.Forms {
 			}
 		}
 
+		[MonoTODO("Throw InvalidPrinterException")]
 		protected override void CreateHandle() {
-			if (this.Document != null && !this.Document.PrinterSettings.IsValid) {
-				throw new InvalidPrinterException(this.Document.PrinterSettings);
-			}
+
+//			if (this.Document != null && !this.Document.PrinterSettings.IsValid) {
+//				throw new InvalidPrinterException(this.Document.PrinterSettings);
+//			}
 			base.CreateHandle ();
 		}