Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/class/System.Windows.Forms/Gtk')
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/AnchorStyles.cs22
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/Application.cs37
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/Button.cs107
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/ButtonBase.cs204
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/ContainerControl.cs114
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/Control.cs263
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/ControlEventArgs.cs36
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/ControlEventHandler.cs16
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/DialogResult.cs31
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/Form.cs820
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/HorizontalAlignment.cs20
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/IButtonControl.cs17
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/IContainerControl.cs18
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/Label.cs276
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/ProgressBar.cs206
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/ScrollBars.cs21
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/ScrollableControl.cs305
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/TextBox.cs218
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/TextBoxBase.cs442
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/changelog13
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/demo.cs58
-rw-r--r--mcs/class/System.Windows.Forms/Gtk/makefile26
22 files changed, 3270 insertions, 0 deletions
diff --git a/mcs/class/System.Windows.Forms/Gtk/AnchorStyles.cs b/mcs/class/System.Windows.Forms/Gtk/AnchorStyles.cs
new file mode 100644
index 00000000000..2b166e21061
--- /dev/null
+++ b/mcs/class/System.Windows.Forms/Gtk/AnchorStyles.cs
@@ -0,0 +1,22 @@
+//
+// System.Windows.Forms.AnchorStyles.cs
+//
+// Author:
+// Dennis Hayes (dennish@raytek.com)
+// (C) 2002 Ximian, Inc. http://www.ximian.com
+//
+
+using System;
+
+namespace System.Windows.Forms {
+
+ /// <summary>
+ /// </summary>
+ public enum AnchorStyles{
+ Bottom = 2,
+ Left = 4,
+ None = 0,
+ Right = 8,
+ Top = 1
+ }
+}
diff --git a/mcs/class/System.Windows.Forms/Gtk/Application.cs b/mcs/class/System.Windows.Forms/Gtk/Application.cs
new file mode 100644
index 00000000000..1ce7107ef92
--- /dev/null
+++ b/mcs/class/System.Windows.Forms/Gtk/Application.cs
@@ -0,0 +1,37 @@
+//
+// System.Windows.Forms.Application
+//
+// Author:
+// Miguel de Icaza (miguel@ximian.com)
+//
+// (C) 2002 Ximian, Inc
+//
+
+using System;
+using System.Drawing;
+using Gtk;
+using GtkSharp;
+using System.ComponentModel;
+
+namespace System.Windows.Forms {
+
+ public sealed class Application {
+ public static void Run ()
+ {
+ Gtk.Application.Run ();
+ }
+
+ static void terminate_event_loop (object o, EventArgs args)
+ {
+ Gtk.Application.Quit ();
+ }
+
+ public static void Run (Form form)
+ {
+ form.Visible = true;
+ form.Closed += new EventHandler (terminate_event_loop);
+
+ Gtk.Application.Run ();
+ }
+ }
+}
diff --git a/mcs/class/System.Windows.Forms/Gtk/Button.cs b/mcs/class/System.Windows.Forms/Gtk/Button.cs
new file mode 100644
index 00000000000..5bfd9b998a5
--- /dev/null
+++ b/mcs/class/System.Windows.Forms/Gtk/Button.cs
@@ -0,0 +1,107 @@
+//
+// System.Windows.Forms.Button.cs
+//
+// Author:
+// stubbed out by Jaak Simm (jaaksimm@firm.ee)
+// implemented for Gtk+ by Rachel Hestilow (hestilow@ximian.com)
+//
+// (C) Ximian, Inc., 2002
+//
+
+namespace System.Windows.Forms
+{
+ /// <summary>
+ /// Represents a Windows button control.
+ /// </summary>
+
+ public class Button : ButtonBase, IButtonControl
+ {
+ // private fields
+ DialogResult dialogResult;
+//
+// // --- Constructor ---
+// protected Button() : base() {
+// dialogResult = DialogResult.None;
+// }
+//
+//
+//
+//
+// // --- Properties ---
+// [MonoTODO]
+// protected override CreateParams CreateParams {
+// get { throw new NotImplementedException (); }
+// }
+//
+ // --- IButtonControl property ---
+ public virtual DialogResult DialogResult {
+ get { return dialogResult; }
+ set { dialogResult=value; }
+ }
+//
+//
+//
+//
+ // --- IButtonControl method ---
+ [MonoTODO]
+ public virtual void NotifyDefault(bool value) {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public void PerformClick() {
+ throw new NotImplementedException ();
+ }
+//
+// // --- Button methods for events ---
+// [MonoTODO]
+// protected override void OnClick(EventArgs e) {
+// throw new NotImplementedException ();
+// }
+//
+// [MonoTODO]
+// protected override void OnMouseUp(MouseEventArgs mevent) {
+// throw new NotImplementedException ();
+// }
+//
+// // --- Button methods ---
+// [MonoTODO]
+// protected override bool ProcessMnemonic(char charCode) {
+// throw new NotImplementedException ();
+// }
+//
+// [MonoTODO]
+// public override string ToString() {
+// throw new NotImplementedException ();
+// }
+//
+// [MonoTODO]
+// protected override void WndProc(ref Message m) {
+// throw new NotImplementedException ();
+// }
+//
+//
+//
+//
+// /// --- Button events ---
+// /// commented out, cause it only supports the .NET Framework infrastructure
+// /*
+// [MonoTODO]
+// public new event EventHandler DoubleClick {
+// add {
+// throw new NotImplementedException ();
+// }
+// remove {
+// throw new NotImplementedException ();
+// }
+// }
+// */
+
+ internal override Gtk.Widget CreateWidget () {
+ Gtk.Button button = new Gtk.Button ();
+ button.Add (label.Widget);
+ return button;
+ }
+ }
+//
+}
diff --git a/mcs/class/System.Windows.Forms/Gtk/ButtonBase.cs b/mcs/class/System.Windows.Forms/Gtk/ButtonBase.cs
new file mode 100644
index 00000000000..48ffea11b0e
--- /dev/null
+++ b/mcs/class/System.Windows.Forms/Gtk/ButtonBase.cs
@@ -0,0 +1,204 @@
+//
+// System.Windows.Forms.ButtonBase.cs
+//
+// Author:
+// stubbed out by Jaak Simm (jaaksimm@firm.ee)
+// implemented for Gtk+ by Rachel Hestilow (hestilow@ximian.com)
+//
+// (C) Ximian, Inc., 2002
+//
+
+using System.ComponentModel;
+using System.Drawing;
+
+namespace System.Windows.Forms
+{
+ /// <summary>
+ /// Implements the basic functionality common to button controls.
+ /// ToDo note:
+ /// - no methods are implemented
+ /// </summary>
+
+ public abstract class ButtonBase : Control
+ {
+ // private fields
+// FlatStyle flatStyle;
+// Image image;
+// ContentAlignment imageAlign;
+// int imageIndex;
+ ContentAlignment textAlign;
+ internal protected Label label;
+
+//
+// // --- Constructor ---
+ protected ButtonBase() : base() {
+// flatStyle = FlatStyle.Standard;
+// image = null;
+// imageAlign = ContentAlignment.MiddleCenter;
+// imageIndex = -1;
+ textAlign = ContentAlignment.MiddleCenter;
+ label = new Label ();
+ label.Text = Text;
+ label.Visible = true;
+ ConnectToClicked ();
+ }
+
+ internal protected void clicked_cb (object o, EventArgs args)
+ {
+ OnClick (EventArgs.Empty);
+ }
+
+ internal protected void ConnectToClicked ()
+ {
+ ((Gtk.Button) Widget).Clicked += new EventHandler (clicked_cb);
+ }
+
+ // --- Properties ---
+// [MonoTODO]
+// protected override CreateParams CreateParams {
+// get { throw new NotImplementedException (); }
+// }
+//
+// [MonoTODO]
+// protected override ImeMode DefaultImeMode {
+// get { throw new NotImplementedException (); }
+// }
+//
+// [MonoTODO]
+// protected override Size DefaultSize {
+// get { throw new NotImplementedException (); }
+// }
+//
+// public FlatStyle FlatStyle {
+// get { return flatStyle; }
+// set { flatStyle=value; }
+// }
+//
+// public Image Image {
+// get { return image; }
+// set { image=value; }
+// }
+//
+// public ContentAlignment ImageAlign {
+// get { return imageAlign; }
+// set { imageAlign=value; }
+// }
+//
+// public int ImageIndex {
+// get { return imageIndex; }
+// set { imageIndex=value; }
+// }
+//
+// [MonoTODO]
+// public new ImeMode ImeMode {
+// get { throw new NotImplementedException (); }
+// set { throw new NotImplementedException (); }
+// }
+//
+// protected bool IsDefault {
+// get { throw new NotImplementedException (); }
+// set { throw new NotImplementedException (); }
+// }
+
+ public virtual ContentAlignment TextAlign {
+ get { return label.TextAlign; }
+ set { label.TextAlign=value; }
+ }
+//
+//
+//
+//
+//
+// /// --- Methods ---
+// /// internal .NET framework supporting methods, not stubbed out:
+// /// - protected override void Dispose(bool);
+// /// - protected void ResetFlagsandPaint();
+// [MonoTODO]
+// protected override AccessibleObject CreateAccessibilityInstance() {
+// throw new NotImplementedException ();
+// }
+//
+// /// [methods for events]
+// [MonoTODO]
+// protected override void OnEnabledChanged(EventArgs e) {
+// throw new NotImplementedException ();
+// }
+//
+// [MonoTODO]
+// protected override void OnGotFocus(EventArgs e) {
+// throw new NotImplementedException ();
+// }
+//
+// [MonoTODO]
+// protected override void OnKeyDown(KeyEventArgs kevent) {
+// throw new NotImplementedException ();
+// }
+//
+// [MonoTODO]
+// protected override void OnKeyUp(KeyEventArgs kevent) {
+// throw new NotImplementedException ();
+// }
+//
+// [MonoTODO]
+// protected override void OnLostFocus(EventArgs e) {
+// throw new NotImplementedException ();
+// }
+//
+// [MonoTODO]
+// protected override void OnMouseDown(MouseEventArgs mevent) {
+// throw new NotImplementedException ();
+// }
+//
+// [MonoTODO]
+// protected override void OnMouseEnter(EventArgs eventargs) {
+// throw new NotImplementedException ();
+// }
+//
+// [MonoTODO]
+// protected override void OnMouseLeave(EventArgs eventargs) {
+// throw new NotImplementedException ();
+// }
+//
+// [MonoTODO]
+// protected override void OnMouseMove(MouseEventArgs mevent) {
+// throw new NotImplementedException ();
+// }
+//
+// [MonoTODO]
+// protected override void OnMouseUp(MouseEventArgs mevent) {
+// throw new NotImplementedException ();
+// }
+//
+// [MonoTODO]
+// protected override void OnPaint(PaintEventArgs pevent) {
+// throw new NotImplementedException ();
+// }
+//
+// [MonoTODO]
+// protected override void OnParentChanged(EventArgs e) {
+// throw new NotImplementedException ();
+// }
+//
+ protected override void OnTextChanged(EventArgs e) {
+ label.Text = Text;
+ }
+//
+// [MonoTODO]
+// protected override void OnVisibleChanged(EventArgs e) {
+// throw new NotImplementedException ();
+// }
+// /// end of [methods for events]
+//
+// [MonoTODO]
+// protected override void WndProc(ref Message m) {
+// throw new NotImplementedException ();
+// }
+//
+//
+//
+// /// --- ButtonBase.ButtonBaseAccessibleObject ---
+// /// the class is not stubbed, cause it's only used for .NET framework
+//
+//
+ }
+}
diff --git a/mcs/class/System.Windows.Forms/Gtk/ContainerControl.cs b/mcs/class/System.Windows.Forms/Gtk/ContainerControl.cs
new file mode 100644
index 00000000000..5efb9445089
--- /dev/null
+++ b/mcs/class/System.Windows.Forms/Gtk/ContainerControl.cs
@@ -0,0 +1,114 @@
+//
+// System.Windows.Forms.ContainerControl.cs
+//
+// Author:
+// Miguel de Icaza (miguel@ximian.com)
+// stubbed out by Jaak Simm (jaaksimm@firm.ee)
+//
+// (C) Ximian, Inc., 2002
+//
+
+using System.ComponentModel;
+using System.Drawing;
+
+namespace System.Windows.Forms
+{
+ /// <summary>
+ /// Provides focus management functionality for controls that can function as a container for other controls.
+ /// </summary>
+
+ public class ContainerControl : ScrollableControl, IContainerControl
+ {
+ protected ContainerControl() : base() {
+ }
+
+
+ public Control ActiveControl {
+ get { throw new NotImplementedException (); }
+ set { throw new NotImplementedException (); }
+ }
+//
+// [MonoTODO]
+// public override BindingContext BindingContext {
+// get { throw new NotImplementedException (); }
+// set { throw new NotImplementedException (); }
+// }
+//
+// [MonoTODO]
+// protected override CreateParams CreateParams {
+// get { throw new NotImplementedException (); }
+// }
+//
+// [MonoTODO]
+// public Form ParentForm {
+// get { throw new NotImplementedException (); }
+// }
+//
+//
+//
+// /// --- Methods ---
+// /// internal .NET framework supporting methods, not stubbed out:
+// /// - protected virtual void UpdateDefaultButton()
+// [MonoTODO]
+// protected override void AdjustFormScrollbars(bool displayScrollbars) {
+// throw new NotImplementedException ();
+// }
+//
+// [MonoTODO]
+// protected override void Dispose(bool disposing) {
+// throw new NotImplementedException ();
+// }
+//
+ [MonoTODO]
+ bool IContainerControl.ActivateControl(Control control) {
+ throw new NotImplementedException ();
+ }
+//
+// // [event methods]
+// [MonoTODO]
+// protected override void OnControlRemoved(ControlEventArgs e) {
+// throw new NotImplementedException ();
+// }
+//
+// [MonoTODO]
+// protected override void OnCreateControl() {
+// throw new NotImplementedException ();
+// }
+// // end of [event methods]
+//
+// [MonoTODO]
+// protected override bool ProcessDialogChar(char charCode) {
+// throw new NotImplementedException ();
+// }
+//
+// [MonoTODO]
+// protected override bool ProcessDialogKey(Keys keyData) {
+// throw new NotImplementedException ();
+// }
+//
+// [MonoTODO]
+// protected override bool ProcessMnemonic(char charCode) {
+// throw new NotImplementedException ();
+// }
+//
+// [MonoTODO]
+// protected virtual bool ProcessTabKey(bool forward) {
+// throw new NotImplementedException ();
+// }
+//
+// [MonoTODO]
+// protected override void Select(bool directed,bool forward) {
+// throw new NotImplementedException ();
+// }
+//
+// [MonoTODO]
+// public bool Validate() {
+// throw new NotImplementedException ();
+// }
+//
+// [MonoTODO]
+// protected override void WndProc(ref Message m) {
+// throw new NotImplementedException ();
+// }
+ }
+}
diff --git a/mcs/class/System.Windows.Forms/Gtk/Control.cs b/mcs/class/System.Windows.Forms/Gtk/Control.cs
new file mode 100644
index 00000000000..646e0028ef3
--- /dev/null
+++ b/mcs/class/System.Windows.Forms/Gtk/Control.cs
@@ -0,0 +1,263 @@
+//
+// System.Windows.Forms.Form
+//
+// Author:
+// Miguel de Icaza (miguel@ximian.com)
+// Rachel Hestilow (hestilow@ximian.com)
+//
+// (C) 2002 Ximian, Inc
+//
+
+using System;
+using System.Drawing;
+using Gtk;
+using GtkSharp;
+using System.ComponentModel;
+using System.Collections;
+
+namespace System.Windows.Forms {
+ public class Control : Component {
+ internal Widget widget;
+ Control parent;
+ string text;
+ int left, top, width, height;
+ ControlCollection controls;
+ Point location = new Point (0, 0);
+ Gtk.Layout layout = null;
+ AnchorStyles anchor = AnchorStyles.Top|AnchorStyles.Left;
+
+ static int init_me;
+
+ public class ControlCollection : IList, ICollection, IEnumerable, ICloneable
+ {
+ ArrayList list = new ArrayList ();
+ Control owner;
+
+ public ControlCollection (Control owner)
+ {
+ this.owner = owner;
+ }
+
+ private ControlCollection ()
+ {
+ }
+
+ // ControlCollection
+ public virtual void Add (Control value) {
+ list.Add (value);
+ owner.OnControlAdded (new ControlEventArgs (value));
+ }
+ public virtual void AddRange (Control[] controls) {
+ list.AddRange (controls);
+ foreach (Control c in controls)
+ owner.OnControlAdded (new ControlEventArgs (c));
+ }
+
+ public bool Contains (Control value) { return list.Contains (value); }
+ public virtual void Remove (Control value) {
+ list.Remove (value);
+ owner.OnControlAdded (new ControlEventArgs (value));
+ }
+ public virtual Control this[int index] { get { return (Control) list[index]; } }
+ public int GetChildIndex (Control child) {
+ return GetChildIndex (child, true);
+ }
+ public int GetChildIndex (Control child, bool throwException) {
+ if (throwException && !Contains (child))
+ throw new Exception ();
+ return list.IndexOf (child);
+ }
+ public int IndexOf (Control value) { return list.IndexOf (value); }
+ public void SetChildIndex (Control child, int newIndex) {
+ int oldIndex = GetChildIndex (child);
+ if (oldIndex == newIndex)
+ return;
+ // is this correct behavior?
+ Control other = (Control) list[newIndex];
+ list[oldIndex] = other;
+ list[newIndex] = child;
+ }
+
+ // IList
+ public bool IsFixedSize { get { return list.IsFixedSize; } }
+ public bool IsReadOnly { get { return list.IsReadOnly; } }
+ int IList.Add (object value) { return list.Add (value); }
+ public void Clear () { list.Clear (); }
+ bool IList.Contains (object value) { return list.Contains (value); }
+ int IList.IndexOf (object value) { return list.IndexOf (value); }
+ void IList.Insert (int index, object value) { list.Insert (index, value); }
+ void IList.Remove (object value) { list.Remove (value); }
+ public void RemoveAt (int index) { list.RemoveAt (index); }
+
+ // ICollection
+ public int Count { get { return list.Count; } }
+ public bool IsSynchronized { get { return list.IsSynchronized; } }
+ public object SyncRoot { get { return list.SyncRoot; } }
+ public void CopyTo (Array array, int index) { list.CopyTo (array, index); }
+
+ // IEnumerable
+ public IEnumerator GetEnumerator () { return list.GetEnumerator (); }
+
+ // ICloneable
+ public object Clone () {
+ ControlCollection c = new ControlCollection ();
+ c.list = (ArrayList) list.Clone ();
+ c.owner = owner;
+ return c;
+ }
+
+ object IList.this[int index]
+ {
+ get { return list[index]; }
+ set { list[index] = value; }
+ }
+
+ }
+
+ static Control ()
+ {
+ init_me = 1;
+ }
+
+ public Control () : this ("")
+ {
+ }
+
+ public Control (string text) : this (null, text)
+ {
+ }
+
+ public Control (Control parent, string text)
+ {
+ this.parent = parent;
+ this.text = text;
+
+ }
+
+ 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 {
+ get {
+ if (widget == null)
+ widget = CreateWidget ();
+ return widget;
+ }
+ }
+
+ internal virtual Widget CreateWidget ()
+ {
+ layout = new Gtk.Layout (new Gtk.Adjustment (IntPtr.Zero), new Gtk.Adjustment (IntPtr.Zero));
+ layout.Show ();
+ return layout;
+ }
+
+ public virtual string Text {
+ get {
+ return text;
+ }
+
+ set {
+ text = value;
+ OnTextChanged (EventArgs.Empty);
+ }
+ }
+
+ public event EventHandler TextChanged;
+
+ protected virtual void OnTextChanged (EventArgs e) {
+ if (TextChanged != null)
+ TextChanged (this, e);
+ }
+
+ public void Show ()
+ {
+ Widget.Show ();
+ }
+
+ public void Hide ()
+ {
+ Widget.Hide ();
+ }
+
+ public bool Visible {
+ get {
+ return Widget.Visible;
+ }
+
+ set {
+ Widget.Visible = value;
+ }
+ }
+
+ public ControlCollection Controls {
+ get { if (controls == null) controls = new ControlCollection (this); return controls;}
+ }
+
+ public event ControlEventHandler ControlAdded;
+ public event ControlEventHandler ControlRemoved;
+
+ internal void ControlLocationChanged (object o, EventArgs e)
+ {
+ Control c = (Control) o;
+ Point l = c.Location;
+ if (layout == null) {
+ Widget w = Widget;
+ }
+
+ layout.Move (c.Widget, l.X, l.Y);
+ }
+
+ protected virtual void OnControlAdded(ControlEventArgs e) {
+ e.Control.Visible = true;
+
+ if (ControlAdded != null)
+ ControlAdded (this, e);
+
+ Point l = e.Control.Location;
+ if (layout == null) {
+ Widget w = Widget;
+ }
+ layout.Put (e.Control.Widget, l.X, l.Y);
+ e.Control.LocationChanged += new EventHandler (ControlLocationChanged);
+ }
+
+ protected virtual void OnControlRemoved(ControlEventArgs e) {
+ if (ControlRemoved != null)
+ ControlRemoved (this, e);
+ }
+
+ public Point Location {
+ get { return location; }
+ set {
+ location = value;
+ OnLocationChanged (EventArgs.Empty);
+ }
+ }
+
+ public event EventHandler LocationChanged;
+
+ public virtual void OnLocationChanged (EventArgs e) {
+
+ if (LocationChanged != null)
+ LocationChanged (this, e);
+ }
+
+ public event EventHandler Click;
+
+ protected virtual void OnClick (EventArgs e) {
+ if (Click != null)
+ Click (this, e);
+ }
+
+ public virtual AnchorStyles Anchor {
+ get { return anchor; }
+ set { anchor=value; }
+ }
+ }
+}
diff --git a/mcs/class/System.Windows.Forms/Gtk/ControlEventArgs.cs b/mcs/class/System.Windows.Forms/Gtk/ControlEventArgs.cs
new file mode 100644
index 00000000000..408647128e9
--- /dev/null
+++ b/mcs/class/System.Windows.Forms/Gtk/ControlEventArgs.cs
@@ -0,0 +1,36 @@
+//
+// System.Windows.Forms.ControlEventArgs.cs
+//
+// Author:
+// stubbed out by Jaak Simm (jaaksimm@firm.ee)
+// implemented for Gtk+ by Rachel Hestilow (hestilow@ximian.com)
+
+// (C) Ximian, Inc., 2002
+
+
+namespace System.Windows.Forms
+{
+ /// <summary>
+ /// Provides data for the ControlAdded and ControlRemoved events.
+ /// ToDo note:
+ /// - no methods are implemented
+ /// </summary>
+
+ public class ControlEventArgs : EventArgs
+ {
+ Control control;
+
+ #region Constructors
+ public ControlEventArgs(Control control) {
+ this.control = control;
+ }
+ #endregion
+
+ #region Properties
+ public Control Control {
+ get { return control; }
+ }
+ #endregion
+
+ }
+}
diff --git a/mcs/class/System.Windows.Forms/Gtk/ControlEventHandler.cs b/mcs/class/System.Windows.Forms/Gtk/ControlEventHandler.cs
new file mode 100644
index 00000000000..d42d35259c8
--- /dev/null
+++ b/mcs/class/System.Windows.Forms/Gtk/ControlEventHandler.cs
@@ -0,0 +1,16 @@
+//
+// System.Windows.Forms.ControlEventHandler.cs
+//
+// Author:
+// Dennis hayes (dennish@raytek.com)
+//
+// (C) 2002 Ximian, Inc. http://www.ximian.com
+//
+
+namespace System.Windows.Forms {
+ [Serializable]
+ public delegate void ControlEventHandler (
+ object sender,
+ ControlEventArgs e
+ );
+} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/Gtk/DialogResult.cs b/mcs/class/System.Windows.Forms/Gtk/DialogResult.cs
new file mode 100644
index 00000000000..82a5ff3646c
--- /dev/null
+++ b/mcs/class/System.Windows.Forms/Gtk/DialogResult.cs
@@ -0,0 +1,31 @@
+//
+// System.Windows.Forms.DialogResult.cs
+//
+// Author:
+// Jaak Simm (jaaksimm@firm.ee)
+// Dennis Hayes (dennish@raytek.com)
+// (C) 2002 Ximian, Inc. http://www.ximian.com
+//
+
+using System;
+
+namespace System.Windows.Forms
+{
+ /// <summary>
+ /// Specifies identifiers to indicate the return value of a dialog box.
+ /// </summary>
+ [Serializable]
+ //[ComVisible(true)]
+ public enum DialogResult
+ {
+ //Values were verified with enumcheck.
+ None = 0,
+ OK = 1,
+ Cancel = 2,
+ Abort = 3,
+ Retry = 4,
+ Ignore = 5,
+ Yes = 6,
+ No = 7,
+ }
+}
diff --git a/mcs/class/System.Windows.Forms/Gtk/Form.cs b/mcs/class/System.Windows.Forms/Gtk/Form.cs
new file mode 100644
index 00000000000..6e9ad2ed2b7
--- /dev/null
+++ b/mcs/class/System.Windows.Forms/Gtk/Form.cs
@@ -0,0 +1,820 @@
+//
+// System.Windows.Forms.Form
+//
+// Author:
+// Miguel de Icaza (miguel@ximian.com)
+// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
+//
+// (C) 2002 Ximian, Inc
+//
+
+using System;
+using System.Drawing;
+using Gtk;
+using GtkSharp;
+
+namespace System.Windows.Forms {
+
+ public class Form : ContainerControl {
+ Window win;
+ string caption;
+
+ public Form () : base ()
+ {
+ }
+
+ static Form ()
+ {
+ Gtk.Application.Init ();
+ }
+
+ void delete_cb (object o, DeleteEventArgs args)
+ {
+
+ //if (Closing != null)
+ //Closing (o, args);
+
+ if (Closed != null)
+ Closed (o, args);
+ }
+
+ internal override Widget CreateWidget ()
+ {
+ Widget contents = base.CreateWidget ();
+ win = new Window (WindowType.Toplevel);
+
+ win.DeleteEvent += new DeleteEventHandler (delete_cb);
+ win.Title = Text;
+ win.Add (contents);
+ return (Widget) win;
+ }
+
+ // --- Public Properties
+ //
+ // [MonoTODO]
+ // public IButtonControl AcceptButton {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public static Form ActiveForm {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public Form ActiveMdiChild {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public bool AutoScale {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public virtual Size AtoScaleBaseSize {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public override bool AutoScroll {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public virtual Color BackColor {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public IButtonControl CancelButton {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public new Size ClientSize {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public bool ControlBox {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public Rectangle DesktopBounds {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public Point DesktopLocation {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public DialogResult DialogResult {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public FormBorderStyle FormBorderStyle {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public bool HelpButton {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public Icon Icon {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public bool IsMidiChild {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public bool IsMidiContainer {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public bool KeyPreview {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public bool MaximizeBox {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public Size MaximumSize {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public Form[] MdiChildren {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public Form MdiParent {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public MainMenu Menu {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public MainMenu MergedMenu {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public bool MinimizeBox {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public Size MinimumSize {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public bool Modal {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public double Opacity {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public Form[] OwnedForms {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public Form Owner {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public bool ShowInTaskbar {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public override ISite Site {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public SizeGripStyle SizeGripStyle {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public FormStartPosition StartPosition {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public bool TopLevel {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public bool TopMost {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public Color TransparencyKey {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public FormWindowState WindowState {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+
+ //
+ // --- Public Methods
+ //
+ // [MonoTODO]
+ // public void Activate()
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // public void AddOwnedForm(Form ownedForm)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // public void Close()
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // public void Dispose()
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // public virtual bool Equals(object o);
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // public static bool Equals(object o1, object o2);
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // public static SizeF GetAutoScaleSize(Font font)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // public void Invalidate()
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // public object Invoke()
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // public void LayoutMdi(MdiLayout value)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // public void PerformLayout()
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // public void RemoveOwnedForm(Form ownedForm)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // public void ResumeLayout()
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // public void Scale(float f)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // public void Select()
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // public void SetBounds(int, int, int, int)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // public void SetDesktopLocation(int x, int y)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // public DialogResult ShowDialog()
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // public override string ToString()
+ // {
+ // throw new NotImplementedException ();
+ // }
+
+ //
+ // --- Public Events
+ //
+ // [MonoTODO]
+ // public event EventHandler Activated {
+ // add {
+ // throw new NotImplementedException ();
+ // }
+ // remove {
+ // throw new NotImplementedException ();
+ // }
+ //}
+
+ public event EventHandler Closed;
+
+ // public event CancelEventHandler Closing;
+
+ // [MonoTODO]
+ // public event EventHandler Deactivate {
+ // add {
+ // throw new NotImplementedException ();
+ // }
+ // remove {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public event InputLanguageChangedEventHandler InputLanguageChanged {
+ // add {
+ // throw new NotImplementedException ();
+ // }
+ // remove {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public event InputLanguageChangingEventHandler InputLanguageChanging {
+ // add {
+ // throw new NotImplementedException ();
+ // }
+ // remove {
+ // throw new NotImplementedException ();
+ // }
+ //}
+
+ // [MonoTODO]
+ // public event EventHandler Load {
+ // add {
+ // throw new NotImplementedException ();
+ // }
+ // remove {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public event EventHandler MaximizedBoundsChanged {
+ // add {
+ // throw new NotImplementedException ();
+ // }
+ // remove {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public event EventHandler MaximumSizeChanged {
+ // add {
+ // throw new NotImplementedException ();
+ // }
+ // remove {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public event EventHandler MdiChildActivate {
+ // add {
+ // throw new NotImplementedException ();
+ // }
+ // remove {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public event EventHandler MenuComplete {
+ // add {
+ // throw new NotImplementedException ();
+ // }
+ // remove {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public event EventHandler MenuStart {
+ // add {
+ // throw new NotImplementedException ();
+ // }
+ // remove {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // public event EventHandler MinimumSizedChanged {
+ // add {
+ // throw new NotImplementedException ();
+ // }
+ // remove {
+ // throw new NotImplementedException ();
+ // }
+ //}
+
+ //
+ // --- Protected Properties
+ //
+ // [MonoTODO]
+ // protected override CreateParams CreateParams {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // protected override ImeMode DefaultImeMode {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ // [MonoTODO]
+ // protected override Size DefaultSize {
+ //}
+ // [MonoTODO]
+ // protected Rectangle MaximizedBounds {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+
+ //
+ // --- Protected Methods
+ //
+ // [MonoTODO]
+ // protected override void AdjustFormScrollbars(bool displayScrollbars)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // protected override ControlCollection CreateControlsInstnace()
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // protected override void CreateHandle()
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // protected override void DefWndProc(ref Message m)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // protected override void Dispose(bool b)
+ // {
+ // throw new NotImplementedException ();
+ // }
+
+ // [MonoTODO]
+ // protected virtual void OnClosed(EventArgs e)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // protected virtual void OnClosing(CancelEventArgs e)
+ // {
+ // throw new NotImplementedException ();
+ // }
+
+ // [MonoTODO]
+ // protected override void OnCreateControl()
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // protected override void OnFontChanged(EventArgs e)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // protected override void OnHandleCreated(EventArgs e)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // protected override void OnHandleDestroyed(EventArgs e)
+ // {
+ // throw new NotImplementedException ();
+ // }
+
+ // [MonoTODO]
+ // protected virtual void OnInputLanguageChanged( OnInputLanguageChangedEventArgs e)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // protected virtual void OnInputLanguagedChanging( OnInputLanguagedChangingEventArgs e)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // protected virtual void OnLoad(EventArgs e)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // protected virtual void OnMaximizedBoundsChanged(EventArgs e)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // protected virtual void OnMaximumSizedChanged(EventArgs e)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // protected virtual void OnMdiChildActive(EventArgs e)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // protected virtual void OnMenuComplete(EventArgs e)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // protected virtual void OnMenuStart(EventArgs e)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // protected virtual void OnMinimumSizeChanged(EventArgs e)
+ // {
+ // throw new NotImplementedException ();
+ // }
+
+ // [MonoTODO]
+ // protected override void OnPaint(EventArgs e)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // protected override void OnResize(EventArgs e)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // protected override void OnStyleChanged(EventArgs e)
+ // {
+ // throw new NotImplementedException ();
+ // }
+
+ protected override void OnTextChanged(EventArgs e)
+ {
+ if (win != null)
+ win.Title = Text;
+ }
+
+ // [MonoTODO]
+ // protected override void OnVisibleChanged(EventArgs e)
+ // {
+ // throw new NotImplementedException ();
+ // }
+
+ // [MonoTODO]
+ // protected override bool ProcessCmdKey( ref Message msg, Keys keyData)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // protected override bool ProcessDialogKey(Keys keyData)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // protected override bool ProcessKeyPreview(ref Message m)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // protected override bool ProcessTabKey(bool forward)
+ // {
+ // throw new NotImplementedException ();
+ // }
+
+ // [MonoTODO]
+ // protected override void ScaleScore(float x, float y)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // protected override void Select(bool b1, bool b2)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // protected override void SelectClientSizeCore(int x, int y)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // protected override void SetVisibleCore(bool value)
+ // {
+ // throw new NotImplementedException ();
+ // }
+
+ // [MonoTODO]
+ // protected void UpdateBounds()
+ // {
+ // throw new NotImplementedException ();
+ // }
+ // [MonoTODO]
+ // protected override void WndProc(ref Message m)
+ // {
+ // throw new NotImplementedException ();
+ // }
+ }
+}
diff --git a/mcs/class/System.Windows.Forms/Gtk/HorizontalAlignment.cs b/mcs/class/System.Windows.Forms/Gtk/HorizontalAlignment.cs
new file mode 100644
index 00000000000..0430f0ae8bc
--- /dev/null
+++ b/mcs/class/System.Windows.Forms/Gtk/HorizontalAlignment.cs
@@ -0,0 +1,20 @@
+//
+// System.Windows.Forms.HorizontalAlignment.cs
+//
+// Author:
+// Dennis Hayes (dennish@raytek.com)
+// (C) 2002 Ximian, Inc. http://www.ximian.com
+//
+
+using System;
+
+namespace System.Windows.Forms {
+
+ /// <summary>
+ /// </summary>
+ public enum HorizontalAlignment {
+ Center = 2,
+ Left = 0,
+ Right = 1
+ }
+}
diff --git a/mcs/class/System.Windows.Forms/Gtk/IButtonControl.cs b/mcs/class/System.Windows.Forms/Gtk/IButtonControl.cs
new file mode 100644
index 00000000000..874d98543c0
--- /dev/null
+++ b/mcs/class/System.Windows.Forms/Gtk/IButtonControl.cs
@@ -0,0 +1,17 @@
+//
+// System.Windows.Forms.IButtonControl.cs
+//
+// Author:
+// Dennis hayes (dennish@raytek.com)
+//
+// (C) 2002 Ximian, Inc. http://www.ximian.com
+//
+
+namespace System.Windows.Forms {
+
+ interface IButtonControl {
+ void NotifyDefault(bool value);
+ void PerformClick();
+ DialogResult DialogResult {get; set;}
+ }
+}
diff --git a/mcs/class/System.Windows.Forms/Gtk/IContainerControl.cs b/mcs/class/System.Windows.Forms/Gtk/IContainerControl.cs
new file mode 100644
index 00000000000..989400c32c0
--- /dev/null
+++ b/mcs/class/System.Windows.Forms/Gtk/IContainerControl.cs
@@ -0,0 +1,18 @@
+//
+// System.Windows.Forms.IContainerControl.cs
+//
+// Author:
+// William Lamb (wdlamb@notwires.com)
+// Dennis Hayes (dennish@raytek.com)
+//
+// (C) 2002 Ximian, Inc. http://www.ximian.com
+//
+
+namespace System.Windows.Forms
+{
+ public interface IContainerControl
+ {
+ bool ActivateControl(Control active);
+ Control ActiveControl {get; set;}
+ }
+} \ No newline at end of file
diff --git a/mcs/class/System.Windows.Forms/Gtk/Label.cs b/mcs/class/System.Windows.Forms/Gtk/Label.cs
new file mode 100644
index 00000000000..982c0a68f8a
--- /dev/null
+++ b/mcs/class/System.Windows.Forms/Gtk/Label.cs
@@ -0,0 +1,276 @@
+//
+// System.Windows.Forms.Label.cs
+//
+// Author:
+// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
+// implemented for Gtk+ by Rachel Hestilow (hestilow@ximian.com)
+//
+// (C) 2002 Ximian, Inc
+//
+
+namespace System.Windows.Forms {
+ using System.Drawing;
+
+ // <summary>
+ //
+ // </summary>
+
+ public class Label : Control {
+
+ public Label () : base ()
+ {
+ }
+
+ //public virtual bool AutoSize {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ //[MonoTODO]
+ //public FlatStyle FlatStyle {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ //[MonoTODO]
+ //public Image Image {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ //[MonoTODO]
+ //public ContentAlignment ImageAlign {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ //[MonoTODO]
+ //public int ImageIndex {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ //[MonoTODO]
+ //public ImageList ImageList {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ //[MonoTODO]
+ //public ImeMode ImeMode {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ //[MonoTODO]
+ //public int PreferredHeight {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ //[MonoTODO]
+ //public int PreferredWidth {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ //[MonoTODO]
+ //public bool TabStop {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ [MonoTODO]
+ public virtual ContentAlignment TextAlign {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+ //[MonoTODO]
+ //public bool UseMnemonic {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+
+ //
+ // --- Public Methods
+ //
+ //[MonoTODO]
+ //public virtual bool Equals(object o);
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public static bool Equals(object o1, object o2);
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void Select()
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public override string ToString()
+ //{
+ // throw new NotImplementedException ();
+ //}
+
+ //
+ // --- Public Events
+ //
+ //[MonoTODO]
+ //public event EventHandler AutoSizeChanged {
+ // add {
+ // throw new NotImplementedException ();
+ // }
+ // remove {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ //[MonoTODO]
+ //public event EventHandler TextAlignChanged {
+ // add {
+ // throw new NotImplementedException ();
+ // }
+ // remove {
+ // throw new NotImplementedException ();
+ // }
+ //}
+
+ //
+ // --- Protected Methods
+ //
+ //[MonoTODO]
+ //protected Rectangle CalcImageRenderBounds( Image image, Rectangle rect, ContentAlignment align)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected override AccessibleObject CreateAccessibilityInstance()
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected void Dispose()
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected override void Dispose(bool val)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected void DrawImage( Graphics g, Image img, Rectangle r, ContentAlignment align)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected override void OnEnabledChanged (EventArgs e)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected override void OnFontChanged (EventArgs e)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected override void OnPaint (PaintEventArgs e)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected override void OnParentChanged (EventArgs e)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ protected override void OnTextChanged (EventArgs e)
+ {
+ ((Gtk.Label) Widget).Text = Text;
+ }
+
+ //[MonoTODO]
+ //protected override void OnVisibleChanged (EventArgs e)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected override bool ProcessMnemonic(char charCode)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected ContentAlignment RtlTranslateAlignment( ContentAlignment alignment)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected HorizontalAlignment RtlTranslateAlignment( HorizontalAlignment alignment)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected virtual void Select(bool val1, bool val2)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected override void SetBoundsCore( int x, int y, int width, int height BoundsSpecified specified)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected void UpdateBounds()
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected void UpdateBounds(int b1, int b2, int b3, int b4)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected override void WndProc(ref Message m)
+ //{
+ // throw new NotImplementedException ();
+ //}
+
+ internal override Gtk.Widget CreateWidget () {
+ return new Gtk.Label (Text);
+ }
+ }
+}
diff --git a/mcs/class/System.Windows.Forms/Gtk/ProgressBar.cs b/mcs/class/System.Windows.Forms/Gtk/ProgressBar.cs
new file mode 100644
index 00000000000..c18aa28f0c9
--- /dev/null
+++ b/mcs/class/System.Windows.Forms/Gtk/ProgressBar.cs
@@ -0,0 +1,206 @@
+//
+// System.Windows.Forms.ProgressBar
+//
+// Author:
+// stubbed out by Jaak Simm (jaaksimm@firm.ee)
+// Remco de Jong (rdj@rdj.cg.nu)
+//
+// (C) Ximian, Inc., 2002
+//
+
+using System.Drawing;
+using System.Drawing.Printing;
+using System.ComponentModel;
+
+namespace System.Windows.Forms {
+
+ /// <summary>
+ /// Represents a Windows progress bar control.
+ ///
+ /// </summary>
+
+ [MonoTODO]
+ public sealed class ProgressBar : Control {
+
+ #region Fields
+ private int maximum;
+ private int minimum;
+ private int step;
+ private int val;
+ #endregion
+
+ #region Constructor
+ [MonoTODO]
+ public ProgressBar()
+ {
+ maximum=100;
+ minimum=0;
+ step=10;
+ val=0;
+ }
+ #endregion
+
+ internal override Gtk.Widget CreateWidget () {
+ Gtk.ProgressBar pbar = new Gtk.ProgressBar ();
+ return pbar;
+ }
+
+/* #region Properties
+ [MonoTODO]
+ public override bool AllowDrop {
+ get { throw new NotImplementedException (); }
+ set { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
+ public override Color BackColor {
+ get { throw new NotImplementedException (); }
+ set { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
+ public override Color ForeColor {
+ get { throw new NotImplementedException (); }
+ set { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
+ public override Image BackgroundImage {
+ get { throw new NotImplementedException (); }
+ set { throw new NotImplementedException (); }
+ }
+*/
+ /// This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
+ /// public new bool CausesValidation {get; set;}
+
+/* [MonoTODO]
+ protected override CreateParams CreateParams {
+ get { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
+ protected override ImeMode DefaultImeMode {
+ get { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
+ protected override Size DefaultSize {
+ get { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
+ public override Font Font {
+ get { throw new NotImplementedException (); }
+ set { throw new NotImplementedException (); }
+ }
+*/
+
+ /// This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
+ /// public new ImeMode ImeMode {get; set;}
+
+ public int Maximum {
+ get {
+ return maximum;
+ }
+ set {
+ maximum=value;
+ }
+ }
+
+ public int Minimum {
+ get {
+ return minimum;
+ }
+ set {
+ minimum=value;
+ }
+ }
+
+ /// This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
+ /// public new bool TabStop {get; set;}
+/* [MonoTODO]
+ public override RightToLeft RightToLeft {
+ get { throw new NotImplementedException (); }
+ set { throw new NotImplementedException (); }
+ }
+*/
+ public int Step {
+ get {
+ return step;
+ }
+ set {
+ step=value;
+ }
+ }
+
+ protected override void OnTextChanged(EventArgs e)
+ {
+ ((Gtk.ProgressBar)Widget).Text = Text;
+ }
+
+ public int Value {
+ get {
+ return val;
+ }
+ set {
+ if (val <= maximum) {
+ val=value;
+ float fraction = ((float) val / (float) maximum);
+ ((Gtk.ProgressBar)Widget).Fraction = fraction;
+ }
+ }
+ }
+// #endregion
+
+
+
+
+/* #region Methods
+ [MonoTODO]
+ protected override void CreateHandle()
+ {
+ throw new NotImplementedException ();
+ }
+*/
+ [MonoTODO]
+ public void Increment(int value)
+ {
+ Value += value;
+ }
+
+/* [MonoTODO]
+ protected override void OnHandleCreated(EventArgs e)
+ {
+ throw new NotImplementedException ();
+ }
+*/
+ [MonoTODO]
+ public void PerformStep()
+ {
+ Value += step;
+ }
+
+ [MonoTODO]
+ public override string ToString()
+ {
+ throw new NotImplementedException ();
+ }
+// #endregion
+
+
+
+
+ #region Events
+ /*
+ * This member supports the .NET Framework infrastructure and is not intended to be used directly from your code:
+ public new event EventHandler DoubleClick;
+ public new event EventHandler Enter;
+ public new event KeyEventHandler KeyDown;
+ public new event KeyPressEventHandler KeyPress;
+ public new event KeyEventHandler KeyUp;
+ public new event EventHandler Leave;
+ public new event PaintEventHandler Paint;
+ */
+ #endregion
+ }
+}
diff --git a/mcs/class/System.Windows.Forms/Gtk/ScrollBars.cs b/mcs/class/System.Windows.Forms/Gtk/ScrollBars.cs
new file mode 100644
index 00000000000..355b159bbfb
--- /dev/null
+++ b/mcs/class/System.Windows.Forms/Gtk/ScrollBars.cs
@@ -0,0 +1,21 @@
+//
+// System.Windows.Forms.ScrollBars.cs
+//
+// Author:
+// Dennis Hayes (dennish@raytek.com)
+// (C) 2002 Ximian, Inc. http://www.ximian.com
+//
+
+using System;
+
+namespace System.Windows.Forms {
+
+ /// <summary>
+ /// </summary>
+ public enum ScrollBars {
+ Both = 3,
+ Horizontal = 1,
+ None = 0,
+ Vertical = 2
+ }
+}
diff --git a/mcs/class/System.Windows.Forms/Gtk/ScrollableControl.cs b/mcs/class/System.Windows.Forms/Gtk/ScrollableControl.cs
new file mode 100644
index 00000000000..6bfa153b5c7
--- /dev/null
+++ b/mcs/class/System.Windows.Forms/Gtk/ScrollableControl.cs
@@ -0,0 +1,305 @@
+//
+// System.Windows.Forms.Form
+//
+// Author:
+// Miguel de Icaza (miguel@ximian.com)
+// stubbed out by Daniel Carrera (dcarrera@math.toronto.edu)
+//
+// (C) 2002 Ximian, Inc
+//
+
+using System;
+using System.Drawing;
+using Gtk;
+using GtkSharp;
+
+namespace System.Windows.Forms {
+ public class ScrollableControl : Control {
+
+ //
+ // --- Constructor
+ //
+ //[MonoTODO]
+ //public ScrollableControl()
+ //{
+ // throw new NotImplementedException ();
+ //}
+
+ //
+ // --- Public Properties
+ //
+ //[MonoTODO]
+ //public virtual bool AutoScroll {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ //[MonoTODO]
+ //public Size AutoScrollMargin {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ //[MonoTODO]
+ //public Size AutoScrollMinSize {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ //[MonoTODO]
+ //public Point AutoScrollPosition {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ //[MonoTODO]
+ //public override Rectangle DisplayRectangle {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ //[MonoTODO]
+ //public ScrollableControl.DockPaddingEdges DockPadding {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ //[MonoTODO]
+ //public override ISite Site {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+
+ //
+ // --- Public Methods
+ //
+ //[MonoTODO]
+ //public IAsyncResult BeginInvoke(Delegate del)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public IAsyncResult BeginInvoke(Delegate del, object[] objs)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void Dispose()
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public virtual bool Equals(object o);
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public static bool Equals(object o1, object o2);
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void Invalidate()
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void Invalidate(bool val)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void Invalidate(Rectangle rect)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void Invalidate(Region reg)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void Invalidate(Rectangle rect, bool val)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void Invalidate(Region reg, bool val)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public object Invoke(Delegate del)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public object Invoke(Delegate del, object[] objs)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void PerformLayout()
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void PerformLayout(Control ctl, string str)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void ResumeLayout()
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void ResumeLayout(bool val)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void Scale(float val)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void Scale(float val1, float val2)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void Select()
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void Select(bool val1, bool val2)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void SetBounds(int val1, int val2, int val3, int val4)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //public void SetBounds(int val1, int val2, int val3, int val4, BoundsSpecified bounds)
+ //{
+ // throw new NotImplementedException ();
+ //}
+
+ //
+ // --- Protected Properties
+ //
+ //[MonoTODO]
+ //protected override CreateParams CreateParams {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ //[MonoTODO]
+ //protected bool HScroll {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+ //[MonoTODO]
+ //protected bool VScroll {
+ // get {
+ // throw new NotImplementedException ();
+ // }
+ // set {
+ // throw new NotImplementedException ();
+ // }
+ //}
+
+ //
+ // --- Protected Methods
+ //
+ //[MonoTODO]
+ //protected virtual void AdjustFormScrollbars( bool displayScrollbars)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected override void Dispose(bool val)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected override void OnLayout(LayoutEventArgs levent)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected override void OnMouseWheel(MouseEventArgs e)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected override void OnVisibleChanged(EventArgs e)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //ContentAlignment RtlTranslateAlignment(ContentAlignment calign)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //HorizontalAlignment RtlTranslateAlignment(HorizontalAlignment halign)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //LeftRightAlignment RtlTranslateAlignment(LeftRightAlignment lralign)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected override void ScaleCore(float dx, float dy)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected void UpdateBounds()
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected void UpdateBounds(int val1, int val2, int val3, int val4)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected void UpdateBounds(int val1, int val2, int val3, int val4, int val5, int val6)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ //[MonoTODO]
+ //protected override void WndProc(ref Message m)
+ //{
+ // throw new NotImplementedException ();
+ //}
+ }
+}
diff --git a/mcs/class/System.Windows.Forms/Gtk/TextBox.cs b/mcs/class/System.Windows.Forms/Gtk/TextBox.cs
new file mode 100644
index 00000000000..6f0c3a805cd
--- /dev/null
+++ b/mcs/class/System.Windows.Forms/Gtk/TextBox.cs
@@ -0,0 +1,218 @@
+//
+// System.Windows.Forms.TextBox
+//
+// Author:
+// stubbed out by Jackson Harper (jackson@latitudegeo.com)
+// Dennis Hayes (dennish@raytek.com)
+// Remco de Jong (rdj@rdj.cg.nu)
+//
+// (C) 2002 Ximian, Inc
+//
+
+namespace System.Windows.Forms {
+
+ // <summary>
+ // This is only a template. Nothing is implemented yet.
+ //
+ // </summary>
+
+ public class TextBox : TextBoxBase {
+
+ private Gtk.TextView textview;
+ private ScrollBars scrollbars;
+ private HorizontalAlignment textalign;
+ private bool wordwrap;
+
+ //
+ // --- Public Constructor
+ //
+ public TextBox() {
+ scrollbars = ScrollBars.None;
+ }
+
+ internal override Gtk.Widget CreateWidget () {
+ // needs to initialized with a textbuffer from TextBoxBase
+ // we need default adjustments, but the scrolledwindow constructor does not take null as argument
+
+ Gtk.ScrolledWindow window = new Gtk.ScrolledWindow (new Gtk.Adjustment (IntPtr.Zero), new Gtk.Adjustment (IntPtr.Zero));
+ window.SetPolicy(Gtk.PolicyType.Never, Gtk.PolicyType.Never);
+ window.AddWithViewport(TextView);
+ return window;
+ }
+
+ // --- Public Properties
+
+ public override bool ReadOnly {
+ get
+ {
+ return !TextView.Editable;
+ }
+ set
+ {
+ if (value == TextView.Editable) { // only change if value is different, correct behaviour?
+ TextView.Editable = !value;
+ OnReadOnlyChanged(EventArgs.Empty);
+ }
+ }
+ }
+
+ [MonoTODO]
+ public bool AcceptsReturn {
+
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ set
+ {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+/* public CharacterCasing CharacterCasing {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ set
+ {
+ throw new NotImplementedException ();
+ }
+ }
+*/ [MonoTODO]
+ public char PasswordChar {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ set
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ScrollBars ScrollBars {
+ get {
+ return scrollbars;
+ }
+ set {
+ scrollbars = value;
+
+ Gtk.PolicyType vpolicy = Gtk.PolicyType.Never; // correct behaviour?
+ Gtk.PolicyType hpolicy = Gtk.PolicyType.Never;
+
+ if (scrollbars == ScrollBars.Both) {
+ vpolicy = Gtk.PolicyType.Always;
+ hpolicy = Gtk.PolicyType.Always;
+ }
+ else if (scrollbars == ScrollBars.Horizontal) {
+ hpolicy = Gtk.PolicyType.Always;
+ }
+ else if (scrollbars == ScrollBars.Vertical) {
+ vpolicy = Gtk.PolicyType.Always;
+ }
+
+ ((Gtk.ScrolledWindow) Widget).SetPolicy(hpolicy, vpolicy);
+ }
+ }
+
+ public HorizontalAlignment TextAlign {
+ get
+ {
+ return textalign;
+ }
+ set
+ {
+ Gtk.Justification justification = Gtk.Justification.Left;
+ if (value == HorizontalAlignment.Center) {
+ justification = Gtk.Justification.Center;
+ }
+ else if (value == HorizontalAlignment.Right) {
+ justification = Gtk.Justification.Right;
+ }
+
+ TextView.Justification = justification;
+ textalign = value;
+
+ OnTextAlignChanged(EventArgs.Empty);
+ }
+ }
+
+ public override bool WordWrap {
+ get
+ {
+ return wordwrap;
+ }
+ set
+ {
+ Gtk.WrapMode wrapmode = Gtk.WrapMode.None;
+ wordwrap = value;
+ if (wordwrap)
+ wrapmode = Gtk.WrapMode.Word;
+
+ TextView.WrapMode = wrapmode;
+ }
+ }
+
+
+ // --- Public Events
+
+ public event EventHandler TextAlignChanged;
+
+ // --- Protected Properties
+
+/* [MonoTODO]
+ protected override CreateParams CreateParams {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ protected override ImeMode DefaultImeMode {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ }
+*/
+ // --- Protected Members
+
+ protected Gtk.TextView TextView {
+ get {
+ if (textview == null) {
+ textview = new Gtk.TextView(TextBuffer);
+ textview.Show();
+ }
+ return textview;
+ }
+ }
+
+/* protected override bool IsInputKey(Keys keyData)
+ {
+ throw new NotImplementedException ();
+ }
+ [MonoTODO]
+ protected override void OnHandleCreated(EventArgs e)
+ {
+ throw new NotImplementedException ();
+ }
+ [MonoTODO]
+ protected override void OnMouseUp(MouseEventArgs mevent)
+ {
+ throw new NotImplementedException ();
+ }
+*/
+ protected virtual void OnTextAlignChanged(EventArgs e)
+ {
+ if (TextAlignChanged != null)
+ TextAlignChanged (this, e);
+ }
+
+/* [MonoTODO]
+ protected override void WndProc(ref Message m)
+ {
+ throw new NotImplementedException ();
+ }
+*/ }
+}
diff --git a/mcs/class/System.Windows.Forms/Gtk/TextBoxBase.cs b/mcs/class/System.Windows.Forms/Gtk/TextBoxBase.cs
new file mode 100644
index 00000000000..28e14422f38
--- /dev/null
+++ b/mcs/class/System.Windows.Forms/Gtk/TextBoxBase.cs
@@ -0,0 +1,442 @@
+//
+// System.Windows.Forms.TextBoxBase
+//
+// Author:
+// stubbed out by Jackson Harper (jackson@latitudegeo.com)
+// Dennis Hayes (dennish@raytek.com)
+// Remco de Jong (rdj@rdj.cg.nu)
+//
+// (C) 2002 Ximian, Inc
+//
+using System.Drawing;
+
+namespace System.Windows.Forms {
+
+ // <summary>
+ // This is only a template. Nothing is implemented yet.
+ //
+ // </summary>
+
+ public class TextBoxBase : Control {
+
+ private int maxlength = 0;
+ private Gtk.TextTagTable tagtable;
+ private Gtk.TextBuffer textbuffer = null;
+
+ //
+ // --- Public Properties
+ //
+
+ public TextBoxBase () {
+ }
+
+ protected Gtk.TextBuffer TextBuffer {
+ get {
+ if (textbuffer == null) {
+ tagtable = new Gtk.TextTagTable ();
+ textbuffer = new Gtk.TextBuffer (tagtable);
+ // attach events
+
+ textbuffer.ModifiedChanged += new EventHandler (modified_changed_cb);
+ }
+
+ return textbuffer;
+ }
+ }
+
+ protected override void OnTextChanged(EventArgs e)
+ {
+ TextBuffer.SetText(Text, Text.Length);
+ }
+
+ [MonoTODO]
+ public bool AcceptsTab {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ set
+ {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public virtual bool AutoSize {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ set
+ {
+ throw new NotImplementedException ();
+ }
+ }
+/* [MonoTODO]
+ public override Color BackColor {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ set
+ {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public override Color ForeColor {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ set
+ {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public override Image BackgroundImage {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ set
+ {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public BorderStyle BorderStyle {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ set
+ {
+ throw new NotImplementedException ();
+ }
+ }
+*/ [MonoTODO]
+ public bool CanUndo {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public bool HideSelection {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ set
+ {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public string[] Lines {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ set
+ {
+ Clear ();
+ foreach (String s in value) {
+ AppendText (s + "\n");
+ }
+ }
+ }
+ [MonoTODO]
+ public virtual int MaxLength {
+ get
+ {
+ return maxlength;
+ }
+ set
+ {
+ maxlength = value;
+ }
+ }
+
+ public bool Modified {
+ get
+ {
+ return TextBuffer.Modified;
+ }
+ set
+ {
+ if (TextBuffer.Modified != value) { // only call if it has really been changed since this will trigger an event, is this correct behavior?
+ TextBuffer.Modified = value;
+ }
+ }
+ }
+ [MonoTODO]
+ public virtual bool Multiline {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ set
+ {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public int PreferredHeight {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public virtual bool ReadOnly {
+ // needs to be overwritten by child classes
+ get { return false; }
+ set {}
+ }
+
+ [MonoTODO]
+ public virtual string SelectedText {
+ get
+ {
+ String selection = "";
+ Gtk.TextIter start;
+ Gtk.TextIter end;
+
+ if (TextBuffer.GetSelectionBounds(ref start, ref end))
+ selection = TextBuffer.GetText(start, end, true);
+
+ return selection;
+ }
+ set
+ {
+ // paste text over selection
+ }
+ }
+ [MonoTODO]
+ public virtual int SelectionLength {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ set
+ {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public int SelectionStart {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ set
+ {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ public virtual int TextLength {
+
+ get
+ {
+ return Text.Length;
+ }
+ }
+ [MonoTODO]
+
+ public virtual bool WordWrap {
+ get
+ {
+ return false;
+ }
+ set
+ {
+ }
+ }
+
+ // --- Public Methods
+
+ public void AppendText(string text)
+ {
+ Text += text;
+ }
+
+ public void Clear()
+ {
+ TextBuffer.SetText("", 0);
+ }
+ [MonoTODO]
+ public void ClearUndo()
+ {
+ throw new NotImplementedException ();
+ }
+ [MonoTODO]
+ public void Copy()
+ {
+ throw new NotImplementedException ();
+ }
+ [MonoTODO]
+ public void Cut()
+ {
+ throw new NotImplementedException ();
+ }
+ [MonoTODO]
+ public void Paste()
+ {
+ throw new NotImplementedException ();
+ }
+ [MonoTODO]
+ public void ScrollToCaret()
+ {
+ throw new NotImplementedException ();
+ }
+ [MonoTODO]
+ public void Select(int start, int length)
+ {
+ throw new NotImplementedException ();
+ }
+ [MonoTODO]
+ public void SelectAll()
+ {
+ throw new NotImplementedException ();
+ }
+ [MonoTODO]
+ public override string ToString()
+ {
+ throw new NotImplementedException ();
+ }
+ [MonoTODO]
+ public void Undo()
+ {
+ throw new NotImplementedException ();
+ }
+
+ // --- Internal Events (Gtk)
+
+ internal protected void modified_changed_cb (object o, EventArgs args)
+ {
+ OnModifiedChanged (EventArgs.Empty);
+ }
+
+ // --- Public Events
+
+ [MonoTODO]
+ public event EventHandler AcceptsTabChanged;
+ [MonoTODO]
+ public event EventHandler AutoSizeChanged;
+ [MonoTODO]
+ public event EventHandler BorderStyleChanged;
+ [MonoTODO]
+ //public override event EventHandler Click;
+ [MonoTODO]
+ public event EventHandler HideSelectionChanged;
+ public event EventHandler ModifiedChanged;
+ [MonoTODO]
+ public event EventHandler MultilineChanged;
+ public event EventHandler ReadOnlyChanged;
+
+ // --- Protected Properties
+/*
+ [MonoTODO]
+ protected override CreateParams CreateParams {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ }
+ [MonoTODO]
+ protected override Size DefaultSize {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ // --- Protected Methods
+
+ [MonoTODO]
+ protected override void CreateHandle()
+ {
+ throw new NotImplementedException ();
+ }
+*/
+ [MonoTODO]
+/* protected override bool IsInputKey(Keys keyData)
+ {
+ throw new NotImplementedException ();
+ }
+*/ [MonoTODO]
+ protected virtual void OnAcceptsTabChanged(EventArgs e)
+ {
+ throw new NotImplementedException ();
+ }
+ [MonoTODO]
+ protected virtual void OnAutoSizeChanged(EventArgs e)
+ {
+ throw new NotImplementedException ();
+ }
+ [MonoTODO]
+ protected virtual void OnBorderStyleChanged(EventArgs e)
+ {
+ throw new NotImplementedException ();
+ }
+
+/*
+ [MonoTODO]
+ protected override void OnFontChanged(EventArgs e)
+ {
+ throw new NotImplementedException ();
+ }
+ [MonoTODO]
+ protected override void OnHandleCreated(EventArgs e)
+ {
+ throw new NotImplementedException ();
+ }
+ [MonoTODO]
+ protected override void OnHandleDestroyed(EventArgs e)
+ {
+ throw new NotImplementedException ();
+ }
+*/
+ [MonoTODO]
+ protected virtual void OnHideSelectionChanged(EventArgs e)
+ {
+ throw new NotImplementedException ();
+ }
+ [MonoTODO]
+ protected virtual void OnModifiedChanged(EventArgs e)
+ {
+ if (ModifiedChanged != null)
+ ModifiedChanged (this, e);
+ }
+ [MonoTODO]
+ protected virtual void OnMultilineChanged(EventArgs e)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected virtual void OnReadOnlyChanged(EventArgs e)
+ {
+ if (ReadOnlyChanged != null)
+ ReadOnlyChanged (this, e);
+ }
+/* [MonoTODO]
+ protected override bool ProcessDialogKey(Keys keyData)
+ {
+ throw new NotImplementedException ();
+ }
+ [MonoTODO]
+ protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
+ {
+ throw new NotImplementedException ();
+ }
+ [MonoTODO]
+ protected override void WndProc(ref Message m)
+ {
+ throw new NotImplementedException ();
+ }
+*/ }
+}
+
diff --git a/mcs/class/System.Windows.Forms/Gtk/changelog b/mcs/class/System.Windows.Forms/Gtk/changelog
new file mode 100644
index 00000000000..1ba86b3a7ea
--- /dev/null
+++ b/mcs/class/System.Windows.Forms/Gtk/changelog
@@ -0,0 +1,13 @@
+2002-8-7 DennisHayes <dennish@raytek.com>
+
+* Started changelog
+
+2002-8-7 DennisHayes <dennish@raytek.com>
+Check in for Remco de Jong <rdj@rdj.cg.nu>
+
+* HorizontalAlignment.cs
+* ProgressBar.cs
+* ScrollBars.cs
+* TextBox.cs
+* TextBoxBase.cs
+* added new files with some functinality
diff --git a/mcs/class/System.Windows.Forms/Gtk/demo.cs b/mcs/class/System.Windows.Forms/Gtk/demo.cs
new file mode 100644
index 00000000000..d0a6abbe9f1
--- /dev/null
+++ b/mcs/class/System.Windows.Forms/Gtk/demo.cs
@@ -0,0 +1,58 @@
+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;
+ }
+ }
+}
diff --git a/mcs/class/System.Windows.Forms/Gtk/makefile b/mcs/class/System.Windows.Forms/Gtk/makefile
new file mode 100644
index 00000000000..d7857734d5c
--- /dev/null
+++ b/mcs/class/System.Windows.Forms/Gtk/makefile
@@ -0,0 +1,26 @@
+CSC=mcs
+SWFF=-r gtk-sharp -r glib-sharp -r System.Drawing
+
+SOURCES = \
+ AnchorStyles.cs \
+ Application.cs \
+ ContainerControl.cs \
+ Button.cs \
+ ButtonBase.cs \
+ Control.cs \
+ ControlEventArgs.cs \
+ ControlEventHandler.cs \
+ DialogResult.cs \
+ Form.cs \
+ IButtonControl.cs \
+ IContainerControl.cs \
+ Label.cs \
+ ScrollableControl.cs
+
+all: demo.exe
+
+demo.exe: demo.cs System.Windows.Forms.dll
+ $(CSC) demo.cs -r System.Windows.Forms.dll -r System.Drawing
+
+System.Windows.Forms.dll: $(SOURCES)
+ $(CSC) $(SWFF) --target library -o System.Windows.Forms.dll $(SOURCES)