[Mono-list] Patch to Sys.Win.Forms/Sys.Drawing 2/2

Alexandre Pigolkine pigolkine@gmx.de
20 Feb 2003 00:22:02 +0100


Index: ChangeLog
===================================================================
RCS file: /mono/mcs/class/System.Drawing/System.Drawing/ChangeLog,v
retrieving revision 1.27
diff -u -r1.27 ChangeLog
--- ChangeLog	8 Feb 2003 20:07:42 -0000	1.27
+++ ChangeLog	19 Feb 2003 22:48:24 -0000
@@ -1,3 +1,10 @@
+2003-02-19  Alexandre Pigolkine <pigolkine@gmx.de>
+	* Font.cs
+	* Graphics.cs
+	* Image.cs
+	* SystemBrushes.cs
+			small changes to be able to run SWF apps
+
 2003-02-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
 
 	* Graphics.cs: stubbed out all the methods.
Index: Font.cs
===================================================================
RCS file: /mono/mcs/class/System.Drawing/System.Drawing/Font.cs,v
retrieving revision 1.1
diff -u -r1.1 Font.cs
--- Font.cs	8 Feb 2003 10:15:05 -0000	1.1
+++ Font.cs	19 Feb 2003 22:48:24 -0000
@@ -9,11 +9,11 @@
 
 		public static Font FromHfont(IntPtr font)
 		{
-			return null;
-		}	
+			return new Font("Arial", (float)12.0, FontStyle.Regular);
+		}
+
+		public IntPtr ToHfont () { return IntPtr.Zero; }
 
-		public IntPtr ToHfont () { return (IntPtr) 0; }
-		
 		public Font(FontFamily family, float size, FontStyle style)
 		{
 		}
@@ -21,5 +21,6 @@
 		public Font(string familyName, float size, FontStyle style)
 		{
 		}
+
 	}
 }
Index: Graphics.cs
===================================================================
RCS file: /mono/mcs/class/System.Drawing/System.Drawing/Graphics.cs,v
retrieving revision 1.5
diff -u -r1.5 Graphics.cs
--- Graphics.cs	8 Feb 2003 20:07:42 -0000	1.5
+++ Graphics.cs	19 Feb 2003 22:48:24 -0000
@@ -27,6 +27,7 @@
 
 		private Graphics (IntPtr nativeGraphics)
 		{
+			hdc_ = nativeGraphics;
 		}
 
 		[MonoTODO]
@@ -62,7 +63,6 @@
 		[MonoTODO]
 		public void Dispose ()
 		{
-			throw new NotImplementedException ();
 		}
 
 		[MonoTODO]
@@ -542,37 +542,37 @@
 		[MonoTODO]
 		public void DrawString (string s, Font font, Brush brush, RectangleF layoutRectangle)
 		{
-			throw new NotImplementedException ();
+			//throw new NotImplementedException ();
 		}
 
 		[MonoTODO]
 		public void DrawString (string s, Font font, Brush brush, PointF point)
 		{
-			throw new NotImplementedException ();
+			//throw new NotImplementedException ();
 		}
 
 		[MonoTODO]
 		public void DrawString (string s, Font font, Brush brush, PointF point, StringFormat format)
 		{
-			throw new NotImplementedException ();
+			//throw new NotImplementedException ();
 		}
 
 		[MonoTODO]
 		public void DrawString (string s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format)
 		{
-			throw new NotImplementedException ();
+			//throw new NotImplementedException ();
 		}
 
 		[MonoTODO]
 		public void DrawString (string s, Font font, Brush brush, float x, float y)
 		{
-			throw new NotImplementedException ();
+			//throw new NotImplementedException ();
 		}
 
 		[MonoTODO]
 		public void DrawString (string s, Font font, Brush brush, float x, float y, StringFormat format)
 		{
-			throw new NotImplementedException ();
+			//throw new NotImplementedException ();
 		}
 
 		[MonoTODO]
@@ -971,10 +971,12 @@
 			throw new NotImplementedException ();
 		}
 
+		IntPtr hdc_ = IntPtr.Zero;
 		[MonoTODO]
 		public static Graphics FromHdc (IntPtr hdc)
 		{
-			throw new NotImplementedException ();
+			Graphics result = new Graphics(hdc);
+			return result;
 		}
 
 		[MonoTODO]
@@ -1016,7 +1018,7 @@
 		[MonoTODO]
 		public IntPtr GetHdc ()
 		{
-			throw new NotImplementedException ();
+			return hdc_;
 		}
 
 		[MonoTODO]
@@ -1154,7 +1156,6 @@
 		[MonoTODO]
 		public void ReleaseHdc (IntPtr hdc)
 		{
-			throw new NotImplementedException ();
 		}
 
 		[MonoTODO]
@@ -1307,7 +1308,7 @@
 				throw new NotImplementedException ();
 			}
 			set {
-				throw new NotImplementedException ();
+				//throw new NotImplementedException ();
 			}
 		}
 
Index: Image.cs
===================================================================
RCS file: /mono/mcs/class/System.Drawing/System.Drawing/Image.cs,v
retrieving revision 1.5
diff -u -r1.5 Image.cs
--- Image.cs	12 Sep 2002 18:17:15 -0000	1.5
+++ Image.cs	19 Feb 2003 22:48:24 -0000
@@ -17,7 +17,7 @@
 //[Serializable]
 //[ComVisible(true)]
 
-public abstract class Image : MarshalByRefObject /*, ICloneable, IDisposable, ISerializable */ {
+public abstract class Image : MarshalByRefObject, IDisposable /*, ICloneable, ISerializable */ {
 
 	// constructor
 	public Image () {}
@@ -192,7 +192,12 @@
 			throw new NotImplementedException ();
 		}
 	}
-	
+	[MonoTODO]
+	public void Dispose ()
+	{
+		throw new NotImplementedException ();
+	}
+
 }
 
 }
Index: SystemBrushes.cs
===================================================================
RCS file: /mono/mcs/class/System.Drawing/System.Drawing/SystemBrushes.cs,v
retrieving revision 1.3
diff -u -r1.3 SystemBrushes.cs
--- SystemBrushes.cs	10 Feb 2003 06:26:40 -0000	1.3
+++ SystemBrushes.cs	19 Feb 2003 22:48:24 -0000
@@ -30,7 +30,7 @@
 
 		public static Brush ControlText {
 			get {
-				throw new NotImplementedException();
+				return new SolidBrush(Color.Black);
 			}
 		}