Browse Source

2004-02-07 Andreas Nahr <[email protected]>

	* SRDescriptionAttribute.cs: Added and implemented
	* ToolboxBitmapAttribute.cs: Implemented a few members
	* SystemIcons.cs: Stubbed
	* StringFormat.cs: Implemented method
	* Region.cs: Added Todo, fixed attribute
	* Size.cs: Added attribute
	* SizeF.cs: Added attribute
	* RectangleF.cs: Added attributes
	* Rectangle.cs: Added attributes
	* PointF.cs: Added attribute
	* Point.cs: Added attribute

svn path=/trunk/mcs/; revision=22859
Andreas N 22 years ago
parent
commit
14f0b2b4e2

+ 14 - 0
mcs/class/System.Drawing/System.Drawing/ChangeLog

@@ -1,3 +1,17 @@
+2004-02-07  Andreas Nahr <[email protected]>
+
+	* SRDescriptionAttribute.cs: Added and implemented
+	* ToolboxBitmapAttribute.cs: Implemented a few members
+	* SystemIcons.cs: Stubbed
+	* StringFormat.cs: Implemented method
+	* Region.cs: Added Todo, fixed attribute
+	* Size.cs: Added attribute
+	* SizeF.cs: Added attribute
+	* RectangleF.cs: Added attributes
+	* Rectangle.cs: Added attributes
+	* PointF.cs: Added attribute
+	* Point.cs: Added attribute
+
 2004-02-06  Ravindra  <[email protected]>
 
 	* Brush.cs: Renamed GetException method to CheckStatus

+ 1 - 0
mcs/class/System.Drawing/System.Drawing/Point.cs

