he redone version. This uses the old demo.cs file
? ListBox.cs
? My_demo.cs
? System.Windows.Forms.dll
? file.dif
Index: Control.cs
===================================================================
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 = new Point (0, 0);
+ Point location = new System.Drawing.Point (0, 0);
Gtk.Layout layout = null;
AnchorStyles anchor = AnchorStyles.Top|AnchorStyles.Left;
@@ -135,11 +136,12 @@
}
public Control (string text, int left, int top, int width, int height)
- {
+ {
}
public Control (Control parent, string text, int left, int top, int
width, int height)
{
+
}
internal Widget Widget {
@@ -174,7 +176,30 @@
if (TextChanged != null)
TextChanged (this, e);
}
-
+
+
+ public virtual string Name {
+ get {
+ return name;
+ }
+
+ set {
+ name = value;
+ Widget.Name = value;
+ }
+ }
+
+ public Size Size {
+ get {
+ return size;
+ }
+ set {
+ size = value;
+ Widget.SetSizeRequest (value.Width,value.Height);
+ }
+ }
+
+
public void Show ()
{
Widget.Show ();
@@ -231,6 +256,7 @@
if (ControlRemoved != null)
ControlRemoved (this, e);
}
+
public Point Location {
get { return location; }
Index: ProgressBar.cs
===================================================================
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 @@
[MonoTODO]
protected override Size DefaultSize {
- get { throw new NotImplementedException (); }
+ get { throw new NotImplementedException (); }
}
[MonoTODO]
Index: TextBoxBase.cs
===================================================================
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 ();
}
set
- {
+ {
throw new NotImplementedException ();
}
}
@@ -201,8 +201,8 @@
get
{
String selection = "";
- Gtk.TextIter start;
- Gtk.TextIter end;
+ Gtk.TextIter start = new Gtk.TextIter ();
+ Gtk.TextIter end = new Gtk.TextIter ();
if (TextBuffer.GetSelectionBounds(ref start, ref end))
selection = TextBuffer.GetText(start, end,
true);
Index: changelog
===================================================================
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
* TextBoxBase.cs
* added new files with some functinality
+
+2003-2-15 Joel Basson <[EMAIL PROTECTED]>
+
+* Added Size and Name properties
\ No newline at end of file
Index: demo.cs
===================================================================
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 = new Form ();
form.Text = "hello";
+ form.Size = new Size (500, 300);
Label l = new Label ();
- l.Location = new Point (20, 20);
+ l.Location = new Point (150, 20);
l.Text = "Hello world";
form.Controls.Add (l);
Button b = new Button ();
b.Text = "a button";
- b.Location = new Point (20, 60);
+ b.Location = new Point (150, 60);
b.Click += new EventHandler (Clicked);
form.Controls.Add (b);
+ TextBox text1 = new TextBox();
+ text1.Name = "text1";
+ text1.Location = new Point (120, 110);
+ text1.Size = new Size (200, 20);
+ text1.Text = "This is a TextBox";
+ form.Controls.Add (text1);
+
form.Visible = true;
Application.Run ();
@@ -35,7 +43,7 @@
Form form = new Form ();
form.Text = "hello";
-
+
Application.Run (form);
}
Index: makefile
===================================================================
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=mcs
-SWFF=-r gtk-sharp -r glib-sharp -r System.Drawing
+SWFF=-r gdk-sharp -r gtk-sharp -r glib-sharp -r System.Drawing
SOURCES = \
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
all: demo.exe