? System.Windows.Forms.dll
? file.diff
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  16 Feb 2003 03:43:40 -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      16 Feb 2003 03:43:40 -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      16 Feb 2003 03:43:41 -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   16 Feb 2003 03:43:41 -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     16 Feb 2003 03:43:41 -0000
@@ -1,58 +1,65 @@
 using System;
-using System.Drawing;
-using System.Windows.Forms;
-
-class X {
-       static void Clicked (object o, EventArgs args)
-       {
-               Console.WriteLine ("the button was clicked");
-       }
-       
-       static void Demo_Window ()
-       {
-               Form form = new Form ();
-
-               form.Text = "hello";
-
-               Label l = new Label ();
-               l.Location = new Point (20, 20);
-               l.Text = "Hello world";
-               form.Controls.Add (l);
-
-               Button b = new Button ();
-               b.Text = "a button";
-               b.Location = new Point (20, 60);
-               b.Click += new EventHandler (Clicked);
-               form.Controls.Add (b);
-
-               form.Visible = true;
-
-               Application.Run ();
-       }
-
-       static void Demo_AppRun ()
-       {
-               Form form = new Form ();
-
-               form.Text = "hello";
-               
-               Application.Run (form);
-       }
-       
-       static void Main (string [] args)
-       {
-               string demo = "window";
-
-               if (args.Length > 0)
-                       demo = args [0];
-               
-               switch (demo){
-               case "window":
-                       Demo_Window ();
-                       break;
-               case "app_run":
-                       Demo_AppRun ();
-                       break;
+using System.Drawing;
+using System.Windows.Forms;
+
+namespace demo
+{
+       
+       public class GtkForm : System.Windows.Forms.Form
+       {
+               private Button button1 = new Button(); 
+                       private Label label1 = new Label();
+               private TextBox text1 = new TextBox(); 
+               private ProgressBar bar1 = new ProgressBar();
+           
+               private void InitializeWidgets()
+               {
+                       button1.Location = new Point(64, 28);
+                       button1.Name = "button1";
+                       button1.Size = new Size(128, 44);
+                       button1.Text = "Hello world!";
+                       button1.Click += new EventHandler(this.button1_Click);    
+            
+               text1.Location = new Point(200,48);
+               text1.Name = "textBox1";
+               text1.Size = new Size(256, 22);
+                               text1.Text = this.button1.Name;
+      
+                       bar1.Location = new Point(0, 108);
+                       bar1.Size = new Size(512, 20);
+                       bar1.Text = "This ProgressBar does nothing yet";
+
+                       label1.Location = new Point(220, 20);
+                       label1.Text = "This is a label";        
+       
+          Controls.AddRange(new System.Windows.Forms.Control[] { 
+                                                                       this.button1,
+                       this.text1, 
+                                                                       this.bar1, 
+                                                                       this.label1 
+});
+          this.Size = new Size(512, 128);
+               }
+       
+       public GtkForm()
+       {
+           InitializeWidgets();
+       }
+
+               private void button1_Click(object sender, EventArgs e)
+               { button1.Text = "Clicked!";
                }
-       }
-}
+               
+    }
+
+       
+       public class GtkMain
+       {
+               public static void Main()
+               {
+                       GtkForm form1 = new GtkForm ();
+                       form1.Text = "System.Windows.Forms at work!";                  
+ 
+                       Application.Run(form1);
+               }
+       }
+}
+
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    16 Feb 2003 03:43:41 -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
 

Reply via email to