@@ -244,6 +244,7 @@ namespace System.Drawing {
 		///	Indicates if both X and Y are zero.
 		/// </remarks>
 		
+		[Browsable (false)]
 		public bool IsEmpty {
 			get {
 				return ((x == 0) && (y == 0));

+ 2 - 0
mcs/class/System.Drawing/System.Drawing/PointF.cs

@@ -9,6 +9,7 @@
 
 using System;
 using System.Runtime.InteropServices;
+using System.ComponentModel;
 
 namespace System.Drawing {
 	
@@ -121,6 +122,7 @@ namespace System.Drawing {
 		///	Indicates if both X and Y are zero.
 		/// </remarks>
 		
+		[Browsable (false)]
 		public bool IsEmpty {
 			get {
 				return ((cx == 0.0) && (cy == 0.0));

+ 7 - 0
mcs/class/System.Drawing/System.Drawing/Rectangle.cs

@@ -298,6 +298,7 @@ namespace System.Drawing {
 		///	Read only.
 		/// </remarks>
 		
+		[Browsable (false)]
 		public int Bottom {
 			get {
 				return y + height;
@@ -329,6 +330,7 @@ namespace System.Drawing {
 		///	Indicates if the width or height are zero. Read only.
 		/// </remarks>
 		
+		[Browsable (false)]
 		public bool IsEmpty {
 			get {
 				return ((width == 0) || (height == 0));
@@ -344,6 +346,7 @@ namespace System.Drawing {
 		///	Read only.
 		/// </remarks>
 		
+		[Browsable (false)]
 		public int Left {
 			get {
 				return X;
@@ -358,6 +361,7 @@ namespace System.Drawing {
 		///	The Location of the top-left corner of the Rectangle.
 		/// </remarks>
 		
+		[Browsable (false)]
 		public Point Location {
 			get {
 				return new Point (x, y);
@@ -377,6 +381,7 @@ namespace System.Drawing {
 		///	Read only.
 		/// </remarks>
 		
+		[Browsable (false)]
 		public int Right {
 			get {
 				return X + Width;
@@ -391,6 +396,7 @@ namespace System.Drawing {
 		///	The Size of the Rectangle.
 		/// </remarks>
 		
+		[Browsable (false)]
 		public Size Size {
 			get {
 				return new Size (Width, Height);
@@ -410,6 +416,7 @@ namespace System.Drawing {
 		///	Read only.
 		/// </remarks>
 		
+		[Browsable (false)]
 		public int Top {
 			get {
 				return y;

+ 8 - 0
mcs/class/System.Drawing/System.Drawing/RectangleF.cs

@@ -8,6 +8,7 @@
 //
 
 using System;
+using System.ComponentModel;
 
 namespace System.Drawing {
 	
@@ -236,6 +237,7 @@ namespace System.Drawing {
 		///	Read only.
 		/// </remarks>
 		
+		[Browsable (false)]
 		public float Bottom {
 			get {
 				return Y + Height;
@@ -267,6 +269,7 @@ namespace System.Drawing {
 		///	Indicates if the width or height are zero. Read only.
 		/// </remarks>
 		
+		[Browsable (false)]
 		public bool IsEmpty {
 			get {
 				return ((sz.Width == 0) || (sz.Height == 0));
@@ -282,6 +285,7 @@ namespace System.Drawing {
 		///	Read only.
 		/// </remarks>
 		
+		[Browsable (false)]
 		public float Left {
 			get {
 				return X;
@@ -296,6 +300,7 @@ namespace System.Drawing {
 		///	The Location of the top-left corner of the RectangleF.
 		/// </remarks>
 		
+		[Browsable (false)]
 		public PointF Location {
 			get {
 				return loc;
@@ -314,6 +319,7 @@ namespace System.Drawing {
 		///	Read only.
 		/// </remarks>
 		
+		[Browsable (false)]
 		public float Right {
 			get {
 				return X + Width;
@@ -328,6 +334,7 @@ namespace System.Drawing {
 		///	The Size of the RectangleF.
 		/// </remarks>
 		
+		[Browsable (false)]
 		public SizeF Size {
 			get {
 				return sz;
@@ -346,6 +353,7 @@ namespace System.Drawing {
 		///	Read only.
 		/// </remarks>
 		
+		[Browsable (false)]
 		public float Top {
 			get {
 				return Y;

+ 1 - 1
mcs/class/System.Drawing/System.Drawing/Region.cs

@@ -13,6 +13,7 @@ using System.Runtime.InteropServices;
 namespace System.Drawing
 {
 	[ComVisible(false)]
+	[MonoTODO ("Not implemented")]
 	public sealed class Region : MarshalByRefObject, IDisposable
 	{
 		public Region()
@@ -256,7 +257,6 @@ namespace System.Drawing
 		}
 		
 		
-		[ComVisible(false)]
 		public Region Clone()
 		{
 			return this;

+ 35 - 0
mcs/class/System.Drawing/System.Drawing/SRDescriptionAttribute.cs

@@ -0,0 +1,35 @@
+//
+// System.Drawing.SRDescriptionAttribute.cs
+//
+// Authors:
+//   Andreas Nahr ([email protected])
+//
+// (C) 2004 Andreas Nahr
+//
+
+using System;
+using System.ComponentModel;
+
+namespace System.Drawing
+{
+	[AttributeUsage(AttributeTargets.All)]
+	internal class SRDescriptionAttribute : DescriptionAttribute
+	{
+		private bool isReplaced = false;
+
+		public SRDescriptionAttribute (string description)
+			: base (description)
+		{
+		}
+
+		public override string Description {
+			get {
+				if (!isReplaced) {
+					isReplaced = true;
+					DescriptionValue = Locale.GetText (DescriptionValue);
+				}
+				return DescriptionValue;
+			}
+		}
+	}
+}

+ 1 - 0
mcs/class/System.Drawing/System.Drawing/Size.cs

@@ -229,6 +229,7 @@ namespace System.Drawing {
 		///	Indicates if both Width and Height are zero.
 		/// </remarks>
 		
+		[Browsable (false)]
 		public bool IsEmpty {
 			get {
 				return ((width == 0) && (height == 0));

+ 2 - 0
mcs/class/System.Drawing/System.Drawing/SizeF.cs

@@ -9,6 +9,7 @@
 
 using System;
 using System.Runtime.InteropServices;
+using System.ComponentModel;
 
 namespace System.Drawing {
 
@@ -166,6 +167,7 @@ namespace System.Drawing {
 		///	Indicates if both Width and Height are zero.
 		/// </remarks>
 		
+		[Browsable (false)]
 		public bool IsEmpty {
 			get {
 				return ((wd == 0.0) && (ht == 0.0));

+ 8 - 4
mcs/class/System.Drawing/System.Drawing/StringFormat.cs

@@ -4,15 +4,13 @@
 // Authors:
 //   Dennis Hayes ([email protected])
 //   Miguel de Icaza ([email protected])
-//	 Jordi Mas i Hernandez ([email protected])
+//   Jordi Mas i Hernandez ([email protected])
 //
 // (C) 2002 Ximian, Inc
 // (C) 2003 Novell, Inc.
 //
 using System;
 using System.Drawing.Text;
-using System.IO;// temp
-
 
 namespace System.Drawing
 {
@@ -168,8 +166,14 @@ namespace System.Drawing
 		}
 
 		[MonoTODO]
-		public object Clone () {
+		public object Clone ()
+		{
 			throw new NotImplementedException ();
+		}
+
+		public override string ToString ()
+		{
+			return "[StringFormat, FormatFlags=" + this.FormatFlags.ToString() + "]";
 		}
 		
 		internal IntPtr NativeObject{            

+ 23 - 7
mcs/class/System.Drawing/System.Drawing/SystemIcons.cs

@@ -1,22 +1,38 @@
 //
 // System.Drawing.SystemIcons.cs
 //
-// Author:
-//   Dennis Hayes ([email protected])
+// Authors:
+//   Dennis Hayes ([email protected])
+//   Andreas Nahr ([email protected])
 //
 // (C) 2002 Ximian, Inc
-//
+//
+
 using System;
 
 namespace System.Drawing
-{
-	/// <summary>
-	/// Summary description for SystemIcons.
-	/// </summary>
+{
+	[MonoTODO ("not implemented")]
 	public sealed class SystemIcons
 	{
 		private SystemIcons()
 		{
+		}
+
+		public static Icon Application { get { return LoadIcon();} }
+		public static Icon Asterisk { get { return LoadIcon();} }
+		public static Icon Error { get { return LoadIcon();} }
+		public static Icon Exclamation { get { return LoadIcon();} }
+		public static Icon Hand { get { return LoadIcon();} }
+		public static Icon Information { get { return LoadIcon();} }
+		public static Icon Question { get { return LoadIcon();} }
+		public static Icon Warning { get { return LoadIcon();} }
+		public static Icon WinLogo { get { return LoadIcon();} }
+
+		[MonoTODO]
+		private static Icon LoadIcon ()
+		{
+			return null;
 		}
 	}
 }

+ 68 - 12
mcs/class/System.Drawing/System.Drawing/ToolboxBitmapAttribute.cs

@@ -1,40 +1,96 @@
 //
 // System.Drawing.ToolboxBitmapAttribute.cs
 //
-// Author:
-//   Dennis Hayes ([email protected])
+// Authors:
+//   Dennis Hayes ([email protected])
+//   Andreas Nahr ([email protected])
 //
 // (C) 2002 Ximian, Inc
-//
+//
+
 using System;
 
 namespace System.Drawing
 {
-	/// <summary>
-	/// Summary description for ToolboxBitmapAttribute.
-	/// </summary>
 	[AttributeUsage (AttributeTargets.Class)]
 	public class ToolboxBitmapAttribute : Attribute
-	{
-		public ToolboxBitmapAttribute(string imageFile)
+	{
+		private Image smallImage;
+		private Image bigImage;
+		public static readonly ToolboxBitmapAttribute Default = new ToolboxBitmapAttribute();
+
+		private ToolboxBitmapAttribute ()
+		{
+		}
+
+		[MonoTODO ("implement")]
+		public ToolboxBitmapAttribute (string imageFile)
 		{
 			//
 			// TODO: Add constructor logic here
 			//
 		}
-		
-		public ToolboxBitmapAttribute(Type t)
+		
+		[MonoTODO ("implement")]
+		public ToolboxBitmapAttribute (Type t)
 		{
 			//
 			// TODO: Add constructor logic here
 			//
 		}
-		
-		public ToolboxBitmapAttribute(Type t, string name)
+		
+		[MonoTODO ("implement")]
+		public ToolboxBitmapAttribute (Type t, string name)
 		{
 			//
 			// TODO: Add constructor logic here
 			//
+		}
+
+		public override bool Equals (object value)
+		{
+			if (!(value is ToolboxBitmapAttribute))
+				return false;
+			if (value == this)
+				return true;
+			return ((ToolboxBitmapAttribute) value).smallImage == this.smallImage;
+		}
+
+		public override int GetHashCode ()
+		{
+			return (smallImage.GetHashCode () ^ bigImage.GetHashCode ());
+		}
+
+		public Image GetImage (object component)
+		{
+			return GetImage (component.GetType(), null, false);
+		}
+
+		public Image GetImage (object component, bool large)
+		{
+			return GetImage (component.GetType(), null, large);
+		}
+
+		public Image GetImage (Type type)
+		{
+			return GetImage (type, null, false);
+		}
+
+		public Image GetImage (Type type, bool large)
+		{
+			return GetImage (type, null, large);
+		}
+
+		[MonoTODO ("implement")]
+		public Image GetImage (Type type, string imgName, bool large)
+		{
+			return null;
+		}
+
+		[MonoTODO ("implement")]
+		public static Image GetImageFromResource (Type t, string imageName, bool large)
+		{
+			return null;
 		}
 	}
 }