[Mono-list] [PATCH] mcs/System.Windows.Form/Gtk

Joel Basson jstrike@mweb.co.za
20 Feb 2003 21:53:32 +0200


--=-mUcnc1kaa7YnS10XNl7+
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

he redone version. This uses the old demo.cs file



--=-mUcnc1kaa7YnS10XNl7+
Content-Disposition: attachment; filename=file.dif
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; name=file.dif; charset=UTF-8

? ListBox.cs
? My_demo.cs
? System.Windows.Forms.dll
? file.dif
Index: Control.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /mono/mcs/class/System.Windows.Forms/Gtk/Control.cs,v
retrieving revision 1.4
diff -u -r1.4 Control.cs
--- Control.cs	9 Jan 2003 22:25:56 -0000	1.4
+++ Control.cs	20 Feb 2003 19:45:57 -0000
@@ -19,10 +19,11 @@
 	public class Control : Component {
 		internal Widget widget;
 		Control parent;
-		string text;
+		string text, name;
+		Size size;
 		int left, top, width, height;
 		ControlCollection controls;
-		Point location =3D new Point (0, 0);
+		Point location =3D new System.Drawing.Point (0, 0);
 		Gtk.Layout layout =3D null;
 		AnchorStyles anchor =3D AnchorStyles.Top|AnchorStyles.Left;
 	=09
@@ -135,11 +136,12 @@
 		}
=20
 		public Control (string text, int left, int top, int width, int height)
-		{
+		{		=09
 		}
=20
 		public Control (Control parent, string text, int left, int top, int widt=
h, int height)
 		{
+		=09
 		}
=20
 		internal Widget Widget {
@@ -174,7 +176,30 @@
 			if (TextChanged !=3D null)
 			 TextChanged (this, e);
 		}
-	=09
+
+
+		public virtual string Name {=0D
+           		 get {=0D
+                     	  	return name;=09=0D
+              		 }=0D
+        =20=0D
+         		 set {=20
+				name =3D value;
+			 	Widget.Name =3D value;
+			 }=0D
+          	}
+	=09
+		public Size Size {
+			get {=20
+				return size;
+			}
+			set {
+				size =3D value;
+				Widget.SetSizeRequest (value.Width,value.Height);
+			}
+		}
+
+
 		public void Show ()
 		{
 			Widget.Show ();
@@ -231,6 +256,7 @@
 			if (ControlRemoved !=3D null)
 				ControlRemoved (this, e);
 		}
+
=20
 		public Point Location {
 			get { return location; }
Index: ProgressBar.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /mono/mcs/class/System.Windows.Forms/Gtk/ProgressBar.cs,v
retrieving revision 1.1
diff -u -r1.1 ProgressBar.cs
--- ProgressBar.cs	8 Aug 2002 01:53:30 -0000	1.1
+++ ProgressBar.cs	20 Feb 2003 19:45:57 -0000
@@ -85,7 +85,7 @@
=20=0D
 		[MonoTODO]=0D
 		protected override Size DefaultSize {=0D
-			get { throw new NotImplementedException (); }=0D
+			get { throw new NotImplementedException (); }	=09
 		}=0D
 	=09=0D
 		[MonoTODO]=0D
Index: TextBoxBase.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /mono/mcs/class/System.Windows.Forms/Gtk/TextBoxBase.cs,v
retrieving revision 1.1
diff -u -r1.1 TextBoxBase.cs
--- TextBoxBase.cs	8 Aug 2002 01:53:30 -0000	1.1
+++ TextBoxBase.cs	20 Feb 2003 19:46:13 -0000
@@ -56,7 +56,7 @@
 				throw new NotImplementedException ();=0D
 			}=0D
 			set=0D
-			{=0D
+			{
 				throw new NotImplementedException ();=0D
 			}=0D
 		}=0D
@@ -201,8 +201,8 @@
 			get=0D
 			{=0D
 				String selection =3D "";=0D
-				Gtk.TextIter start;=0D
-				Gtk.TextIter end;=0D
+				Gtk.TextIter start =3D new Gtk.TextIter ();=0D
+				Gtk.TextIter end =3D new Gtk.TextIter ();=0D
 	=09=0D
 				if (TextBuffer.GetSelectionBounds(ref start, ref end))=0D
 					selection =3D TextBuffer.GetText(start, end, true);=0D
Index: changelog
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /mono/mcs/class/System.Windows.Forms/Gtk/changelog,v
retrieving revision 1.1
diff -u -r1.1 changelog
--- changelog	8 Aug 2002 01:53:30 -0000	1.1
+++ changelog	20 Feb 2003 19:46:13 -0000
@@ -11,3 +11,7 @@
 * TextBox.cs=0D
 * TextBoxBase.cs=0D
 * added new files with some functinality=0D
+
+2003-2-15  Joel Basson <jstrike@mweb.co.za>
+
+* Added Size and Name properties
\ No newline at end of file
Index: demo.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /mono/mcs/class/System.Windows.Forms/Gtk/demo.cs,v
retrieving revision 1.4
diff -u -r1.4 demo.cs
--- demo.cs	30 Jun 2002 21:21:55 -0000	1.4
+++ demo.cs	20 Feb 2003 19:46:13 -0000
@@ -13,18 +13,26 @@
 		Form form =3D new Form ();
=20
 		form.Text =3D "hello";
+		form.Size =3D new Size (500, 300);
=20
 		Label l =3D new Label ();
-		l.Location =3D new Point (20, 20);
+		l.Location =3D new Point (150, 20);
 		l.Text =3D "Hello world";
 		form.Controls.Add (l);
=20
 		Button b =3D new Button ();
 		b.Text =3D "a button";
-		b.Location =3D new Point (20, 60);
+		b.Location =3D new Point (150, 60);
 		b.Click +=3D new EventHandler (Clicked);
 		form.Controls.Add (b);
=20
+		TextBox text1 =3D new TextBox();
+		text1.Name =3D "text1";
+		text1.Location =3D new Point (120, 110);
+		text1.Size =3D new Size (200, 20);
+		text1.Text =3D "This is a TextBox";
+		form.Controls.Add (text1);
+
 		form.Visible =3D true;
=20
 		Application.Run ();
@@ -35,7 +43,7 @@
 		Form form =3D new Form ();
=20
 		form.Text =3D "hello";
-	=09
+	=20
 		Application.Run (form);
 	}
 =09
Index: makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /mono/mcs/class/System.Windows.Forms/Gtk/makefile,v
retrieving revision 1.3
diff -u -r1.3 makefile
--- makefile	30 Jun 2002 21:21:55 -0000	1.3
+++ makefile	20 Feb 2003 19:46:13 -0000
@@ -1,5 +1,5 @@
 CSC=3Dmcs
-SWFF=3D-r gtk-sharp -r glib-sharp -r System.Drawing=20
+SWFF=3D-r gdk-sharp -r gtk-sharp -r glib-sharp -r System.Drawing=20
=20
 SOURCES =3D \
 	AnchorStyles.cs		\
@@ -15,7 +15,12 @@
 	IButtonControl.cs	\
 	IContainerControl.cs	\
 	Label.cs		\
-	ScrollableControl.cs
+	ScrollableControl.cs	\
+	TextBoxBase.cs		\
+	TextBox.cs		\
+	ScrollBars.cs		\
+	ProgressBar.cs		\
+	HorizontalAlignment.cs
=20
 all: demo.exe
=20

--=-mUcnc1kaa7YnS10XNl7+--