소스 검색

- Initial check-in

svn path=/trunk/mcs/; revision=30913
Peter Dennis Bartok 21 년 전
부모
커밋
908ff003b9
100개의 변경된 파일13222개의 추가작업 그리고 0개의 파일을 삭제
  1. 49 0
      mcs/class/Managed.Windows.Forms/Assembly/AssemblyInfo.cs
  2. 13 0
      mcs/class/Managed.Windows.Forms/Assembly/ChangeLog
  3. 48 0
      mcs/class/Managed.Windows.Forms/Assembly/Consts.cs
  4. 24 0
      mcs/class/Managed.Windows.Forms/Assembly/Locale.cs
  5. 15 0
      mcs/class/Managed.Windows.Forms/Makefile
  6. 44 0
      mcs/class/Managed.Windows.Forms/README
  7. 95 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms.dll.sources
  8. 327 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/AccessibleObject.cs
  9. 102 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/AccessibleRole.cs
  10. 72 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/AccessibleStates.cs
  11. 44 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/AnchorStyles.cs
  12. 293 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs
  13. 100 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/ApplicationContext.cs
  14. 93 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/BaseCollection.cs
  15. 106 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/Binding.cs
  16. 152 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/BindingContext.cs
  17. 98 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/BindingMemberInfo.cs
  18. 118 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/BindingsCollection.cs
  19. 125 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/BindingsManagerBase.cs
  20. 45 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/Border3DSide.cs
  21. 49 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/Border3DStyle.cs
  22. 42 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/BorderStyle.cs
  23. 50 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/BoundsSpecified.cs
  24. 45 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/ButtonBorderStyle.cs
  25. 45 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/ButtonState.cs
  26. 44 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/CaptionButton.cs
  27. 4 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
  28. 559 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/CheckBox.cs
  29. 139 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContainerControl.cs
  30. 1706 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
  31. 54 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/ControlEventArgs.cs
  32. 38 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/ControlEventHandler.cs
  33. 1475 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/ControlPaint.cs
  34. 54 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/ControlStyles.cs
  35. 66 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/ConvertEventArgs.cs
  36. 38 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/ConvertEventHandler.cs
  37. 44 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/Copyright
  38. 129 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/CreateParams.cs
  39. 45 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/DockStyle.cs
  40. 42 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/DragAction.cs
  41. 45 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/DragDropEffects.cs
  42. 100 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/DragEventArgs.cs
  43. 38 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/DragEventHandler.cs
  44. 43 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/FlatStyle.cs
  45. 189 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
  46. 41 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/FrameStyle.cs
  47. 66 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/GiveFeedbackEventArgs.cs
  48. 38 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/GiveFeedbackEventHandler.cs
  49. 68 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/HelpEventArgs.cs
  50. 38 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/HelpEventHandler.cs
  51. 46 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/IContainerControl.cs
  52. 56 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/IDataObject.cs
  53. 40 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/IMessageFilter.cs
  54. 44 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/IWin32Window.cs
  55. 51 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/ImeMode.cs
  56. 144 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/InputLanguage.cs
  57. 78 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/InputLanguageChangedEventArgs.cs
  58. 38 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/InputLanguageChangedEventHandler.cs
  59. 78 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/InputLanguageChangingEventArgs.cs
  60. 38 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/InputLanguageChangingEventHandler.cs
  61. 91 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/InputLanguageCollection.cs
  62. 56 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/InvalidateEventArgs.cs
  63. 38 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/InvalidateEventHandler.cs
  64. 114 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/KeyEventArgs.cs
  65. 38 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/KeyEventHandler.cs
  66. 66 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/KeyPressEventArgs.cs
  67. 38 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/KeyPressEventHandler.cs
  68. 222 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/Keys.cs
  69. 472 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/Label.cs
  70. 62 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/LayoutEventArgs.cs
  71. 38 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/LayoutEventHandler.cs
  72. 44 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuGlyph.cs
  73. 128 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/Message.cs
  74. 45 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/MouseButtons.cs
  75. 86 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/MouseEventArgs.cs
  76. 38 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/MouseEventHandler.cs
  77. 168 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/NativeWindow.cs
  78. 84 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/PaintEventArgs.cs
  79. 38 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/PaintEventHandler.cs
  80. 288 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/ProgressBar.cs
  81. 88 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/QueryAccessibilityHelpEventArgs.cs
  82. 38 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/QueryAccessibilityHelpEventHandler.cs
  83. 74 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/QueryContinueDragEventArgs.cs
  84. 38 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/QueryContinueDragEventHandler.cs
  85. 42 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/RightToLeft.cs
  86. 560 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/SWF.csproj
  87. 48 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/SWF.csproj.user
  88. 856 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollBar.cs
  89. 43 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollBars.cs
  90. 45 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollButton.cs
  91. 68 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollEventArgs.cs
  92. 38 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollEventHandler.cs
  93. 48 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollEventType.cs
  94. 306 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs
  95. 4 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/TODO
  96. 54 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/TODOAttribute.cs
  97. 46 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/UICues.cs
  98. 94 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/UICuesEventArgs.cs
  99. 38 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/UICuesEventHandler.cs
  100. 630 0
      mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Structs.cs

+ 49 - 0
mcs/class/Managed.Windows.Forms/Assembly/AssemblyInfo.cs

@@ -0,0 +1,49 @@
+//
+// AssemblyInfo.cs
+//
+// Author:
+//   Andreas Nahr ([email protected])
+//
+// (C) 2003 Ximian, Inc.  http://www.ximian.com
+//
+
+using System;
+using System.Reflection;
+using System.Resources;
+using System.Security;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about the System.Windows.Forms assembly
+
+#if (NET_1_0)
+	[assembly: AssemblyVersion("1.0.3300.0")]
+	[assembly: SatelliteContractVersion("1.0.3300.0")]
+#elif (NET_2_0)
+	[assembly: AssemblyVersion ("2.0.3600.0")]
+	[assembly: SatelliteContractVersion ("2.0.3600.0")]
+#elif (NET_1_1)
+	[assembly: AssemblyVersion("1.0.5000.0")]
+	[assembly: SatelliteContractVersion("1.0.5000.0")]
+	[assembly: ComCompatibleVersion(1, 0, 3300, 0)]
+	[assembly: TypeLibVersion(1, 10)]
+#endif
+
+[assembly: AssemblyTitle("System.Windows.Forms.dll")]
+[assembly: AssemblyDescription("System.Windows.Forms.dll")]
+[assembly: AssemblyConfiguration("Development version")]
+[assembly: AssemblyCompany("MONO development team")]
+[assembly: AssemblyProduct("MONO CLI")]
+[assembly: AssemblyCopyright("(c) 2003 Various Authors")]
+[assembly: AssemblyTrademark("")]
+
+[assembly: CLSCompliant(true)]
+[assembly: ComVisible(false)]
+[assembly: AssemblyDefaultAlias("System.Windows.Forms.dll")]
+[assembly: AssemblyInformationalVersion("0.0.0.1")]
+[assembly: NeutralResourcesLanguage("en-US")]
+
+[assembly: AllowPartiallyTrustedCallers()]
+
+[assembly: AssemblyDelaySign(true)]
+[assembly: AssemblyKeyFile("../ecma.pub")]

+ 13 - 0
mcs/class/Managed.Windows.Forms/Assembly/ChangeLog

@@ -0,0 +1,13 @@
+2004-04-13  Andreas Nahr <[email protected]>
+
+	* Consts.cs: Added
+
+2004-04-08  Gonzalo Paniagua Javier <[email protected]>
+
+	* AssemblyInfo.cs: patch by Gert Driesen that makes SWF CLS compliant.
+
+2004-03-15  Andreas Nahr <[email protected]>
+
+	* AssemblyInfo.cs: Added
+	* Locale.cs: Added
+	* ChangeLog: Added

+ 48 - 0
mcs/class/Managed.Windows.Forms/Assembly/Consts.cs

@@ -0,0 +1,48 @@
+//
+// Consts.cs
+//
+// Author:
+//   Andreas Nahr ([email protected])
+//
+// (C) 2003 Andreas Nahr
+//
+// NOTE:
+//	Ensure that every constant is defined for every version symbol!
+//
+
+// This class contains constants that are dependent on the defined symbols
+// Use it to shorten and make code more maintainable in situations like:
+//
+//#if (NET_1_0)
+//	[Designer ("System.Diagnostics.Design.ProcessDesigner, System.Design, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof (IDesigner))]
+//#endif
+//#if (NET_1_1)
+//    	[Designer ("System.Diagnostics.Design.ProcessDesigner, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof (IDesigner))]
+//#endif
+//
+// by changing them into:
+//
+// [Designer ("System.Diagnostics.Design.ProcessDesigner, " + Consts.AssemblySystem_Design, typeof (IDesigner))]
+//
+
+internal sealed class Consts
+{
+	
+	private Consts ()
+	{
+	}
+
+#if (NET_1_0)
+
+	public const string AssemblySystem_Design = "System.Design, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
+
+//#elif (NET_1_1)
+#else
+	// NET_1_1 is seen as default if somebody 'forgets' to specify any of the symbols
+	// to ensure we are not breaking the build in this case
+
+	public const string AssemblySystem_Design = "System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
+
+#endif
+
+}

+ 24 - 0
mcs/class/Managed.Windows.Forms/Assembly/Locale.cs

@@ -0,0 +1,24 @@
+//
+// Locale.cs
+//
+// Author:
+//   Miguel de Icaza ([email protected])
+//   Andreas Nahr ([email protected])
+//
+// (C) 2001 - 2003 Ximian, Inc (http://www.ximian.com)
+//
+
+internal sealed class Locale {
+
+	private Locale ()
+	{
+	}
+
+	/// <summary>
+	///   Returns the translated message for the current locale
+	/// </summary>
+	public static string GetText (string msg)
+	{
+		return msg;
+	}
+}

+ 15 - 0
mcs/class/Managed.Windows.Forms/Makefile

@@ -0,0 +1,15 @@
+thisdir = class/System.Windows.Forms
+include ../../build/rules.make
+
+LIBRARY = System.Windows.Forms.dll
+LIB_MCS_FLAGS = /unsafe \
+	/r:$(corlib) /r:System.dll /r:System.Xml.dll \
+	/r:System.Drawing.dll /r:Accessibility.dll \
+	/nowarn:649 /nowarn:169 /nowarn:67 /nowarn:108 /nowarn:114
+
+EXTRA_DISTFILES = \
+	README
+
+NO_TEST = yes
+
+include ../../build/library.make

+ 44 - 0
mcs/class/Managed.Windows.Forms/README

@@ -0,0 +1,44 @@
+Managed.Windows.Forms README
+$Revision: 1.1 $
+
+* Introduction
+
+Managed.Windows.Forms is a managed implementation of System.Windows.Forms.
+It implements a driver interface to allow running on multiple windowing systems,
+for example X11 or Windows. All controls are implemented in managed code,
+using System.Drawing to draw them.
+
+
+* Status
+
+This library is in pre-alpha state. Development is still in the very early
+stages. Bug reports are welcome, provided they don't just point out missing
+classes. Please use http://bugzilla.ximian.com/
+
+
+* Contributions
+
+No contributions providing only stubs will be accepted at this time. We ask
+that you submit contributions for review before committing them, our goal is 
+to have a consistent and complete implementation, ideally having most or all
+methods and properties of a class written by the same author. This will ensure
+a certain degree of consistency in the code.
+
+The core team for Managed.Windows.Forms currently are:
+	Jordi Mas i Hernandez	([email protected])
+	Jackson Harper		([email protected])
+	Ravindra Kumar		([email protected])
+	Peter Bartok		([email protected])
+
+
+* Mailing List
+
+There is a mailing list dedicated to Mono's System.Windows.Forms 
+implementation, mono-winforms-list, see 
+http://lists.ximian.com/mailman/listinfo/mono-winforms-list
+
+
+* To run System.Windows.Forms Applications
+
+You should use the old Wine-based implementation until this library is
+more functional and reaches beta-stage.

+ 95 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms.dll.sources

@@ -0,0 +1,95 @@
+Assembly/AssemblyInfo.cs
+Assembly/Consts.cs
+Assembly/Locale.cs
+System.Windows.Forms/AccessibleObject.cs
+System.Windows.Forms/AccessibleRole.cs
+System.Windows.Forms/AccessibleStates.cs
+System.Windows.Forms/AnchorStyles.cs
+System.Windows.Forms/Application.cs
+System.Windows.Forms/ApplicationContext.cs
+System.Windows.Forms/BaseCollection.cs
+System.Windows.Forms/Binding.cs
+System.Windows.Forms/BindingContext.cs
+System.Windows.Forms/BindingMemberInfo.cs
+System.Windows.Forms/BindingsCollection.cs
+System.Windows.Forms/BindingsManagerBase.cs
+System.Windows.Forms/Border3DSide.cs
+System.Windows.Forms/Border3DStyle.cs
+System.Windows.Forms/BorderStyle.cs
+System.Windows.Forms/BoundsSpecified.cs
+System.Windows.Forms/ButtonBorderStyle.cs
+System.Windows.Forms/ButtonState.cs
+System.Windows.Forms/CaptionButton.cs
+System.Windows.Forms/ContainerControl.cs
+System.Windows.Forms/Control.cs
+System.Windows.Forms/ControlEventArgs.cs
+System.Windows.Forms/ControlEventHandler.cs
+System.Windows.Forms/ControlPaint.cs
+System.Windows.Forms/ControlStyles.cs
+System.Windows.Forms/ConvertEventArgs.cs
+System.Windows.Forms/ConvertEventHandler.cs
+System.Windows.Forms/CreateParams.cs
+System.Windows.Forms/DockStyle.cs
+System.Windows.Forms/DragAction.cs
+System.Windows.Forms/DragDropEffects.cs
+System.Windows.Forms/DragEventArgs.cs
+System.Windows.Forms/DragEventHandler.cs
+System.Windows.Forms/FlatStyle.cs
+System.Windows.Forms/Form.cs
+System.Windows.Forms/FrameStyle.cs
+System.Windows.Forms/GiveFeedbackEventArgs.cs
+System.Windows.Forms/GiveFeedbackEventHandler.cs
+System.Windows.Forms/HelpEventArgs.cs
+System.Windows.Forms/HelpEventHandler.cs
+System.Windows.Forms/IContainerControl.cs
+System.Windows.Forms/IDataObject.cs
+System.Windows.Forms/ImeMode.cs
+System.Windows.Forms/IMessageFilter.cs
+System.Windows.Forms/InputLanguage.cs
+System.Windows.Forms/InputLanguageChangedEventArgs.cs
+System.Windows.Forms/InputLanguageChangedEventHandler.cs
+System.Windows.Forms/InputLanguageChangingEventArgs.cs
+System.Windows.Forms/InputLanguageChangingEventHandler.cs
+System.Windows.Forms/InputLanguageCollection.cs
+System.Windows.Forms/InvalidateEventArgs.cs
+System.Windows.Forms/InvalidateEventHandler.cs
+System.Windows.Forms/IWin32Window.cs
+System.Windows.Forms/KeyEventArgs.cs
+System.Windows.Forms/KeyEventHandler.cs
+System.Windows.Forms/KeyPressEventArgs.cs
+System.Windows.Forms/KeyPressEventHandler.cs
+System.Windows.Forms/Keys.cs
+System.Windows.Forms/Label.cs
+System.Windows.Forms/LayoutEventArgs.cs
+System.Windows.Forms/LayoutEventHandler.cs
+System.Windows.Forms/MenuGlyph.cs
+System.Windows.Forms/Message.cs
+System.Windows.Forms/MouseButtons.cs
+System.Windows.Forms/MouseEventArgs.cs
+System.Windows.Forms/MouseEventHandler.cs
+System.Windows.Forms/NativeWindow.cs
+System.Windows.Forms/PaintEventArgs.cs
+System.Windows.Forms/PaintEventHandler.cs
+System.Windows.Forms/ProgressBar.cs
+System.Windows.Forms/RightToLeft.cs
+System.Windows.Forms/QueryAccessibilityHelpEventArgs.cs
+System.Windows.Forms/QueryAccessibilityHelpEventHandler.cs
+System.Windows.Forms/QueryContinueDragEventArgs.cs
+System.Windows.Forms/QueryContinueDragEventHandler.cs
+System.Windows.Forms/ScrollableControl.cs
+System.Windows.Forms/ScrollEventArgs.cs
+System.Windows.Forms/ScrollEventHandler.cs
+System.Windows.Forms/ScrollEventType.cs
+System.Windows.Forms/ScrollBar.cs
+System.Windows.Forms/ScrollBars.cs
+System.Windows.Forms/ScrollButton.cs
+System.Windows.Forms/TODOAttribute.cs
+System.Windows.Forms/UICues.cs
+System.Windows.Forms/UICuesEventArgs.cs
+System.Windows.Forms/UICuesEventHandler.cs
+System.Windows.Forms/X11Structs.cs
+System.Windows.Forms/XplatUI.cs
+System.Windows.Forms/XplatUIDriver.cs
+System.Windows.Forms/XplatUIStructs.cs
+System.Windows.Forms/XplatUIWin32.cs
+System.Windows.Forms/XplatUIX11.cs

+ 327 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/AccessibleObject.cs

@@ -0,0 +1,327 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: AccessibleObject.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// NOT COMPLETE
+
+using Accessibility;
+using System.Drawing;
+using System.Globalization;
+using System.Reflection;
+
+namespace System.Windows.Forms {
+	public class AccessibleObject : MarshalByRefObject, IReflect, IAccessible {
+		#region Private Variables
+		private string		name;
+		private string		value;
+		private Control		owner;
+		internal AccessibleRole	role;
+		internal string		default_action;
+		internal string		description;
+		internal string		help;
+		internal string		keyboard_shortcut;
+		#endregion	// Private Variables
+
+		#region Public Constructors
+		public AccessibleObject() {
+			this.owner=null;
+			this.value=null;
+			this.name=null;
+			this.role=AccessibleRole.Default;
+			this.default_action=null;
+			this.description=null;
+			this.help=null;
+			this.keyboard_shortcut=null;
+		}
+		#endregion	// Public Constructors
+
+		#region Private Constructors
+		internal AccessibleObject(Control owner) : this () {
+			this.owner=owner;
+		}
+		#endregion	// Private Constructors
+
+		#region Public Instance Properties
+		public virtual Rectangle Bounds {
+			get {
+				return Rectangle.Empty;
+			}
+		}
+
+		public virtual string DefaultAction {
+			get {
+				return default_action;
+			}
+		}
+
+		public virtual string Description {
+			get {
+				return description;
+			}
+		}
+
+		public virtual string Help {
+			get {
+				return help;
+			}
+		}
+
+		public virtual string KeyboardShortcut {
+			get {
+				return keyboard_shortcut;
+			}
+		}
+
+		public virtual string Name {
+			get {
+				return name;
+			}
+
+			set {
+				name=value;
+			}
+		}
+
+		public virtual AccessibleObject Parent {
+			get {
+				if ((owner!=null) && (owner.Parent!=null)) {
+					return owner.Parent.AccessibilityObject;
+				}
+				return null;
+			}
+		}
+
+		public virtual AccessibleRole Role {
+			get {
+				return role;
+			}
+		}
+
+		public virtual AccessibleStates State {
+			get {
+				AccessibleStates	state=AccessibleStates.None;
+
+				if (owner!=null) {
+					if (owner.Focused) {
+						state |= AccessibleStates.Focused;
+					}
+
+					if (!owner.Visible) {
+						state |= AccessibleStates.Invisible;
+					}
+				}
+				return state;
+			}
+		}
+
+		public virtual string Value {
+			get {
+				return this.value;
+			}
+
+			set {
+				this.value=value;
+			}
+		}
+		#endregion	// Public Instance Properties
+
+		#region Public Instance Methods
+		public virtual void DoDefaultAction() {
+			if (owner!=null) {
+				owner.DoDefaultAction();
+			}
+		}
+
+		public virtual AccessibleObject GetChild(int index) {
+			if (owner!=null) {
+				if (index<owner.num_of_children) {
+					return owner.children[index].AccessibilityObject;
+				}
+			}
+			return null;
+		}
+
+		public virtual int GetChildCount() {
+			if (owner!=null) {
+				return owner.num_of_children;
+			}
+			return -1;
+		}
+		#endregion	// Public Instance Methods
+
+		#region	IReflection Methods and Properties
+		FieldInfo IReflect.GetField(String name, BindingFlags bindingAttr) {
+			throw new NotImplementedException();
+		}       
+
+		FieldInfo[] IReflect.GetFields(BindingFlags bindingAttr) {
+			throw new NotImplementedException();
+		}    
+
+		MemberInfo[] IReflect.GetMember(String name, BindingFlags bindingAttr) {
+			throw new NotImplementedException();
+		}
+
+		MemberInfo[] IReflect.GetMembers(BindingFlags bindingAttr) {
+			throw new NotImplementedException();
+		}
+
+		MethodInfo IReflect.GetMethod(String name, BindingFlags bindingAttr) {
+			throw new NotImplementedException();
+		}
+
+		MethodInfo IReflect.GetMethod(String name, BindingFlags bindingAttr, Binder binder, Type[] types, ParameterModifier[] modifiers) {
+			throw new NotImplementedException();
+		}
+
+		MethodInfo[] IReflect.GetMethods(BindingFlags bindingAttr) {
+			throw new NotImplementedException();
+		}
+
+		PropertyInfo IReflect.GetProperty(String name, BindingFlags bindingAttr) {
+			throw new NotImplementedException();
+		}
+
+		PropertyInfo IReflect.GetProperty(String name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) {
+			throw new NotImplementedException();
+		}
+
+		PropertyInfo[] IReflect.GetProperties(BindingFlags bindingAttr) {
+			throw new NotImplementedException();
+		}
+
+		Object IReflect.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) {
+			throw new NotImplementedException();
+		}
+
+		Type IReflect.UnderlyingSystemType {
+			get {
+				throw new NotImplementedException();
+			}
+		}
+		#endregion	// IReflection Methods and Properties
+
+		#region IAccessible Methods and Properties
+		void IAccessible.accDoDefaultAction(object childID) {
+			throw new NotImplementedException();
+		}
+
+		int IAccessible.accChildCount {
+			get {
+				throw new NotImplementedException();
+			}
+		}
+
+		object IAccessible.accFocus {
+			get {
+				throw new NotImplementedException();
+			}
+		}
+
+		object IAccessible.accHitTest(int xLeft, int yTop) {
+			throw new NotImplementedException();
+		}
+
+		void IAccessible.accLocation(out int pxLeft, out int pyTop, out int pcxWidth, out int pcyHeight, object childID) {
+			throw new NotImplementedException();
+		}
+
+		object IAccessible.accNavigate(int navDir, object childID) {
+			throw new NotImplementedException();
+		}
+
+		object IAccessible.accParent {
+			get {
+				throw new NotImplementedException();
+			}
+		}
+
+                void IAccessible.accSelect(int flagsSelect, object childID) {
+			throw new NotImplementedException();
+                }
+
+                object IAccessible.accSelection {
+                        get {
+				throw new NotImplementedException();
+			}
+		}
+
+		object IAccessible.get_accChild(object childID) {
+			throw new NotImplementedException();
+		}
+
+		string IAccessible.get_accDefaultAction(object childID) {
+			throw new NotImplementedException();
+		}
+
+		string IAccessible.get_accDescription(object childID) {
+			throw new NotImplementedException();
+		}
+
+		string IAccessible.get_accHelp(object childID) {
+			throw new NotImplementedException();
+		}
+
+		int IAccessible.get_accHelpTopic(out string pszHelpFile,object childID) {
+			throw new NotImplementedException();
+		}
+
+		string IAccessible.get_accKeyboardShortcut(object childID) {
+			throw new NotImplementedException();
+		}
+
+		string IAccessible.get_accName(object childID) {
+			throw new NotImplementedException();
+		}
+
+		object IAccessible.get_accRole(object childID) {
+			throw new NotImplementedException();
+		}
+
+		object IAccessible.get_accState(object childID) {
+			throw new NotImplementedException();
+		}
+
+		string IAccessible.get_accValue(object childID) {
+			throw new NotImplementedException();
+		}
+
+		void IAccessible.set_accName(object childID, string newName) {
+			throw new NotImplementedException();
+		}
+
+		void IAccessible.set_accValue(object childID, string newValue) {
+			throw new NotImplementedException();
+                }
+		#endregion	// IAccessible Methods and Properties
+	}
+}

+ 102 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/AccessibleRole.cs

@@ -0,0 +1,102 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: AccessibleRole.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public enum AccessibleRole {
+		None		= 0,
+		TitleBar	= 1,
+		MenuBar		= 2,
+		ScrollBar	= 3,
+		Grip		= 4,
+		Sound		= 5,
+		Cursor		= 6,
+		Caret		= 7,
+		Alert		= 8,
+		Window		= 9,
+		Client		= 10,
+		MenuPopup	= 11,
+		MenuItem	= 12,
+		ToolTip		= 13,
+		Application	= 14,
+		Document	= 15,
+		Pane		= 16,
+		Chart		= 17,
+		Dialog		= 18,
+		Border		= 19,
+		Grouping	= 20,
+		Separator	= 21,
+		ToolBar		= 22,
+		StatusBar	= 23,
+		Table		= 24,
+		ColumnHeader	= 25,
+		RowHeader	= 26,
+		Column		= 27,
+		Row		= 28,
+		Cell		= 29,
+		Link		= 30,
+		HelpBalloon	= 31,
+		Character	= 32,
+		List		= 33,
+		ListItem	= 34,
+		Outline		= 35,
+		OutlineItem	= 36,
+		PageTab		= 37,
+		PropertyPage	= 38,
+		Indicator	= 39,
+		Graphic		= 40,
+		StaticText	= 41,
+		Text		= 42,
+		PushButton	= 43,
+		CheckButton	= 44,
+		RadioButton	= 45,
+		ComboBox	= 46,
+		DropList	= 47,
+		ProgressBar	= 48,
+		Dial		= 49,
+		HotkeyField	= 50,
+		Slider		= 51,
+		SpinButton	= 52,
+		Diagram		= 53,
+		Animation	= 54,
+		Equation	= 55,
+		ButtonDropDown	= 56,
+		ButtonMenu	= 57,
+		ButtonDropDownGrid= 58,
+		WhiteSpace	= 59,
+		PageTabList	= 60,
+		Clock		= 61,
+		Default		= -1
+	}
+}

+ 72 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/AccessibleStates.cs

@@ -0,0 +1,72 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: AccessibleStates.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public enum AccessibleStates {
+		None		= 0x00000000,
+		Unavailable	= 0x00000001,
+		Selected	= 0x00000002,
+		Focused		= 0x00000004,
+		Pressed		= 0x00000008,
+		Checked		= 0x00000010,
+		Mixed		= 0x00000020,
+		Indeterminate	= 0x00000020,
+		ReadOnly	= 0x00000040,
+		HotTracked	= 0x00000080,
+		Default		= 0x00000100,
+		Expanded	= 0x00000200,
+		Collapsed	= 0x00000400,
+		Busy		= 0x00000800,
+		Floating	= 0x00001000,
+		Marqueed	= 0x00002000,
+		Animated	= 0x00004000,
+		Invisible	= 0x00008000,
+		Offscreen	= 0x00010000,
+		Sizeable	= 0x00020000,
+		Moveable	= 0x00040000,
+		SelfVoicing	= 0x00080000,
+		Focusable	= 0x00100000,
+		Selectable	= 0x00200000,
+		Linked		= 0x00400000,
+		Traversed	= 0x00800000,
+		MultiSelectable	= 0x01000000,
+		ExtSelectable	= 0x02000000,
+		AlertLow	= 0x04000000,
+		AlertMedium	= 0x08000000,
+		AlertHigh	= 0x10000000,
+		Protected	= 0x20000000,
+		Valid		= 0x3FFFFFFF
+	}
+}

+ 44 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/AnchorStyles.cs

@@ -0,0 +1,44 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: AnchorStyles.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public enum AnchorStyles {
+		None	= 0x00000000,
+		Top	= 0x00000001,
+		Bottom	= 0x00000002,
+		Left	= 0x00000004,
+		Right	= 0x00000008
+	}
+}

+ 293 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs

@@ -0,0 +1,293 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: Application.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+using Microsoft.Win32;
+using System;
+using System.Drawing;
+using System.ComponentModel;
+using System.Collections;
+using System.Diagnostics;
+using System.Globalization;
+using System.IO;
+using System.Reflection;
+using System.Runtime.InteropServices;
+using System.Threading;
+
+namespace System.Windows.Forms {
+	public sealed class Application : ContainerControl {
+		private static bool			browser_embedded;
+		private static bool			exiting;
+		private static InputLanguage		input_language;
+		private static bool			messageloop_started;
+		private static string			safe_caption_format;
+		private static ArrayList		message_filters;
+		private static ApplicationContext	app_context;
+
+		private Application () {
+			input_language	= InputLanguage.CurrentInputLanguage;
+			message_filters	= new ArrayList();
+			app_context	= null;
+			browser_embedded= false;
+			exiting		= false;
+			messageloop_started = false;
+			safe_caption_format = "{1} - {0} - {2}";
+		}
+
+		#region Public Static Properties
+		public static bool AllowQuit {
+			get {
+				return browser_embedded;
+			}
+		}
+
+		public static string CommonAppDataPath {
+			get {
+				return Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
+			}
+		}
+
+		public static RegistryKey CommonAppDataRegistry {
+			get {
+				RegistryKey	key;
+
+				key = Registry.LocalMachine.OpenSubKey("Software\\" + Application.CompanyName + "\\" + Application.ProductName + "\\" + Application.ProductVersion, true);
+
+				return key;
+			}
+		}
+
+		public static string CompanyName {
+			get {
+				StackTrace	st;
+
+				if (Environment.OSVersion.Platform != (PlatformID)128) {
+					RegistryKey	key;
+					String		ret;
+
+					key=Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion", false);
+					ret=(String)key.GetValue("RegisteredOrganization");
+
+					return ret;
+					
+				}
+
+				st=new StackTrace();
+				return st.GetFrame(st.FrameCount-1).GetMethod().DeclaringType.Namespace;
+			}
+		}
+
+		public static CultureInfo CurrentCulture {
+			get {
+				return Thread.CurrentThread.CurrentUICulture;
+			}
+
+			set {
+				
+				Thread.CurrentThread.CurrentUICulture=value;
+			}
+		}
+
+		public static InputLanguage CurrentInputLanguage {
+			get {
+				return input_language;
+			}
+
+			set {
+				input_language=value;
+			}
+		}
+
+		public static string ExecutablePath {
+			get {
+				return Assembly.GetEntryAssembly().Location;
+			}
+		}
+
+		public static string LocalUserAppDataPath {
+			get {
+				return Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
+			}
+		}
+
+		public static bool MessageLoop {
+			get {
+				return messageloop_started;
+			}
+		}
+
+		public static string ProductName {
+			get {
+				AssemblyProductAttribute[] attrs = (AssemblyProductAttribute[]) Assembly.GetEntryAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), true);
+				
+				if ((attrs != null) && attrs.Length>0) {
+					return attrs[0].Product;
+				}
+
+				return Assembly.GetEntryAssembly().GetName().Name;
+			}
+		}
+
+		public static string ProductVersion {
+			get {
+				String version;
+
+				version = Assembly.GetEntryAssembly().GetName().Version.ToString();
+
+				if (version.StartsWith("0.")) {
+					version="1." + version.Substring(2);
+				}
+				return version;
+			}
+		}
+
+		public static string SafeTopLevelCaptionFormat {
+			get {
+				return safe_caption_format;
+			}
+
+			set {
+				safe_caption_format=value;
+			}
+		}
+
+		public static string StartupPath {
+			get {
+				return Path.GetDirectoryName(Application.ExecutablePath);
+			}
+		}
+
+		public static string UserAppDataPath {
+			get {
+				return Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
+			}
+		}
+
+		public static RegistryKey UserAppDataRegistry {
+			get {
+				RegistryKey	key;
+
+				key = Registry.CurrentUser.OpenSubKey("Software\\" + Application.CompanyName + "\\" + Application.ProductName + "\\" + Application.ProductVersion, true);
+
+				return key;
+			}
+		}
+		#endregion
+
+		#region Public Static Methods
+		public static void AddMessageFilter(IMessageFilter value) {
+			message_filters.Add(value);
+		}
+
+		public static void DoEvents() {
+			XplatUI.DoEvents();
+		}
+
+		public static void Exit() {
+			XplatUI.Exit();
+		}
+
+		public static void ExitThread() {
+			exiting=true;
+		}
+
+		private static void InternalExit(object sender, EventArgs e) {
+			Application.Exit();
+		}
+
+		public static ApartmentState OleRequired() {
+			//throw new NotImplementedException("OLE Not supported by this System.Windows.Forms implementation");
+			return ApartmentState.Unknown;
+		}
+
+		public static void OnThreadException(Exception t) {
+			if (Application.ThreadException != null) {
+				Application.ThreadException(null, new ThreadExceptionEventArgs(t));
+			} else {
+				XplatUI.HandleException(t);
+			}
+		}
+
+		public static void RemoveMessageFilter(IMessageFilter filter) {
+			message_filters.Remove(filter);
+		}
+
+		public static void Run() {
+			MSG msg = new MSG();
+
+			while (!exiting && XplatUI.GetMessage(ref msg, IntPtr.Zero, 0, 0)) {
+				Message message;
+
+				message = new Message();
+				message.Hwnd=msg.hwnd;
+				message.Msg=(int)msg.message;
+				message.LParam=msg.lParam;
+				message.WParam=msg.wParam;
+
+				XplatUI.TranslateMessage(ref msg);
+				XplatUI.DispatchMessage(ref msg);
+			}
+
+			if (ApplicationExit != null) {
+				ApplicationExit(null, EventArgs.Empty);
+			}
+			Console.WriteLine("Application.Run(): returning");
+		}
+
+		public static void Run(Form mainForm) {
+			mainForm.CreateControl();
+			Run(new ApplicationContext(mainForm));
+
+			Console.WriteLine("Application.Run(Form): returning");
+		}
+
+		public static void Run(ApplicationContext context) {
+			app_context=context;
+			if (app_context.MainForm!=null) {
+				app_context.MainForm.Show();
+				app_context.ThreadExit += new EventHandler(InternalExit);
+			}
+			Run();
+			Console.WriteLine("Application.Run(Context): returning");
+		}
+		#endregion	// Public Static Methods
+
+		#region Events
+		public static event EventHandler	ApplicationExit;
+		public static event EventHandler	Idle;
+		public static event EventHandler	ThreadExit;
+		public static event ThreadExceptionEventHandler	ThreadException;
+		#endregion	// Events
+	}
+}

+ 100 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ApplicationContext.cs

@@ -0,0 +1,100 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: ApplicationContext.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public class ApplicationContext {
+		#region Local Variables
+		Form	main_form;
+		#endregion	// Local Variables
+
+		#region Public Constructors & Destructors
+		public ApplicationContext() : this(null) {
+		}
+
+		public ApplicationContext(Form mainForm) {
+			main_form=mainForm;
+		}
+
+		~ApplicationContext() {
+			this.Dispose(false);
+		}
+		#endregion	// Public Constructors & Destructors
+
+		#region Public Instance Properties
+		public Form MainForm {
+			get {
+				return main_form;
+			}
+
+			set {
+				if (main_form!=value) {
+					main_form=value;
+				}
+			}
+		}
+		#endregion	// Public Instance Properties
+
+		#region Public Instance Methods
+		public void Dispose() {
+			Dispose(true);
+			GC.SuppressFinalize(this);
+		}
+
+		public void ExitThread() {
+			ExitThreadCore();
+		}
+		#endregion	// Public Instance Methods
+
+		#region Protected Instance Methods
+		protected virtual void Dispose(bool disposing) {
+			main_form=null;
+		}
+
+		protected virtual void ExitThreadCore() {
+			if (ThreadExit!=null) {
+				ThreadExit(this, EventArgs.Empty);
+			}
+		}
+
+		protected virtual void OnMainFormClosed(object sender, EventArgs e) {
+			ExitThreadCore();
+		}
+		#endregion	// Public Instance Methods
+
+		#region Events
+		public event EventHandler ThreadExit;
+		#endregion	// Events
+	}
+}

+ 93 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/BaseCollection.cs

@@ -0,0 +1,93 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: BaseCollection.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+using System;
+using System.Collections;
+
+namespace System.Windows.Forms {
+	public class BaseCollection : MarshalByRefObject, ICollection, IEnumerable {
+		internal ArrayList	list;
+
+		#region Public Constructors
+		public BaseCollection() {
+			this.list=null;
+		}
+		#endregion	// Public Constructors
+
+		#region Public Instance Properties
+		public virtual int Count {
+			get {
+				return this.list.Count;
+			}
+		}
+
+		public bool IsReadOnly {
+			get {
+				return false;
+			}
+		}
+
+		public bool IsSynchronized {
+			get {
+				return false;
+			}
+		}
+
+		public object SyncRoot {
+			get {
+				return this;
+			}
+		}
+		#endregion	// Public Instance Properties
+
+		#region Protected Instance Properties
+		protected virtual ArrayList List {
+			get {
+				return this.list;
+			}
+		}
+		#endregion	// Protected Instance Properties
+
+		#region Public Instance Methods
+		public void CopyTo(Array ar, int index) {
+			this.list.CopyTo(ar, index);
+		}
+
+		public IEnumerator GetEnumerator() {
+			return this.list.GetEnumerator();
+		}
+		#endregion	// Public Instance Methods
+	}
+}

+ 106 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/Binding.cs

@@ -0,0 +1,106 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: Binding.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public class Binding {
+		internal string			property_name;
+		internal object			data_source;
+		internal BindingManagerBase	binding_manager_base;
+		internal BindingMemberInfo	binding_member_info;
+		internal Control		control;
+		internal bool			is_binding;
+
+		#region Public Constructors
+		public Binding(string propertyName, object dataSource, string dataMember) {
+			this.property_name=propertyName;
+			this.data_source=dataSource;
+			this.binding_member_info=new BindingMemberInfo(dataMember);
+		}
+		#endregion	// Public Constructors
+
+		#region Public Instance Properties
+		public BindingManagerBase BindingManagerBase {
+			get {
+				return this.binding_manager_base;
+			}
+		}
+
+		public BindingMemberInfo BindingMemberInfo {
+			get {
+				return this.binding_member_info;
+			}
+		}
+
+		public Control Control {
+			get {
+				return this.control;
+			}
+		}
+
+		public object DataSource {
+			get {
+				return this.data_source;
+			}
+		}
+
+		public bool IsBinding {
+			get {
+				return this.is_binding;
+			}
+		}
+
+		public string PropertyName {
+			get {
+				return this.property_name;
+			}
+		}
+		#endregion	// Public Instance Properties
+
+		#region Protected Instance Methods
+		protected virtual void OnFormat(ConvertEventArgs cevent) {
+			if (Format!=null) Format(this, cevent);
+		}
+
+		protected virtual void OnParse(ConvertEventArgs cevent) {
+			if (Parse!=null) Parse(this, cevent);
+		}
+		#endregion	// Protected Instance Methods
+
+		#region Events
+		public event ConvertEventHandler Format;
+		public event ConvertEventHandler Parse;
+		#endregion	// Events
+	}
+}

+ 152 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/BindingContext.cs

@@ -0,0 +1,152 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: BindingContext.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// NOT COMPLETE
+
+using System.Collections;
+using System.ComponentModel;
+
+namespace System.Windows.Forms {
+	public class BindingContext : ICollection, IEnumerable {
+		#region Public Constructors
+		public BindingContext() {
+		}
+		#endregion	// Public Constructors
+
+		#region Public Instance Properties
+		[MonoTODO]
+		public bool IsReadOnly {
+			get {
+				throw new NotImplementedException();
+			}
+		}
+
+		public BindingManagerBase this[object dataSource] {
+			get {
+				return this[dataSource, String.Empty];
+			}
+		}
+
+		[MonoTODO]
+		public BindingManagerBase this[object dataSource, string dataMember] {
+			get {
+				throw new NotImplementedException();
+			}
+		}
+
+		
+		#endregion	// Public Instance Properties
+
+		#region Public Instance Methods
+		public bool Contains(object dataSource) {
+			return Contains(dataSource, String.Empty);
+		}
+
+		[MonoTODO]
+		public bool Contains(object dataSource, string dataMember) {
+			throw new NotImplementedException();
+		}
+		#endregion	// Public Instance Methods
+
+		#region Protected Instance Methods
+		protected internal void Add(object dataSource, BindingManagerBase listManager) {
+			AddCore(dataSource, listManager);
+		}
+
+		[MonoTODO]
+		protected virtual void AddCore(object dataSource, BindingManagerBase listManager) {
+			throw new NotImplementedException();
+		}
+
+		protected internal void Clear() {
+			ClearCore();
+		}
+
+		[MonoTODO]
+		protected virtual void ClearCore() {
+			throw new NotImplementedException();
+		}
+
+		protected virtual void OnCollectionChanged(System.ComponentModel.CollectionChangeEventArgs ccevent) {
+			if (CollectionChanged!=null) CollectionChanged(this, ccevent);
+		}
+
+		protected internal void Remove(object dataSource) {
+			RemoveCore(dataSource);
+		}
+
+		[MonoTODO]
+		protected virtual void RemoveCore(object dataSource) {
+			throw new NotImplementedException();
+		}
+		#endregion	// Protected Instance Methods
+
+		#region Events
+		public event CollectionChangeEventHandler CollectionChanged;
+		#endregion	// Events
+
+		#region ICollection Interfaces
+		[MonoTODO]
+		void ICollection.CopyTo(Array array, int index) {
+			throw new NotImplementedException();
+		}
+
+		[MonoTODO]
+		int ICollection.Count {
+			get {
+				throw new NotImplementedException();
+			}
+		}
+
+		bool ICollection.IsSynchronized {
+			get {
+				return false;
+			}
+		}
+
+		object ICollection.SyncRoot {
+			get {
+				return this;
+			}
+		}
+
+		#endregion	// ICollection Interfaces
+
+		#region IEnumerable Interfaces
+		[MonoTODO]
+		IEnumerator IEnumerable.GetEnumerator() {
+			throw new NotImplementedException();
+		}
+		#endregion	// IEnumerable Interfaces
+	}
+}

+ 98 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/BindingMemberInfo.cs

@@ -0,0 +1,98 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: BindingMemberInfo.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public class BindingMemberInfo {
+		private string		data_member;
+		private string		data_field;
+		private string		data_path;
+
+		#region Public Constructors
+		public BindingMemberInfo(string dataMember) {
+			int	i;
+
+			if (dataMember!=null) {
+				this.data_member=dataMember;
+			} else {
+				this.data_member=String.Empty;
+			}
+	
+			// Break out our components
+			i=data_member.LastIndexOf('.');
+			if (i!=-1) {
+				data_field=data_member.Substring(i+1);
+				data_path=data_member.Substring(0, i);
+			} else {
+				data_field=data_member;
+				data_path=String.Empty;
+			}
+		}
+		#endregion	// Public Constructors
+
+		#region Public Instance Properties
+		public string BindingField {
+			get {
+				return this.data_field;
+			}
+		}
+
+		public string BindingMember {
+			get {
+				return this.data_member;
+			}
+		}
+
+		public string BindingPath {
+			get {
+				return this.data_path;
+			}
+		}
+		#endregion	// Public Instance Properties
+
+		#region Public Instance Methods
+		public override bool Equals(object otherObject) {
+			if (otherObject is BindingMemberInfo) {
+				return (this == (BindingMemberInfo)otherObject);
+			} else {
+				return false;
+			}
+		}
+
+		public override int GetHashCode() {
+			return this.data_member.GetHashCode();
+		}
+		#endregion	// Public Instance Methods
+	}
+}

+ 118 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/BindingsCollection.cs

@@ -0,0 +1,118 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: BindingsCollection.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+using System.Collections;
+using System.ComponentModel;
+
+namespace System.Windows.Forms {
+	public class BindingsCollection : BaseCollection {
+		#region Public Constructors
+		internal BindingsCollection () {
+		}
+		#endregion	// Public Constructors
+
+		#region Public Instance Properties
+		public override int Count {
+			get {
+				return base.Count;
+			}
+		}
+
+		public Binding this[int index] {
+			get {
+				return (Binding)(base.List[index]);
+			}
+		}
+		#endregion	// Public Instance Properties
+
+		#region Protected Instance Properties
+		protected override ArrayList List {
+			get {
+				return base.List;
+			}
+		}
+		#endregion	// Protected Instance Properties
+
+		#region Protected Instance Methods
+		protected internal void Add(Binding binding) {
+			AddCore(binding);
+		}
+
+		protected virtual void AddCore(Binding dataBinding) {
+			base.List.Add(dataBinding);
+			OnCollectionChanged(new CollectionChangeEventArgs(CollectionChangeAction.Add, base.List));
+		}
+
+		protected internal void Clear() {
+			ClearCore();
+		}
+
+		protected virtual void ClearCore() {
+			base.List.Clear();
+			OnCollectionChanged(new CollectionChangeEventArgs(CollectionChangeAction.Refresh, base.List));
+		}
+
+		protected virtual void OnCollectionChanged(System.ComponentModel.CollectionChangeEventArgs ccevent) {
+			if (CollectionChanged!=null) CollectionChanged(this, ccevent);
+		}
+
+		protected internal void Remove(Binding binding) {
+			RemoveCore(binding);
+		}
+
+		protected internal void RemoveAt(int index) {
+			base.List.RemoveAt(index);
+			OnCollectionChanged(new CollectionChangeEventArgs(CollectionChangeAction.Remove, base.List));
+		}
+
+		protected virtual void RemoveCore(Binding dataBinding) {
+			base.List.Remove(dataBinding);
+			OnCollectionChanged(new CollectionChangeEventArgs(CollectionChangeAction.Remove, base.List));
+		}
+
+		protected internal bool ShouldSerializeMyAll() {
+			if (this.Count>0) {
+				return(true);
+			} else {
+				return(false);
+			}
+		}
+		#endregion	// Public Instance Methods
+
+		#region Events
+		public event CollectionChangeEventHandler	CollectionChanged;
+		#endregion	// Events
+	}
+}

+ 125 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/BindingsManagerBase.cs

@@ -0,0 +1,125 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: BindingsManagerBase.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// NOT COMPLETE
+
+using System.ComponentModel;
+using System.Collections;
+
+namespace System.Windows.Forms {
+	public abstract class BindingManagerBase {
+		private BindingsCollection	bindings;
+
+		#region Public Constructors
+		public BindingManagerBase() {
+		}
+		#endregion	// Public Constructors
+
+		#region Protected Instance Fields
+		protected EventHandler onCurrentChangedHandler;
+		protected EventHandler onPositionChangedHandler;
+		#endregion	// Protected Instance Fields
+
+		#region Public Instance Properties
+		public BindingsCollection Bindings {
+			get {
+				if (this.bindings==null) {
+					this.bindings=new BindingsCollection();
+				}
+				return this.bindings;
+			}
+		}
+
+		public abstract int Count {
+			get;
+		}
+
+		public abstract object Current {
+			get;
+		}
+
+		public abstract int Position {
+			get; set;
+		}
+		#endregion	// Public Instance Properties
+
+		#region Public Instance Methods
+		public abstract void AddNew();
+
+		public abstract void CancelCurrentEdit();
+
+		public abstract void EndCurrentEdit();
+
+		public abstract PropertyDescriptorCollection GetItemProperties();
+
+		public abstract void RemoveAt(int index);
+
+		public abstract void ResumeBinding();
+
+		public abstract void SuspendBinding();
+		#endregion	// Public Instance Methods
+
+		#region Protected Instance Methods
+		[MonoTODO]
+		protected internal virtual PropertyDescriptorCollection GetItemProperties(System.Collections.ArrayList dataSources, System.Collections.ArrayList listAccessors) {
+			throw new NotImplementedException();
+		}
+
+		[MonoTODO]
+		protected virtual PropertyDescriptorCollection GetItemProperties(Type lisType, int offset, System.Collections.ArrayList dataSources, System.Collections.ArrayList listAccessors) {
+			throw new NotImplementedException();
+		}
+
+		protected internal abstract string GetListName(System.Collections.ArrayList listAccessors);
+
+		protected internal abstract void OnCurrentChanged(EventArgs e);
+
+		[MonoTODO]
+		protected void PullData() {
+			throw new NotImplementedException();
+		}
+
+		[MonoTODO]
+		protected void PushData() {
+			throw new NotImplementedException();
+		}
+
+		protected abstract void UpdateIsBinding();
+		#endregion	// Protected Instance Methods
+
+		#region Events
+		public EventHandler CurrentChanged;
+		public EventHandler PositionChanged;
+		#endregion	// Events
+	}
+}

+ 45 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/Border3DSide.cs

@@ -0,0 +1,45 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: Border3DSide.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public enum Border3DSide {
+		Left	= 0x00000001,
+		Top	= 0x00000002,
+		Right	= 0x00000004,
+		Bottom	= 0x00000008,
+		Middle	= 0x00000800,
+		All	= 0x0000080F
+	}
+}

+ 49 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/Border3DStyle.cs

@@ -0,0 +1,49 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: Border3DStyle.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public enum Border3DStyle {
+		RaisedOuter	= 1,
+		SunkenOuter	= 2,
+		RaisedInner	= 4,
+		Raised		= 5,
+		Etched		= 6,
+		SunkenInner	= 8,
+		Bump		= 9,
+		Sunken		= 10,
+		Adjust		= 8192,
+		Flat		= 16384
+	}
+}

+ 42 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/BorderStyle.cs

@@ -0,0 +1,42 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: BorderStyle.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public enum BorderStyle {
+		None		= 0,
+		FixedSingle	= 1,
+		Fixed3D		= 2
+	}
+}

+ 50 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/BoundsSpecified.cs

@@ -0,0 +1,50 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: BoundsSpecified.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms
+{
+	[Flags]
+	public enum BoundsSpecified
+	{
+		None		= 0x00000000,
+		X		= 0x00000001,
+		Y		= 0x00000002,
+		Location	= 0x00000003,
+		Width		= 0x00000004,
+		Height		= 0x00000008,
+		Size		= 0x0000000c,
+		All		= 0x0000000f
+	}
+}

+ 45 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ButtonBorderStyle.cs

@@ -0,0 +1,45 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: ButtonBorderStyle.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public enum ButtonBorderStyle {
+		None	= 0,
+		Dotted	= 1,
+		Dashed	= 2,
+		Solid	= 3,
+		Inset	= 4,
+		Outset	= 5
+	}
+}

+ 45 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ButtonState.cs

@@ -0,0 +1,45 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: ButtonState.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public enum ButtonState {
+		Normal		= 0x00000000,
+		Inactive	= 0x00000100,
+		Pushed		= 0x00000200,
+		Checked		= 0x00000400,
+		Flat		= 0x00004000,
+		All		= 0x00004700
+	}
+}

+ 44 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/CaptionButton.cs

@@ -0,0 +1,44 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: CaptionButton.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public enum CaptionButton {
+		Close		= 0,
+		Minimize	= 1,
+		Maximize	= 2,
+		Restore		= 3,
+		Help		= 4
+	}
+}

+ 4 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog

@@ -0,0 +1,4 @@
+$Log: ChangeLog,v $
+Revision 1.1  2004/07/09 05:21:25  pbartok
+- Initial check-in
+

+ 559 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/CheckBox.cs

@@ -0,0 +1,559 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Dennis Hayes	[email protected]
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: CheckBox.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// NOT COMPLETE
+
+namespace System.Windows.Forms {
+	public class CreateParams {
+		#region Public Constructors
+		#endregion	// Public Constructors
+
+		#region Public Instance Properties
+		#endregion	// Public Instance Properties
+
+		#region Public Instance Methods
+		#endregion	// Public Instance Methods
+	}
+}
+//
+// System.Windows.Forms.CheckBox.cs
+//
+// Author:
+//   stubbed out by Jaak Simm ([email protected])
+//   Dennis Hayes ([email protected])
+//
+// (C) Ximian, Inc., 2002
+//
+
+using System.Drawing;
+
+namespace System.Windows.Forms {
+
+	/// <summary>
+	/// Represents a Windows check box.
+	/// </summary>
+
+	[MonoTODO]
+	public class CheckBox : ButtonBase {
+
+		// private fields
+		Appearance			appearance;
+		bool					autoCheck;
+		ContentAlignment	checkAlign;
+		bool					_checked;
+		CheckState			checkState;
+		bool					threeState;
+		ContentAlignment	textAlign;
+		Rectangle			textRect;
+		Rectangle			checkRect;
+		StringFormat		textFormat;
+		int					checkMarkSize=13;		// Keep it configurable for accessability
+		Graphics				canvasDC;
+		Bitmap				canvasBmp;
+		
+		// --- Constructor ---
+		public CheckBox() : base() 
+		{
+
+			appearance = Appearance.Normal;
+			autoCheck = true;
+			checkAlign = ContentAlignment.MiddleLeft;
+			_checked = false;
+			checkState = CheckState.Unchecked;
+			threeState = false;
+
+			canvasBmp = new Bitmap(ClientRectangle.Width, ClientRectangle.Height);
+			canvasDC = Graphics.FromImage(canvasBmp);
+
+			/* Set defaults for drawing text... */
+			textAlign = ContentAlignment.MiddleLeft;
+			textFormat = new StringFormat();
+			textFormat.Alignment=StringAlignment.Near;
+			textFormat.LineAlignment=StringAlignment.Center;
+			textRect = ClientRectangle;
+			textRect.X+=checkMarkSize;
+			textRect.Width-=checkMarkSize;
+
+			/* ... and for drawing our checkbox */
+			checkRect.X=ClientRectangle.Left;
+			checkRect.Y=(ClientRectangle.Bottom-ClientRectangle.Top)/2-checkMarkSize/2;
+			checkRect.Width=checkMarkSize;
+			checkRect.Height=checkMarkSize;
+
+			SizeChanged+=new System.EventHandler(CheckboxSizeChanged);
+			GotFocus+=new System.EventHandler(CheckboxUpdate);
+			LostFocus+=new System.EventHandler(CheckboxUpdate);
+			TextChanged+=new System.EventHandler(CheckboxUpdate);
+
+			SubClassWndProc_ = true;
+			SetStyle (ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
+			callWinControlProcMask &= ~(CallWinControlProcMask.MOUSE_MESSAGES | CallWinControlProcMask.KEYBOARD_MESSAGES);
+		}
+		
+		// --- CheckBox Properties ---
+		public Appearance Appearance {
+			get { return appearance; }
+			set { appearance=value; }
+		}
+		
+		public bool AutoCheck {
+			get { return autoCheck; }
+			set { autoCheck = value; }
+		}
+		
+		public ContentAlignment CheckAlign {
+			get { return checkAlign; }
+			set {
+				checkAlign=value;
+				UpdateCheckbox();
+			}
+		}
+		
+		public bool Checked {
+			get { return _checked; }
+			set { 
+				if( _checked != value) {
+					CheckState = (value) ? CheckState.Checked : CheckState.Unchecked;
+				}
+			}
+		}
+		
+		public CheckState CheckState {
+			get { return checkState; }
+			set { 
+				if( checkState != value) {
+
+					checkState = value; 
+					bool oldChecked = _checked;
+
+					if( checkState == CheckState.Unchecked) {
+						_checked = false;
+					}
+					else {
+						_checked = true;
+					}
+
+					if( oldChecked != _checked) { 
+						OnCheckedChanged(new EventArgs());
+					}
+
+					OnCheckStateChanged(new EventArgs());
+				}
+			}
+		}
+		
+		[MonoTODO]
+		protected override CreateParams CreateParams {
+			get {
+				CreateParams createParams = base.CreateParams;
+	
+				createParams.ClassName = "BUTTON";
+
+				createParams.Style = (int) (
+					(int)WindowStyles.WS_CHILD | 
+					(int)WindowStyles.WS_VISIBLE | 
+					(int)ButtonStyles.BS_CHECKBOX |
+					(int)ButtonStyles.BS_NOTIFY |
+					(int)WindowStyles.WS_CLIPSIBLINGS |
+					(int)WindowStyles.WS_CLIPCHILDREN |
+					(int)WindowStyles.WS_TABSTOP |
+					(int)SS_Static_Control_Types.SS_LEFT );
+
+				if (autoCheck) {
+					createParams.Style |= (int)ButtonStyles.BS_AUTOCHECKBOX;
+				}
+
+				/* We need this, we draw ourselves */
+				createParams.Style |= (int) ButtonStyles.BS_OWNERDRAW;
+
+				return createParams;
+			}
+		}
+		
+		[MonoTODO]
+		protected override Size DefaultSize {
+			get { return new Size(100,checkMarkSize); }
+		}
+		
+		[MonoTODO]
+		public override ContentAlignment TextAlign {
+			get {
+				return textAlign;
+			}
+			set {
+				textAlign = value;
+				UpdateCheckbox();
+			}
+		}
+		
+		public bool ThreeState {
+			get {
+				return threeState;
+			}
+
+			set {
+				threeState = value;
+			}
+		}	
+		
+		// --- CheckBox methods ---
+
+		protected override AccessibleObject CreateAccessibilityInstance() 
+		{
+			throw new NotImplementedException ();
+		}
+		
+		
+		// [event methods]
+		[MonoTODO]
+		protected virtual void OnAppearanceChanged(EventArgs e) 
+		{
+			if (AppearanceChanged != null) {
+				AppearanceChanged(this, e);
+			}
+		}
+		
+		[MonoTODO]
+		protected virtual void OnCheckedChanged(EventArgs e) 
+		{
+			//FIXME:
+			if(CheckedChanged != null) {
+				CheckedChanged( this, e);
+			}
+		}
+		
+		[MonoTODO]
+		protected virtual void OnCheckStateChanged(EventArgs e) 
+		{
+			//FIXME:
+			if(CheckStateChanged != null) {
+				CheckStateChanged( this, e);
+			}
+		}
+		
+		[MonoTODO]
+		protected override void OnClick(EventArgs e) 
+		{
+			CheckState = (CheckState)Win32.SendMessage(Handle, (int)ButtonMessages.BM_GETCHECK, 0, 0);
+			base.OnClick(e);
+		}
+		
+		[MonoTODO]
+		protected override void OnHandleCreated(EventArgs e) 
+		{
+			//FIXME:
+			base.OnHandleCreated(e);
+			Win32.SendMessage(Handle, (int)ButtonMessages.BM_SETCHECK, (int)checkState, 0);
+		}
+		
+//		protected override void OnMouseDown (MouseEventArgs e) 
+//		{
+//			base.OnMouseDown (e);
+//		}
+		
+		[MonoTODO]
+		protected override void OnMouseUp(MouseEventArgs mevent) 
+		{
+			if (ThreeState) {
+				switch (CheckState) {
+					case CheckState.Unchecked: {
+						CheckState = CheckState.Checked;
+						break;
+					}
+
+					case CheckState.Indeterminate: {
+						CheckState = CheckState.Unchecked;
+						break;
+					}
+
+					case CheckState.Checked: {
+						CheckState = CheckState.Indeterminate;
+						break;
+					}
+				}
+			} else {
+				Checked = Checked ? false : true;
+			}
+			CheckboxRedraw();
+			Invalidate();
+			base.OnMouseUp(mevent);
+		}
+		// end of [event methods]
+		
+		
+		[MonoTODO]
+		protected override bool ProcessMnemonic(char charCode) 
+		{
+			//FIXME:
+			return base.ProcessMnemonic(charCode);
+		}
+		
+		[MonoTODO]
+		//FIXME: do a better tostring
+		public override string ToString() 
+		{
+			if (Checked) {
+				return "CheckBox" + " Checked";
+			} else {
+				return "CheckBox" +  " Unchecked";
+			}
+		}
+		
+		internal override void ButtonPaint (PaintEventArgs e) 
+		{
+			if (canvasBmp!=null) {
+				e.Graphics.DrawImage(canvasBmp, e.ClipRectangle, e.ClipRectangle, GraphicsUnit.Pixel);
+			}
+		}
+		
+		/// --- CheckBox events ---
+		public event EventHandler AppearanceChanged;
+		public event EventHandler CheckedChanged;
+		public event EventHandler CheckStateChanged;
+		
+		/// --- public class CheckBox.CheckBoxAccessibleObject : AccessibleObject ---
+		/// the class is only used for .NET framework
+		/// 
+		public class CheckBoxAccessibleObject : AccessibleObject {
+		}
+
+		private void UpdateCheckbox() {
+			/* Calculate the position of text and checkbox rectangle */
+			if (appearance!=Appearance.Button) {
+				switch(checkAlign) {
+					case ContentAlignment.BottomCenter: {
+						if (ClientRectangle.Height<checkMarkSize*2) {
+							ClientSize=new Size(ClientRectangle.Width, checkMarkSize*2);
+						}
+						checkRect.X=(ClientRectangle.Right-ClientRectangle.Left)/2-checkMarkSize/2;
+						checkRect.Y=ClientRectangle.Bottom-checkMarkSize;
+						textRect.X=ClientRectangle.X;
+						textRect.Width=ClientRectangle.Width;
+						break;
+					}
+
+					case ContentAlignment.BottomLeft: {
+						checkRect.X=ClientRectangle.Left;
+						checkRect.Y=ClientRectangle.Bottom-checkMarkSize;
+						textRect.X=ClientRectangle.X+checkMarkSize;
+						textRect.Width=ClientRectangle.Width-checkMarkSize;
+						break;
+					}
+
+					case ContentAlignment.BottomRight: {
+						checkRect.X=ClientRectangle.Right-checkMarkSize;
+						checkRect.Y=ClientRectangle.Bottom-checkMarkSize;
+						textRect.X=ClientRectangle.X;
+						textRect.Width=ClientRectangle.Width-checkMarkSize;
+						break;
+					}
+
+					case ContentAlignment.MiddleCenter: {
+						checkRect.X=(ClientRectangle.Right-ClientRectangle.Left)/2-checkMarkSize/2;
+						checkRect.Y=(ClientRectangle.Bottom-ClientRectangle.Top)/2-checkMarkSize/2;
+						textRect.X=ClientRectangle.X;
+						textRect.Width=ClientRectangle.Width;
+						break;
+					}
+
+					default:
+					case ContentAlignment.MiddleLeft: {
+						checkRect.X=ClientRectangle.Left;
+						checkRect.Y=(ClientRectangle.Bottom-ClientRectangle.Top)/2-checkMarkSize/2;
+						textRect.X=ClientRectangle.X+checkMarkSize;
+						textRect.Width=ClientRectangle.Width-checkMarkSize;
+						break;
+					}
+
+					case ContentAlignment.MiddleRight: {
+						checkRect.X=ClientRectangle.Right-checkMarkSize;
+						checkRect.Y=(ClientRectangle.Bottom-ClientRectangle.Top)/2-checkMarkSize/2;
+						textRect.X=ClientRectangle.X;
+						textRect.Width=ClientRectangle.Width-checkMarkSize;
+						break;
+					}
+
+					case ContentAlignment.TopCenter: {
+						if (ClientRectangle.Height<checkMarkSize*2) {
+							ClientSize=new Size(ClientRectangle.Width, checkMarkSize*2);
+						}
+						checkRect.X=(ClientRectangle.Right-ClientRectangle.Left)/2-checkMarkSize/2;
+						checkRect.Y=ClientRectangle.Top;
+						textRect.X=ClientRectangle.X;
+						textRect.Y=checkMarkSize;
+						textRect.Width=ClientRectangle.Width;
+						textRect.Height=ClientRectangle.Height-checkMarkSize;
+						break;
+					}
+
+					case ContentAlignment.TopLeft: {
+						checkRect.X=ClientRectangle.Left;
+						checkRect.Y=ClientRectangle.Top;
+						textRect.X=ClientRectangle.X+checkMarkSize;
+						textRect.Width=ClientRectangle.Width-checkMarkSize;
+						break;
+					}
+
+					case ContentAlignment.TopRight: {
+						checkRect.X=ClientRectangle.Right-checkMarkSize;
+						checkRect.Y=ClientRectangle.Top;
+						textRect.X=ClientRectangle.X;
+						textRect.Width=ClientRectangle.Width-checkMarkSize;
+						break;
+					}
+				}
+			} else {
+				textRect.X=ClientRectangle.X;
+				textRect.Width=ClientRectangle.Width;
+			}
+
+			/* Set the horizontal alignment of our text */
+			switch(textAlign) {
+				case ContentAlignment.BottomLeft:
+				case ContentAlignment.MiddleLeft:
+				case ContentAlignment.TopLeft: {
+					textFormat.Alignment=StringAlignment.Near;
+					break;
+				}
+
+				case ContentAlignment.BottomCenter:
+				case ContentAlignment.MiddleCenter:
+				case ContentAlignment.TopCenter: {
+					textFormat.Alignment=StringAlignment.Center;
+					break;
+				}
+
+				case ContentAlignment.BottomRight:
+				case ContentAlignment.MiddleRight:
+				case ContentAlignment.TopRight: {
+					textFormat.Alignment=StringAlignment.Far;
+					break;
+				}
+			}
+
+			/* Set the vertical alignment of our text */
+			switch(textAlign) {
+				case ContentAlignment.TopLeft: 
+				case ContentAlignment.TopCenter: 
+				case ContentAlignment.TopRight: {
+					textFormat.LineAlignment=StringAlignment.Near;
+					break;
+				}
+
+				case ContentAlignment.BottomLeft:
+				case ContentAlignment.BottomCenter:
+				case ContentAlignment.BottomRight: {
+					textFormat.LineAlignment=StringAlignment.Far;
+					break;
+				}
+
+				case ContentAlignment.MiddleLeft:
+				case ContentAlignment.MiddleCenter:
+				case ContentAlignment.MiddleRight: {
+					textFormat.LineAlignment=StringAlignment.Center;
+					break;
+				}
+			}
+			CheckboxRedraw();
+			Invalidate();
+		}
+
+		private void CheckboxRedraw() {
+			SolidBrush	sb;
+
+			/* Build the image representing the control */
+
+			if (canvasDC!=null) {
+				canvasDC.Dispose();
+			}
+			if (canvasBmp!=null) {
+				canvasBmp.Dispose();
+			}
+
+			if (ClientRectangle.Width<1 || ClientRectangle.Height<1) {
+				return;
+			}
+			canvasBmp = new Bitmap(ClientRectangle.Width, ClientRectangle.Height);
+			canvasDC = Graphics.FromImage(canvasBmp);
+
+			sb=new SolidBrush(BackColor);
+			canvasDC.FillRectangle(sb, ClientRectangle);
+			sb.Dispose();
+
+			ButtonState state = ButtonState.Normal;
+			if (FlatStyle == FlatStyle.Flat) {
+				state |= ButtonState.Flat;
+			}
+			
+			if (Checked) {
+				state |= ButtonState.Checked;
+			}
+			
+			if (ThreeState && (CheckState == CheckState.Indeterminate)) {
+				state |= ButtonState.Checked;
+				state |= ButtonState.Pushed;
+			}
+
+			if (appearance!=Appearance.Button) {
+				ControlPaint.DrawCheckBox(canvasDC, checkRect, state);
+			} else {
+				ControlPaint.DrawButton(canvasDC, textRect, state);
+			}
+
+			/* Place the text; to be compatible with Windows place it after the checkbox has been drawn */
+			sb=new SolidBrush(base.foreColor);
+			canvasDC.DrawString(Text, Font, sb, textRect, textFormat);
+			sb.Dispose();
+
+			if (Focused) {
+				ControlPaint.DrawFocusRectangle(canvasDC, textRect);
+			}
+		}
+
+		private void CheckboxUpdate(object sender, System.EventArgs e) {
+			/* Force recalculation of text & checkbox rectangles */
+			UpdateCheckbox();
+		}
+
+		private void CheckboxSizeChanged(object sender, System.EventArgs e)
+		{
+			/* Force recalculation of text & checkbox rectangles */
+			textRect.Y=ClientRectangle.Y;
+			textRect.Height=ClientRectangle.Height;
+			UpdateCheckbox();
+		}
+	}
+
+
+}

+ 139 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContainerControl.cs

@@ -0,0 +1,139 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: ContainerControl.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// NOT COMPLETE
+
+namespace System.Windows.Forms {
+	public class ContainerControl : ScrollableControl, IContainerControl {
+		private Control active_control;
+		private Control focused_control;
+
+		#region Public Constructors
+		public ContainerControl() {
+		}
+		#endregion	// Public Constructors
+
+		#region Public Instance Properties
+		public Control ActiveControl {
+			get {
+				return active_control;
+			}
+
+			set {
+				if ((active_control==value) || (value==null)) {
+					return;
+				}
+
+				if (!Contains(value)) {
+					throw new ArgumentException("Not a child control");
+				}
+
+				XplatUI.Activate(active_control.window.Handle);
+			}
+		}
+
+		public override BindingContext BindingContext {
+			get {
+				throw new NotImplementedException();
+			}
+
+			set {
+			}
+		}
+
+		public Form ParentForm {
+			get {
+				throw new NotImplementedException();
+			}
+		}
+		#endregion	// Public Instance Properties
+
+		#region Protected Instance Methods
+		protected override CreateParams CreateParams {
+			get {
+				return base.CreateParams;
+			}
+		}
+		#endregion	// Public Instance Methods
+
+		#region Public Instance Methods
+		public bool Validate() {
+			throw new NotImplementedException();
+		}
+
+		public bool ActivateControl(Control control) {
+			throw new NotImplementedException();
+		}
+		#endregion	// Public Instance Methods
+
+		#region Protected Instance Methods
+		protected override void AdjustFormScrollbars(bool displayScrollbars) {
+		}
+
+		protected override void Dispose(bool disposing) {
+		}
+
+		protected override void OnControlRemoved(ControlEventArgs e) {
+		}
+
+		protected override void OnCreateControl() {
+		}
+
+		protected override bool ProcessDialogChar(char charCode) {
+			throw new NotImplementedException();
+		}
+
+		protected override bool ProcessDialogKey(Keys keyData) {
+			throw new NotImplementedException();
+		}
+
+		protected override bool ProcessMnemonic(char charCode) {
+			throw new NotImplementedException();
+		}
+
+		protected virtual bool ProcessTabKey(bool forward) {
+			throw new NotImplementedException();
+		}
+
+		protected override void Select(bool directed, bool forward) {
+		}
+
+		protected virtual void UpdateDefaultButton() {
+		}
+
+		protected override void WndProc(ref Message m) {
+			base.WndProc(ref m);
+		}
+		#endregion	// Protected Instance Methods
+	}
+}

+ 1706 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs

@@ -0,0 +1,1706 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok		[email protected]
+//
+// Based on work by:
+//	Aleksey Ryabchuk	[email protected]
+//	Alexandre Pigolkine	[email protected]
+//	Dennis Hayes		[email protected]
+//	Jaak Simm		[email protected]
+//	John Sohn		[email protected]
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: Control.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// NOT COMPLETE
+
+using System;
+using System.Drawing;
+using System.ComponentModel;
+using System.Collections;
+using System.Diagnostics;
+using System.Threading;
+using System.Runtime.InteropServices;
+
+namespace System.Windows.Forms
+{
+	public class Control : Component, ISynchronizeInvoke, IWin32Window
+        {
+		#region Local Variables
+		// Basic
+		internal Rectangle		bounds;			// bounding rectangle for control
+		internal object			creator_thread;		// thread that created the control
+		internal ControlNativeWindow	window;			// object for native window handle
+		internal string			name;			// for object naming
+
+		// State
+		internal bool			has_focus;		// true if control has focus
+		internal bool			is_visible;		// true if control is visible
+		internal bool			is_enabled;		// true if control is enabled (usable/not grayed out)
+		internal int			tab_index;		// position in tab order of siblings
+		internal bool			is_disposed;		// has the window already been disposed?
+		internal Size			window_size;		// size of the window (including decorations)
+		internal Size			client_size;		// size of the client area (window excluding decorations)
+		internal ControlStyles		control_style;		// win32-specific, style bits for control
+
+		// Visuals
+		internal Color			foreground_color;	// foreground color for control
+		internal Color			background_color;	// background color for control
+		internal Image			background_image;	// background image for control
+		internal Font			font;			// font for control
+		internal string			text;			// window/title text for control
+
+		// to be categorized...
+		static internal Hashtable	controls;		// All of the applications controls, in a flat list
+		internal ControlCollection	child_controls;		// our children
+		internal Control		parent;			// our parent control
+		internal int			num_of_children;	// number of children the control has
+		internal Control[]		children;		// our children
+		internal AccessibleObject	accessibility_object;	// object that contains accessibility information about our control
+		internal AnchorStyles		anchor_style;		// TODO
+		internal BindingContext		binding_context;	// TODO
+		internal RightToLeft		right_to_left;		// drawing direction for control
+		#endregion	// Local Variables
+
+		#region Private Classes
+		// This helper class allows us to dispatch messages to Control.WndProc
+		internal class ControlNativeWindow : NativeWindow {
+			private Control control;
+
+			public ControlNativeWindow(Control control) : base() {
+				this.control=control;
+			}
+
+			protected override void WndProc(ref Message m) {
+				control.WndProc(ref m);
+			}
+		}
+		#endregion
+		
+		#region Public Classes
+		public class ControlCollection : IList, ICollection, ICloneable, IEnumerable {
+			private class Enumerator : IEnumerator {
+				private Control	owner;
+				private int	current;
+
+				public Enumerator(Control owner) {
+					this.owner=owner;
+					this.current=-1;
+				}
+
+				public bool MoveNext() {
+					current++;
+					if (current>=owner.num_of_children) {
+						return false;
+					}
+
+					return true;
+				}
+
+				public void Reset() {
+					current=-1;
+				}
+
+				public object Current {
+					get {
+						if (current>=0 && current<owner.num_of_children) {
+							return owner.children[current];
+						} else {
+							throw new InvalidOperationException("enumerator out of range");
+						}
+					}
+				}
+			}
+
+			protected Control 	owner;
+
+			#region ControlCollection Public Constructor
+			public ControlCollection(Control owner) {
+				this.owner=owner;
+			}
+			#endregion
+
+			#region ControlCollection Public Instance Properties
+			public int Count {
+				get {
+					return owner.num_of_children;
+				}
+			}
+
+			public bool IsReadOnly {
+				get {
+					return false;
+				}
+			}
+
+			public virtual Control this [int index] {
+				get {
+					if ((uint)index>=owner.num_of_children) {
+						throw new ArgumentOutOfRangeException();
+					}
+					return owner.children[index];
+				}
+			}
+			#endregion	// ControlCollection Public Instance Properties
+
+			#region ControlCollection Public Instance Methods
+			public virtual void Add(Control value) {
+				// Don't add it if we already have it
+				for (int i=0; i<owner.num_of_children; i++) {
+					if (value==owner.child_controls[i]) {
+						return;
+					}
+				}
+				value.Parent=owner;
+				owner.OnControlAdded(new ControlEventArgs(value));
+			}
+
+			public virtual void AddRange(Control[] controls) {
+				for (int i=0; i<controls.Length; i++) {
+					Add(controls[i]);
+				}
+			}
+
+			public virtual void Clear() {
+				owner.SuspendLayout();
+				for (int i=0; i<owner.num_of_children; i++) {
+					Remove(owner.children[i]);
+				}
+				owner.ResumeLayout();
+			}
+
+			public bool Contains(Control control) {
+				for (int i=0; i<owner.num_of_children; i++) {
+					if (owner.children[i]==control) {
+						return true;
+					}
+				}
+
+				return false;
+			}
+
+			public void CopyTo(Array dest, int index) {
+				if (owner.num_of_children>0) {
+					Array.Copy(owner.children, 0, dest, index, owner.num_of_children);
+				}
+			}
+
+			public override bool Equals(object other) {
+				if (other is ControlCollection && (((ControlCollection)other).owner==this.owner)) {
+					return(true);
+				} else {
+					return(false);
+				}
+			}
+
+			public int GetChildIndex(Control child) {
+				return GetChildIndex(child, false);
+			}
+
+			public int GetChildIndex(Control child, bool throwException) {
+				int index;
+
+				index=IndexOf(child);
+
+				if (index==-1 && throwException) {
+					throw new ArgumentException("Not a child control", "child");
+				}
+				return index;
+			}
+
+			public IEnumerator GetEnumerator() {
+				return new ControlCollection.Enumerator(this.owner);
+			}
+
+			public override int GetHashCode() {
+				return base.GetHashCode();
+			}
+
+			public int IndexOf(Control control) {
+				int index;
+
+				for (index=0; index<owner.num_of_children; index++) {
+					if (owner.children[index] == control) {
+						return index;
+					}
+				}
+				return -1;
+			}
+
+			public virtual void Remove(Control value) {
+				for (int i=0; i<owner.num_of_children; i++) {
+					if (owner.children[i]==value) {
+						RemoveAt(i);
+					}
+				}
+			}
+
+			public void RemoveAt(int index) {
+				for (int i=index; i<owner.num_of_children; i++) {
+					owner.children[i]=owner.children[i+1];
+				}
+			}
+
+			public void SetChildIndex(Control child, int new_index) {
+				int	old_index;
+
+				old_index=IndexOf(child);
+				if (old_index==-1) {
+					throw new ArgumentException("Not a child control", "child");
+				}
+
+				if (old_index==new_index) {
+					return;
+				}
+
+				RemoveAt(old_index);
+
+				if (new_index>owner.num_of_children) {
+					Add(child);
+				} else {
+					for (int i=owner.num_of_children-1;i>new_index; i--) {
+						owner.children[i+1]=owner.children[i];
+					}
+
+					owner.children[new_index]=(Control)child;
+				}
+			}
+			#endregion 	// ControlCollection Public Instance Methods
+
+			#region ControlCollection Interface Methods
+#if nodef
+			int IList.Add(Control value) {
+
+				Add(value);
+				
+			}
+#endif
+
+			int IList.Add(object value) {
+				if (!(value is Control)) {
+					throw new ArgumentException("Not of type Control", "value");
+				}
+				Add((Control)value);
+
+				// Assumes the element was added to the end of the list
+				return owner.num_of_children;
+			}
+
+			void IList.Clear() {
+				this.Clear();
+			}
+
+			bool IList.Contains(object value) {
+				if (!(value is Control)) {
+					throw new ArgumentException("Not of type Control", "value");
+				}
+				return this.Contains((Control)value);
+			}
+
+			int IList.IndexOf(object value) {
+				if (!(value is Control)) {
+					throw new ArgumentException("Not of type Control", "value");
+				}
+
+				for (int i=0; i<owner.num_of_children; i++) {
+					if (owner.children[i]==(Control)value) {
+						return i;
+					}
+				}
+
+				return -1;
+			}
+
+			void IList.Insert(int index, object value) {
+				if (!(value is Control)) {
+					throw new ArgumentException("Not of type Control", "value");
+				}
+
+				if (index>owner.num_of_children) {
+					throw new ArgumentOutOfRangeException("index");
+				}
+
+				for (int i=owner.num_of_children-1;i>index; i--) {
+					owner.children[i+1]=owner.children[i];
+				}
+
+				owner.children[index]=(Control)value;
+			}
+
+			void IList.Remove(object value) {
+				if (!(value is Control)) {
+					throw new ArgumentException("Not of type Control", "value");
+				}
+
+				this.Remove((Control)value);
+			}
+
+			object IList.this [int index] {
+				get {
+					return owner.children[index];
+				}
+
+				set {
+					
+				}
+			}
+
+			bool IList.IsFixedSize {
+				get {
+					return false;
+				}
+			}
+
+			object ICollection.SyncRoot {
+				get {
+					return this;
+				}
+			}
+
+			bool ICollection.IsSynchronized {
+				get {
+					return false;
+				}
+			}
+
+			Object ICloneable.Clone() {
+				ControlCollection clone = new ControlCollection(this.owner);
+
+				return clone;
+			}
+			#endregion // ControlCollection Interface Methods
+
+			class ControlComparer : IComparer {
+				int IComparer.Compare(object x, object y) {
+					int	tab_index_x;
+					int	tab_index_y;
+
+					tab_index_x=((Control)x).tab_index;
+					tab_index_y=((Control)y).tab_index;
+
+					if (tab_index_x<tab_index_y) {
+						return -1;
+					} else if (tab_index_x>tab_index_y) {
+						return 1;
+					}
+					return 0;
+				}
+			}
+		}
+		#endregion	// ControlCollection Class
+		
+		#region Public Constructors
+		public Control() {
+			creator_thread = Thread.CurrentThread;
+			controls = new Hashtable();
+			child_controls = CreateControlsInstance();
+			bounds = new Rectangle(0, 0, DefaultSize.Width, DefaultSize.Height);
+			window_size = new Size(DefaultSize.Width, DefaultSize.Height);
+			client_size = new Size(DefaultSize.Width, DefaultSize.Height);
+
+			is_visible = true;
+			is_disposed = false;
+			is_enabled = true;
+			has_focus = false;
+
+			parent = null;
+			background_image = null;
+		}
+
+		public Control(Control parent, string text) : this() {
+			Text=text;
+			Parent=parent;
+		}
+
+		public Control(Control parent, string text, int left, int top, int width, int height) : this() {
+			Parent=parent;
+			Left=left;
+			Top=top;
+			Width=width;
+			Height=height;
+			Text=text;
+		}
+
+		public Control(string text) : this() {
+			Text=text;
+		}
+
+		public Control(string text, int left, int top, int width, int height) : this() {
+			Left=left;
+			Top=top;
+			Width=width;
+			Height=height;
+			Text=text;
+		}
+		#endregion 	// Public Constructors
+
+		#region Public Static Properties
+		public static Color DefaultBackColor {
+			get {
+				return XplatUI.Defaults.BackColor;
+			}
+		}
+
+		public static Font DefaultFont {
+			get {
+				return XplatUI.Defaults.Font;
+			}
+		}
+
+		public static Color DefaultForeColor {
+			get {
+				return XplatUI.Defaults.ForeColor;
+			}
+		}
+
+		public static Keys ModifierKeys {
+			get {
+				return XplatUI.State.ModifierKeys;
+			}
+		}
+
+		public static MouseButtons MouseButtons {
+			get {
+				return XplatUI.State.MouseButtons;
+			}
+		}
+
+		public static Point MousePosition {
+			get {
+				return XplatUI.State.MousePosition;
+			}
+		}
+		#endregion	// Public Static Properties
+
+		#region Public Instance Properties
+		public AccessibleObject AccessibilityObject {
+			get {
+				if (accessibility_object==null) {
+					accessibility_object=CreateAccessibilityInstance();
+				}
+				return accessibility_object;
+			}
+		}
+
+		public string AccessibleDefaultActionDescription {
+			get {
+				return AccessibilityObject.default_action;
+			}
+
+			set {
+				AccessibilityObject.default_action=value;
+			}
+		}
+
+		public string AccessibleDescription {
+			get {
+				return AccessibilityObject.description;
+			}
+
+			set {
+				AccessibilityObject.description=value;
+			}
+		}
+
+		public string AccessibleName {
+			get {
+				return AccessibilityObject.Name;
+			}
+
+			set {
+				AccessibilityObject.Name=value;
+			}
+		}
+
+		public AccessibleRole AccessibleRole {
+			get {
+				return AccessibilityObject.role;
+			}
+
+			set {
+				AccessibilityObject.role=value;
+			}
+		}
+
+		public virtual bool AllowDrop {
+			get {
+				return XplatUI.State.DropTarget;
+			}
+
+			set {
+				XplatUI.State.DropTarget=value;
+			}
+		}
+
+		public virtual AnchorStyles Anchor {
+			get {
+				return anchor_style;
+			}
+
+			set {
+				anchor_style=value;
+			}
+		}
+
+		public virtual Color BackColor {
+			get {
+				if (background_color.IsEmpty) {
+					if (parent!=null) {
+						return parent.BackColor;
+					}
+					return DefaultBackColor;
+				}
+				return background_color;
+			}
+
+			set {
+				background_color=value;
+				Refresh();
+			}
+		}
+
+		public virtual Image BackgroundImage {
+			get {
+				return background_image;
+			}
+
+			set {
+				if (background_image!=value) {
+					background_image=value;
+					OnBackgroundImageChanged(EventArgs.Empty);
+				}
+			}
+		}
+
+		public virtual BindingContext BindingContext {
+			get {
+				throw new NotImplementedException();
+			}
+
+			set {
+				throw new NotImplementedException();
+			}
+		}
+
+
+		public int Bottom {
+			get {
+				return bounds.Y+bounds.Height;
+			}
+		}
+
+		public Rectangle Bounds {
+			get {
+				return this.bounds;
+			}
+
+			set {
+				SetBounds(value.Left, value.Top, value.Width, value.Height, BoundsSpecified.All);
+			}
+		}
+
+		public bool CanFocus {
+			get {
+				throw new NotImplementedException();
+			}
+		}
+
+		public bool CanSelect {
+			get {
+				throw new NotImplementedException();
+			}
+		}
+
+		public bool Capture {
+			get {
+				throw new NotImplementedException();
+			}
+
+			set {
+				throw new NotImplementedException();
+			}
+		}
+
+		public bool CausesValidation {
+			get {
+				throw new NotImplementedException();
+			}
+
+			set {
+				throw new NotImplementedException();
+			}
+		}
+
+		public Rectangle ClientRectangle {
+			get {
+				return new Rectangle(0, 0, client_size.Width, client_size.Height);
+			}
+		}
+
+		public Size ClientSize {
+			get {
+				return client_size;
+			}
+
+			set {
+				throw new NotImplementedException();
+			}
+		}
+
+		public String CompanyName {
+			get {
+				return "Mono Project, Novell, Inc.";
+			}
+		}
+
+		public bool ContainsFocus {
+			get {
+				throw new NotImplementedException();
+			}
+		}
+#if notdef
+		public virtual ContextMenu ContextMenu {
+			get {
+				throw new NotImplementedException();
+			}
+
+			set {
+				throw new NotImplementedException();
+			}
+		}
+#endif
+
+		public ControlCollection Controls {
+			get {
+				return CreateControlsInstance();
+			}
+		}
+
+		public bool Created {
+			get {
+				throw new NotImplementedException();
+			}
+		}
+
+#if notdef
+		public virtual Cursor Cursor {
+			get {
+				throw new NotImplementedException();
+			}
+
+			set {
+				throw new NotImplementedException();
+			}
+		}
+
+		public ControlBidingsCollection DataBindings {
+			get {
+				throw new NotImplementedException();
+			}
+		}
+#endif
+		public virtual Rectangle DisplayRectangle {
+			get {
+				return ClientRectangle;
+			}
+		}
+
+		public bool Disposing {
+			get {
+				throw new NotImplementedException();
+			}
+		}
+
+		public virtual DockStyle Dock {
+			get {
+				throw new NotImplementedException();
+			}
+
+			set {
+				throw new NotImplementedException();
+			}
+		}
+
+		public bool Enabled {
+			get {
+				return is_enabled;
+			}
+
+			set {
+				throw new NotImplementedException();
+			}
+		}
+
+		public virtual bool Focused {
+			get {
+				return this.has_focus;
+			}
+
+			set {
+				throw new NotImplementedException();
+			}
+		}
+
+		public virtual Font Font {
+			get {
+				if (font != null) {
+					return font;
+				}
+
+				if (Parent != null && Parent.Font != null) {
+					return Parent.Font;
+				}
+
+				return DefaultFont;
+			}
+
+			set {
+				font=value;
+				Refresh();
+			}
+		}
+
+		public virtual Color ForeColor {
+			get {
+				if (foreground_color.IsEmpty) {
+					if (parent!=null) {
+						return parent.ForeColor;
+					}
+					return DefaultForeColor;
+				}
+				return foreground_color;
+			}
+
+			set {
+				foreground_color=value;
+				Refresh();
+			}
+		}
+
+		public bool IsDisposed {
+			get {
+				return this.is_disposed;
+			}
+		}
+
+		public bool IsHandleCreated {
+			get {
+				if ((window!=null) && (window.Handle!=IntPtr.Zero)) {
+					return true;
+				}
+
+				return false;
+			}
+		}
+
+		public string Name {
+			get {
+				return this.name;
+			}
+
+			set {
+				this.name=value;
+			}
+		}
+
+		public Control Parent {
+			get {
+				return this.parent;
+			}
+
+			set {
+				if (parent!=value) {
+					if (parent!=null) {
+						parent.Controls.Remove(this);
+					}
+
+					parent=value;
+
+					if (!parent.Controls.Contains(this)) {
+						parent.Controls.Add(this);
+					}
+
+					XplatUI.SetParent(Handle, value.Handle);
+				}
+			}
+		}
+
+
+		public IntPtr Handle {							// IWin32Window
+			get 
+			{
+				if (!IsHandleCreated) {
+					CreateHandle();
+				}
+				return window.Handle;
+			}
+		}
+
+		public bool InvokeRequired {						// ISynchronizeInvoke
+			get {
+				if (creator_thread!=Thread.CurrentThread) {
+					return true;
+				}
+				return false;
+			}
+		}
+
+		public bool Visible {
+			get {
+				return this.is_visible;
+			}
+
+			set {
+				if (value!=is_visible) {
+					is_visible=value;
+					XplatUI.SetVisible(Handle, value);
+				}
+			}
+		}
+
+		public virtual string Text {
+			get {
+				return this.text;
+			}
+
+			set {
+				if (text!=value) {
+					text=value;
+					XplatUI.Text(Handle, text);
+				}
+			}
+		}
+
+		public int Left {
+			get {
+				return this.bounds.X;
+			}
+
+			set {
+				SetBounds(value, bounds.Y, bounds.Width, bounds.Height, BoundsSpecified.X);
+			}
+		}
+
+		public int Top {
+			get {
+				return this.bounds.Y;
+			}
+
+			set {
+				SetBounds(bounds.X, value, bounds.Width, bounds.Height, BoundsSpecified.Y);
+			}
+		}
+
+		public int Width {
+			get {
+				return this.bounds.Width;
+			}
+
+			set {
+				SetBounds(bounds.X, bounds.Y, value, bounds.Height, BoundsSpecified.Width);
+			}
+		}
+
+		public int Height {
+			get {
+				return this.bounds.Height;
+			}
+
+			set {
+				SetBounds(bounds.X, bounds.Y, bounds.Width, value, BoundsSpecified.Height);
+			}
+		}
+
+		public Point Location {
+			get {
+				return new Point(bounds.X, bounds.Y);
+			}
+
+			set {
+				SetBounds(value.X, value.Y, bounds.Width, bounds.Height, BoundsSpecified.Location);
+			}
+		}
+
+		public Size Size {
+			get {
+				return new Size(Width, Height);
+			}
+
+			set {
+				SetBounds(bounds.X, bounds.Y, value.Width, value.Height, BoundsSpecified.Size);
+			}
+		}
+
+		#endregion	// Public Instance Properties
+
+		#region	Protected Instance Properties
+		protected virtual CreateParams CreateParams {
+			get {
+				CreateParams create_params = new CreateParams();
+
+				create_params.Caption = Text;
+				create_params.X = Left;
+				create_params.Y = Top;
+				create_params.Width = Width;
+				create_params.Height = Height;
+
+				create_params.ClassName = XplatUI.DefaultClassName;
+				create_params.ClassStyle = 0;
+				create_params.ExStyle = 0;
+				create_params.Param = 0;
+
+				if (parent!=null) {
+					create_params.Parent = parent.Handle;
+				}
+
+				create_params.Style = (int)WindowStyles.WS_OVERLAPPED;
+
+				if (is_visible) {
+					create_params.Style |= (int)WindowStyles.WS_VISIBLE;
+				}
+
+				return create_params;
+			}
+		}
+
+		protected virtual ImeMode DefaultImeMode {
+			get {
+				return ImeMode.Inherit;
+			}
+		}
+
+		protected virtual Size DefaultSize {
+			get {
+				return new Size(100, 23);
+			}
+		}
+
+		#endregion	// Protected Instance Properties
+
+		#region	Public Instance Methods
+		public bool Contains(Control ctl) {
+			Control current;
+
+			current=ctl;
+			while (current!=null) {
+				if (current==ctl) {
+					return true;
+				}
+				current=current.parent;
+			}
+			return false;
+		}
+
+		public void CreateControl() {
+			Control	child;
+
+			CreateHandle();
+
+			for (int i=0; i<num_of_children; i++) {
+				child_controls[i].CreateControl();
+			}
+			OnCreateControl();
+		}
+
+		public virtual void Refresh() {
+			XplatUI.RefreshWindow(window.Handle);
+		}
+
+		public void SetBounds(int x, int y, int width, int height) {
+			SetBounds(x, y, width, height, BoundsSpecified.All);
+		}
+
+		public void SetBounds(int x, int y, int width, int height, BoundsSpecified bounds_specified) {
+			if ((bounds_specified & BoundsSpecified.X)==0) {
+				x = Left;
+			}
+
+			if ((bounds_specified & BoundsSpecified.Y)==0) {
+				y = Top;
+			}
+
+			if ((bounds_specified & BoundsSpecified.Width)==0) {
+				width = Width;
+			}
+
+			if ((bounds_specified & BoundsSpecified.Height)==0) {
+				height = Height;
+			}
+
+			if (IsHandleCreated) {
+				XplatUI.MoveWindow(Handle, x, y, width, height);
+			}
+			UpdateBounds(x, y, width, height);
+		}
+
+		public void Show() {
+			if (!IsHandleCreated) {
+				this.CreateHandle();
+			}
+
+			this.Visible=true;			
+		}
+
+		public object Invoke(Delegate method) {					// ISynchronizeInvoke
+			return Invoke(method, null);
+		}
+
+		public object Invoke(Delegate method, object[] args) {			// ISynchronizeInvoke
+			IAsyncResult	result;
+
+			result=BeginInvoke(method, args);
+			return EndInvoke(result);
+		}
+
+		public IAsyncResult BeginInvoke(Delegate method) {			// ISynchronizeInvoke
+			return BeginInvoke(method, null);
+		}
+
+		protected virtual AccessibleObject CreateAccessibilityInstance() {
+			return new AccessibleObject(this);
+		}
+
+		protected virtual ControlCollection CreateControlsInstance() {
+			return new ControlCollection(this);
+		}
+
+		protected void UpdateBounds() {
+			UpdateBounds(bounds.X, bounds.Y, bounds.Width, bounds.Height);
+		}
+
+		protected void UpdateBounds(int x, int y, int width, int height) {
+			bool	moved	= false;
+			bool	resized	= false;
+
+			// Generate required notifications
+			if ((this.bounds.X!=x) || (this.bounds.Y!=y)) {
+				moved=true;
+			}
+
+			if ((this.Bounds.Width!=width) || (this.Bounds.Height!=height)) {
+				resized=true;
+			}
+
+			bounds.X=x;
+			bounds.Y=y;
+			bounds.Width=width;
+			bounds.Height=height;
+
+			if (IsHandleCreated) {
+				XplatUI.SetWindowPos(Handle, bounds);
+			}
+
+			if (moved) {
+				OnLocationChanged(EventArgs.Empty);
+			}
+
+			if (resized) {
+				OnSizeChanged(EventArgs.Empty);
+			}
+		}
+
+		protected void UpdateBounds(int x, int y, int width, int height, int clientWidth, int clientHeight) {
+			UpdateBounds(x, y, width, height);
+		}
+
+		public void Invalidate() {
+			Invalidate(bounds, false);
+		}
+
+		public void Invalidate(bool invalidateChildren) {
+			Invalidate(bounds, invalidateChildren);
+		}
+
+		public void Invalidate(System.Drawing.Rectangle rc) {
+			Invalidate(rc, false);
+		}
+
+		public void Invalidate(System.Drawing.Rectangle rc, bool invalidateChildren) {
+			if (!IsHandleCreated || !is_visible) {
+				return;
+			}
+
+			XplatUI.Invalidate(Handle, rc);
+
+			if (invalidateChildren) {
+				for (int i=0; i<num_of_children; i++) children[i].Invalidate();
+			}
+		}
+
+		public void Invalidate(System.Drawing.Region region) {
+			Invalidate(region, false);
+		}
+
+		[MonoTODO]
+		public void Invalidate(System.Drawing.Region region, bool invalidateChildren) {
+			throw new NotImplementedException();
+
+			// FIXME - should use the GetRegionScans function of the region to invalidate each area
+			if (invalidateChildren) {
+				for (int i=0; i<num_of_children; i++) children[i].Invalidate();
+			}
+		}
+
+		[MonoTODO("BeginInvoke() : Figure out a cross-platform way to handle this")]
+		public IAsyncResult BeginInvoke(Delegate method, object[] args) {	// ISynchronizeInvoke
+			IAsyncResult	result = null;
+
+			return result;
+		}
+
+		[MonoTODO]
+		public object EndInvoke(IAsyncResult async_result) {			// ISynchronizeInvoke
+			object result = null;
+
+			return result;
+		}
+
+		public void ResumeLayout() {
+			ResumeLayout(true);
+		}
+
+		public void ResumeLayout(bool peformLayout) {
+			throw new NotImplementedException();
+		}
+
+		public void SuspendLayout() {
+			throw new NotImplementedException();
+		}
+
+		[MonoTODO]
+		protected virtual void WndProc(ref Message m) {
+			EventArgs	e = new EventArgs();
+
+#if debug
+			Console.WriteLine("Received message {0}", m);
+#endif
+
+			switch((Msg)m.Msg) {
+#if notyet
+				// Mouse handling
+				case Msg.WM_LBUTTONDOWN:	throw new NotImplementedException();	break;
+				case Msg.WM_LBUTTONUP:		throw new NotImplementedException();	break;
+				case Msg.WM_LBUTTONDBLCLK:	throw new NotImplementedException();	break;
+
+				case Msg.WM_RBUTTONDOWN:	throw new NotImplementedException();	break;
+				case Msg.WM_RBUTTONUP:		throw new NotImplementedException();	break;
+				case Msg.WM_RBUTTONDBLCLK:	throw new NotImplementedException();	break;
+
+				case Msg.WM_MOUSEHOVER:		throw new NotImplementedException();	break;
+				case Msg.WM_MOUSELEAVE:		throw new NotImplementedException();	break;
+				case Msg.WM_MOUSEMOVE:		throw new NotImplementedException();	break;
+
+
+				// Keyboard handling
+				case Msg.WM_CHAR:		throw new NotImplementedException();	break;
+				case Msg.WM_KEYDOWN:		throw new NotImplementedException();	break;
+				case Msg.WM_KEYUP:		throw new NotImplementedException();	break;
+#endif
+				// Window management
+				case Msg.WM_PAINT: {
+					Rectangle	rect;
+					PaintEventArgs	paint_event;
+
+					paint_event = XplatUI.PaintEventStart(Handle);
+					OnPaint(paint_event);
+					XplatUI.PaintEventEnd(Handle);
+
+					break;
+				}
+
+#if notyet
+				case Msg.WM_SIZE:		throw new NotImplementedException();	break;
+				case Msg.WM_WINDOWPOSCHANGED:	throw new NotImplementedException();	break;
+				case Msg.WM_SYSCOLORCHANGE:	throw new NotImplementedException();	break;
+#endif
+			}
+			DefWndProc(ref m);
+		}
+		#endregion	// Public Instance Methods
+
+
+		#region		// Protected Instance Methods
+		protected virtual void CreateHandle() {
+			if (IsDisposed) {
+				throw new ObjectDisposedException(Name);
+			}
+
+			if (IsHandleCreated) {
+				return;
+			}
+
+			if (window==null) {
+				window = new ControlNativeWindow(this);
+				window.CreateHandle(CreateParams);
+			}
+
+			if (window.Handle!=IntPtr.Zero) {
+				if (!controls.Contains(window.Handle)) {
+					controls.Add(window.Handle, this);
+				}
+
+				creator_thread = Thread.CurrentThread;
+
+				OnHandleCreated(EventArgs.Empty);
+			}
+		}
+
+		protected virtual void DefWndProc(ref Message m) {
+			window.DefWndProc(ref m);
+		}
+
+		protected virtual void DestroyHandle() {
+			if (IsHandleCreated) {
+				if (Handle != IntPtr.Zero) {
+					controls.Remove(Handle);
+				}
+
+				if (window != null) {
+					window.DestroyHandle();
+				}
+			}
+		}
+
+		protected bool GetStyle(ControlStyles flag) {
+			return (control_style & flag) != 0;
+		}
+
+		protected virtual bool ProcessDialogChar(char charCode) {
+			throw new NotImplementedException();
+		}
+
+		protected virtual bool ProcessDialogKey(Keys keyData) {
+			throw new NotImplementedException();
+		}
+
+		protected virtual bool ProcessMnemonic(char charCode) {
+			throw new NotImplementedException();
+		}
+
+		protected void RecreateHandle() {
+			IEnumerator child = child_controls.GetEnumerator();
+
+			if (IsHandleCreated) {
+				DestroyHandle();
+				CreateHandle();
+
+				// FIXME ZOrder?
+
+				while (child.MoveNext()) {
+					((Control)child.Current).RecreateHandle();
+				}
+			}
+		}
+
+		protected virtual void ScaleCore(float dx, float dy) {
+			throw new NotImplementedException();
+		}
+
+		protected virtual void Select(bool directed, bool forward) {
+			throw new NotImplementedException();
+		}
+
+		protected void SetStyle(ControlStyles flag, bool value) {
+			if (value) {
+				control_style |= flag;
+			} else {
+				control_style &= ~flag;
+			}
+		}
+
+		#endregion	// Public Instance Methods
+
+		#region Private Instance Methods
+		#endregion	// Private Instance Methods
+
+
+		#region Private Instance Methods
+		internal virtual void DoDefaultAction() {
+			// Only here to be overriden by our actual controls; this is needed by the accessibility class
+		}
+		#endregion	// Private Instance Methods
+
+
+		#region OnXXX methods
+		protected virtual void OnBackColorChanged(EventArgs e) {
+			if (BackColorChanged!=null) BackColorChanged(this, e);
+			for (int i=0; i<num_of_children; i++) children[i].OnParentBackColorChanged(e);
+		}
+
+		protected virtual void OnBackgroundImageChanged(EventArgs e) {
+			if (BackgroundImageChanged!=null) BackgroundImageChanged(this, e);
+			for (int i=0; i<num_of_children; i++) children[i].OnParentBackgroundImageChanged(e);
+		}
+
+		protected virtual void OnBindingContextChanged(EventArgs e) {
+			if (BindingContextChanged!=null) BindingContextChanged(this, e);
+			for (int i=0; i<num_of_children; i++) children[i].OnParentBindingContextChanged(e);
+		}
+
+		protected virtual void OnCausesValidationChanged(EventArgs e) {
+			if (CausesValidationChanged!=null) CausesValidationChanged(this, e);
+		}
+
+		protected virtual void OnChangeUICues(UICuesEventArgs e) {
+			if (CausesValidationChanged!=null) CausesValidationChanged(this, e);
+		}
+
+		protected virtual void OnClick(EventArgs e) {
+			if (Click!=null) Click(this, e);
+		}
+
+		protected virtual void OnContextMenuChanged(EventArgs e) {
+			if (ContextMenuChanged!=null) ContextMenuChanged(this, e);
+		}
+
+		protected virtual void OnControlAdded(ControlEventArgs e) {
+			if (ControlAdded!=null) ControlAdded(this, e);
+		}
+
+		protected virtual void OnControlRemoved(ControlEventArgs e) {
+			if (ControlRemoved!=null) ControlRemoved(this, e);
+		}
+
+		protected virtual void OnCreateControl() {
+		}
+
+		protected virtual void OnCursorChanged(EventArgs e) {
+			if (CursorChanged!=null) CursorChanged(this, e);
+		}
+
+		protected virtual void OnDockChanged(EventArgs e) {
+			if (DockChanged!=null) DockChanged(this, e);
+		}
+
+		protected virtual void OnDoubleClick(EventArgs e) {
+			if (DoubleClick!=null) DoubleClick(this, e);
+		}
+
+		protected virtual void OnDragDrop(DragEventArgs drgevent) {
+			if (DragDrop!=null) DragDrop(this, drgevent);
+		}
+
+		protected virtual void OnDragEnter(DragEventArgs drgevent) {
+			if (DragEnter!=null) DragEnter(this, drgevent);
+		}
+
+		protected virtual void OnDragLeave(EventArgs e) {
+			if (DragLeave!=null) DragLeave(this, e);
+		}
+
+		protected virtual void OnDragOver(DragEventArgs drgevent) {
+			if (DragOver!=null) DragOver(this, drgevent);
+		}
+
+		protected virtual void OnEnabledChanged(EventArgs e) {
+			if (EnabledChanged!=null) EnabledChanged(this, e);
+			for (int i=0; i<num_of_children; i++) children[i].OnParentEnabledChanged(e);
+		}
+
+		protected virtual void OnEnter(EventArgs e) {
+			if (Enter!=null) Enter(this, e);
+		}
+
+		protected virtual void OnFontChanged(EventArgs e) {
+			if (FontChanged!=null) FontChanged(this, e);
+		}
+
+		protected virtual void OnForeColorChanged(EventArgs e) {
+			if (ForeColorChanged!=null) ForeColorChanged(this, e);
+			for (int i=0; i<num_of_children; i++) children[i].OnParentForeColorChanged(e);
+		}
+
+		protected virtual void OnGiveFeedback(GiveFeedbackEventArgs gfbevent) {
+			if (GiveFeedback!=null) GiveFeedback(this, gfbevent);
+		}
+		
+		protected virtual void OnGotFocus(EventArgs e) {
+			if (GotFocus!=null) GotFocus(this, e);
+		}
+
+		protected virtual void OnHandleCreated(EventArgs e) {
+			if (HandleCreated!=null) HandleCreated(this, e);
+		}
+
+		protected virtual void OnHandleDestroyed(EventArgs e) {
+			if (HandleDestroyed!=null) HandleDestroyed(this, e);
+		}
+
+		protected virtual void OnHelpRequested(HelpEventArgs hevent) {
+			if (HelpRequested!=null) HelpRequested(this, hevent);
+		}
+
+		protected virtual void OnImeModeChanged(EventArgs e) {
+			if (ImeModeChanged!=null) ImeModeChanged(this, e);
+		}
+
+		protected virtual void OnInvalidated(InvalidateEventArgs e) {
+			if (Invalidated!=null) Invalidated(this, e);
+		}
+
+		protected virtual void OnKeyDown(KeyEventArgs e) {
+			if (KeyDown!=null) KeyDown(this, e);
+		}
+
+		protected virtual void OnKeyUp(KeyEventArgs e) {
+			if (KeyUp!=null) KeyUp(this, e);
+		}
+
+		protected virtual void OnLayout(LayoutEventArgs levent) {
+			if (Layout!=null) Layout(this, levent);
+		}
+
+		protected virtual void OnLeave(EventArgs e) {
+			if (Leave!=null) Leave(this, e);
+		}
+
+		protected virtual void OnLocationChanged(EventArgs e) {
+			if (LocationChanged!=null) LocationChanged(this, e);
+		}
+
+		protected virtual void OnLostFocus(EventArgs e) {
+			if (LostFocus!=null) LostFocus(this, e);
+		}
+
+		protected virtual void OnMouseDown(MouseEventArgs e) {
+			if (MouseDown!=null) MouseDown(this, e);
+		}
+
+		protected virtual void OnMouseEnter(EventArgs e) {
+			if (MouseEnter!=null) MouseEnter(this, e);
+		}
+
+		protected virtual void OnMouseHover(EventArgs e) {
+			if (MouseHover!=null) MouseHover(this, e);
+		}
+
+		protected virtual void OnMouseLeave(EventArgs e) {
+			if (MouseLeave!=null) MouseLeave(this, e);
+		}
+
+		protected virtual void OnMouseMove(MouseEventArgs e) {
+			if (MouseMove!=null) MouseMove(this, e);
+		}
+
+		protected virtual void OnMouseUp(MouseEventArgs e) {
+			if (MouseUp!=null) MouseUp(this, e);
+		}
+
+		protected virtual void OnMouseWheel(MouseEventArgs e) {
+			if (MouseWheel!=null) MouseWheel(this, e);
+		}
+
+		protected virtual void OnMove(EventArgs e) {
+			if (Move!=null) Move(this, e);
+		}
+
+		protected virtual void OnNotifyMessage(Message m) {
+			// Override me!
+		}
+
+		protected virtual void OnPaint(PaintEventArgs e) {
+			if (Paint!=null) Paint(this, e);
+		}
+
+		protected virtual void OnPaintBackground(PaintEventArgs pevent) {
+			// Override me!
+		}
+
+		protected virtual void OnParentBackColorChanged(EventArgs e) {
+			if (background_color.IsEmpty && background_image==null) {
+				Invalidate();
+				OnBackColorChanged(e);
+			}
+		}
+
+		protected virtual void OnParentBackgroundImageChanged(EventArgs e) {
+			if (background_color.IsEmpty && background_image==null) {
+				Invalidate();
+				OnBackgroundImageChanged(e);
+			}
+		}
+
+		protected virtual void OnParentBindingContextChanged(EventArgs e) {
+			if (binding_context==null) {
+				binding_context=Parent.binding_context;
+				OnBindingContextChanged(e);
+			}
+		}
+
+		protected virtual void OnParentChanged(EventArgs e) {
+			if (ParentChanged!=null) ParentChanged(this, e);
+		}
+
+		protected virtual void OnParentEnabledChanged(EventArgs e) {
+			if ((is_enabled && !Parent.is_enabled) || (!is_enabled && Parent.is_enabled)) {
+				is_enabled=false;
+				Invalidate();
+				EnabledChanged(this, e);
+			}
+		}
+
+		protected virtual void OnParentFontChanged(EventArgs e) {
+			if (font==null) {
+				Invalidate();
+				OnFontChanged(e);
+			}
+		}
+
+		protected virtual void OnParentForeColorChanged(EventArgs e) {
+			if (foreground_color.IsEmpty) {
+				Invalidate();
+				OnForeColorChanged(e);
+			}
+		}
+
+		protected virtual void OnParentRightToLeftChanged(EventArgs e) {
+			if (right_to_left==RightToLeft.Inherit) {
+				Invalidate();
+				OnRightToLeftChanged(e);
+			}
+		}
+
+		protected virtual void OnParentVisibleChanged(EventArgs e) {
+			if (is_visible!=Parent.is_visible) {
+				is_visible=false;
+				Invalidate();
+				OnVisibleChanged(e);
+			}
+		}
+
+		protected virtual void OnQueryContinueDrag(QueryContinueDragEventArgs e) {
+			if (QueryContinueDrag!=null) QueryContinueDrag(this, e);
+		}
+
+		protected virtual void OnResize(EventArgs e) {
+			if (Resize!=null) Resize(this, e);
+		}
+
+		protected virtual void OnRightToLeftChanged(EventArgs e) {
+			if (RightToLeftChanged!=null) RightToLeftChanged(this, e);
+			for (int i=0; i<num_of_children; i++) children[i].OnParentRightToLeftChanged(e);
+		}
+
+		protected virtual void OnSizeChanged(EventArgs e) {
+			if (SizeChanged!=null) SizeChanged(this, e);
+		}
+
+		protected virtual void OnStyleChanged(EventArgs e) {
+			if (StyleChanged!=null) StyleChanged(this, e);
+		}
+
+		protected virtual void OnSystemColorsChanged(EventArgs e) {
+			if (SystemColorsChanged!=null) SystemColorsChanged(this, e);
+		}
+
+		protected virtual void OnTabIndexChanged(EventArgs e) {
+			if (TabIndexChanged!=null) TabIndexChanged(this, e);
+		}
+
+		protected virtual void OnTabStopChanged(EventArgs e) {
+			if (TabStopChanged!=null) TabStopChanged(this, e);
+		}
+
+		protected virtual void OnTextChanged(EventArgs e) {
+			if (TextChanged!=null) TextChanged(this, e);
+		}
+
+		protected virtual void OnValidated(EventArgs e) {
+			if (Validated!=null) Validated(this, e);
+		}
+
+		protected virtual void OnValidating(System.ComponentModel.CancelEventArgs e) {
+			if (Validating!=null) Validating(this, e);
+		}
+
+		protected virtual void OnVisibleChanged(EventArgs e) {
+			if (VisibleChanged!=null) VisibleChanged(this, e);
+		}
+		#endregion	// OnXXX methods
+
+		#region Events
+		public event EventHandler		BackColorChanged;
+		public event EventHandler		BackgroundImageChanged;
+		public event EventHandler		BindingContextChanged;
+		public event EventHandler		CausesValidationChanged;
+		public event UICuesEventHandler		ChangeUICues;
+		public event EventHandler		Click;
+		public event EventHandler		ContextMenuChanged;
+		public event ControlEventHandler	ControlAdded;
+		public event ControlEventHandler	ControlRemoved;
+		public event EventHandler		CursorChanged;
+		public event EventHandler		DockChanged;
+		public event EventHandler		DoubleClick;
+		public event DragEventHandler		DragDrop;
+		public event DragEventHandler		DragEnter;
+		public event EventHandler		DragLeave;
+		public event DragEventHandler		DragOver;
+		public event EventHandler		EnabledChanged;
+		public event EventHandler		Enter;
+		public event EventHandler		FontChanged;
+		public event EventHandler		ForeColorChanged;
+		public event GiveFeedbackEventHandler	GiveFeedback;
+		public event EventHandler		GotFocus;
+		public event EventHandler		HandleCreated;
+		public event EventHandler		HandleDestroyed;
+		public event HelpEventHandler		HelpRequested;
+		public event EventHandler		ImeModeChanged;
+		public event InvalidateEventHandler	Invalidated;
+		public event KeyEventHandler		KeyDown;
+		public event KeyPressEventHandler	KeyPress;
+		public event KeyEventHandler		KeyUp;
+		public event LayoutEventHandler		Layout;
+		public event EventHandler		Leave;
+		public event EventHandler		LocationChanged;
+		public event EventHandler		LostFocus;
+		public event MouseEventHandler		MouseDown;
+		public event EventHandler		MouseEnter;
+		public event EventHandler		MouseHover;
+		public event EventHandler		MouseLeave;
+		public event MouseEventHandler		MouseMove;
+		public event MouseEventHandler		MouseUp;
+		public event MouseEventHandler		MouseWheel;
+		public event EventHandler		Move;
+		public event PaintEventHandler		Paint;
+		public event EventHandler		ParentChanged;
+		public event QueryAccessibilityHelpEventHandler	QueryAccessibilityHelp;
+		public event QueryContinueDragEventHandler	QueryContinueDrag;
+		public event EventHandler		Resize;
+		public event EventHandler		RightToLeftChanged;
+		public event EventHandler		SizeChanged;
+		public event EventHandler		StyleChanged;
+		public event EventHandler		SystemColorsChanged;
+		public event EventHandler		TabIndexChanged;
+		public event EventHandler		TabStopChanged;
+		public event EventHandler		TextChanged;
+		public event EventHandler		Validated;
+		public event CancelEventHandler		Validating;
+		public event EventHandler		VisibleChanged;
+		#endregion	// Events
+	}
+}

+ 54 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ControlEventArgs.cs

@@ -0,0 +1,54 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: ControlEventArgs.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public class ControlEventArgs {
+		private Control	control;
+
+		#region Public Constructors
+		public ControlEventArgs(Control control) {
+			this.control=control;
+		}
+		#endregion	// Public Constructors
+
+		#region Public Instance Properties
+		public Control Control {
+			get {
+				return this.control;
+			}
+		}
+		#endregion	// Public Instance Properties
+	}
+}

+ 38 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ControlEventHandler.cs

@@ -0,0 +1,38 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: ControlEventHandler.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public delegate void ControlEventHandler (object sender, ControlEventArgs e);
+}

+ 1475 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ControlPaint.cs

@@ -0,0 +1,1475 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: ControlPaint.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// NOT COMPLETE
+
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Drawing.Imaging;
+
+namespace System.Windows.Forms {
+	public sealed class ControlPaint {
+		#region Local Variables
+		static int		RGBMax=255;
+		static int		HLSMax=255;
+		#endregion	// Local Variables
+
+		#region Private Enumerations
+		private enum DrawFrameControlTypes {
+			Caption	= 1,
+			Menu	= 2,
+			Scroll	= 3,
+			Button	= 4
+		}
+
+		private enum DrawFrameControlStates {
+			ButtonCheck		= 0x0000,
+			ButtonRadioImage	= 0x0001,
+			ButtonRadioMask		= 0x0002,
+			ButtonRadio		= 0x0004,
+			Button3State		= 0x0008,
+			ButtonPush		= 0x0010,
+
+			CaptionClose		= 0x0000,
+			CaptionMin		= 0x0001,
+			CaptionMax		= 0x0002,
+			CaptionRestore		= 0x0004,
+			CaptionHelp		= 0x0008,
+
+			MenuArrow		= 0x0000,
+			MenuCheck		= 0x0001,
+			MenuBullet		= 0x0002,
+			MenuArrowRight		= 0x0004,
+
+			ScrollUp		= 0x0000,
+			ScrollDown		= 0x0001,
+			ScrollLeft		= 0x0002,
+			ScrollRight		= 0x0003,
+			ScrollComboBox		= 0x0005,
+			ScrollSizeGrip		= 0x0008,
+			ScrollSizeGripRight	= 0x0010,
+
+			Inactive		= 0x0100,
+			Pushed			= 0x0200,
+			Checked			= 0x0400,
+			Transparent		= 0x0800,
+			Hot			= 0x1000,
+			AdjustRect		= 0x2000,
+			Flat			= 0x4000,
+			Mono			= 0x8000
+			
+		}
+		#endregion	// Private Enumerations
+
+		#region Helpers
+		private static Color Win32ToColor(int Win32Color) {
+			return(Color.FromArgb(
+				(int)(Win32Color) & 0xff0000 >> 16,		// blue
+				(int)(Win32Color) & 0xff00 >> 8,		// green
+				(int)(Win32Color) & 0xff			// red
+			));
+		}
+
+		internal static void Color2HBS(Color color, out int h, out int l, out int s) {
+			int	r;
+			int	g;
+			int	b;
+			int	cMax;
+			int	cMin;
+			int	rDelta;
+			int	gDelta;
+			int	bDelta;
+	
+			r=color.R;
+			g=color.G;
+			b=color.B;
+
+			cMax = Math.Max(Math.Max(r, g), b);
+			cMin = Math.Min(Math.Min(r, g), b);
+
+			l = (((cMax+cMin)*HLSMax)+RGBMax)/(2*RGBMax);
+
+			if (cMax==cMin) {		// Achromatic
+				h=0;					// h undefined
+				s=0;
+				l=r;
+				return;
+			}
+
+			/* saturation */
+			if (l<=(HLSMax/2)) {
+				s=(((cMax-cMin)*HLSMax)+((cMax+cMin)/2))/(cMax+cMin);
+			} else {
+				s=(((cMax-cMin)*HLSMax)+((2*RGBMax-cMax-cMin)/2))/(2*RGBMax-cMax-cMin);
+			}
+
+			/* hue */
+			rDelta=(((cMax-r)*(HLSMax/6))+((cMax-cMin)/2))/(cMax-cMin);
+			gDelta=(((cMax-g)*(HLSMax/6))+((cMax-cMin)/2))/(cMax-cMin);
+			bDelta=(((cMax-b)*(HLSMax/6))+((cMax-cMin)/2))/(cMax-cMin);
+
+			if (r == cMax) {
+				h=bDelta - gDelta;
+			} else if (g == cMax) {
+				h=(HLSMax/3) + rDelta - bDelta;
+			} else { /* B == cMax */
+				h=((2*HLSMax)/3) + gDelta - rDelta;
+			}
+
+			if (h<0) {
+				h+=HLSMax;
+			}
+
+			if (h>HLSMax) {
+				h-=HLSMax;
+			}
+		}
+
+		private static int HueToRGB(int n1, int n2, int hue) {
+			if (hue<0) {
+				hue+=HLSMax;
+			}
+
+			if (hue>HLSMax) {
+				hue -= HLSMax;
+			}
+
+			/* return r,g, or b value from this tridrant */ 
+			if (hue<(HLSMax/6)) {
+				return(n1+(((n2-n1)*hue+(HLSMax/12))/(HLSMax/6)));
+			}
+
+			if (hue<(HLSMax/2)) {
+				return(n2);
+			}
+
+			if (hue<((HLSMax*2)/3)) {
+				return(n1+(((n2-n1)*(((HLSMax*2)/3)-hue)+(HLSMax/12))/(HLSMax/6)));
+			} else {
+				return(n1);
+			}
+		}
+
+		private static Color HBS2Color(int hue, int lum, int sat) {
+			int	R;
+			int	G;
+			int	B;
+			int	Magic1;
+			int	Magic2;
+
+			if (sat == 0) {            /* Achromatic */ 
+				R=G=B=(lum*RGBMax)/HLSMax;
+				// FIXME : Should throw exception if hue!=0
+			} else {
+				if (lum<=(HLSMax/2)) {
+					Magic2=(lum*(HLSMax+sat)+(HLSMax/2))/HLSMax;
+				} else {
+					Magic2=sat+lum-((sat*lum)+(HLSMax/2))/HLSMax;
+				}
+				Magic1=2*lum-Magic2;
+				
+				R = Math.Min(255, (HueToRGB(Magic1,Magic2,hue+(HLSMax/3))*RGBMax+(HLSMax/2))/HLSMax);
+				G = Math.Min(255, (HueToRGB(Magic1,Magic2,hue)*RGBMax+(HLSMax/2))/HLSMax);
+				B = Math.Min(255, (HueToRGB(Magic1,Magic2,hue-(HLSMax/3))*RGBMax+(HLSMax/2))/HLSMax);
+			}
+			return(Color.FromArgb(R, G, B));
+		}
+		#endregion	// Helpers
+
+		#region Public Static Properties
+		public static Color ContrastControlDark {
+			get { return(SystemColors.ControlDark); }
+		}
+		#endregion	// Public Static Properties
+		
+		#region Public Static Methods
+		public static IntPtr CreateHBitmap16Bit(Bitmap bitmap, Color background){
+			throw new NotImplementedException ();
+		}
+		
+		public static IntPtr CreateHBitmapColorMask(Bitmap bitmap, IntPtr monochromeMask){
+			throw new NotImplementedException ();
+		}
+		
+		public static IntPtr CreateHBitmapTransparencyMask(Bitmap bitmap){
+			throw new NotImplementedException ();
+		}
+
+		public static Color Light(Color baseColor) {
+			return Light( baseColor, 10.0f);
+		}
+		
+		public static Color Light(Color baseColor,float percOfLightLight) {
+			int H, I, S;
+
+			ControlPaint.Color2HBS(baseColor, out H, out I, out S);
+			int NewIntensity = Math.Min( 255, I + ((255*(int)percOfLightLight)/100));
+			return ControlPaint.HBS2Color(H, NewIntensity, S);
+		}
+
+		public static Color LightLight(Color baseColor) {
+			return Light( baseColor, 20.0f);
+		}
+
+		public static Color Dark(Color baseColor) {
+			return Dark(baseColor, 10.0f);
+		}
+		
+		public static Color Dark(Color baseColor,float percOfDarkDark) {
+			int H, I, S;
+			ControlPaint.Color2HBS(baseColor, out H, out I, out S);
+			int NewIntensity = Math.Max(0, I - ((255*(int)percOfDarkDark) / 100));
+			return ControlPaint.HBS2Color(H, NewIntensity, S);
+		}
+		
+		public static Color DarkDark(Color baseColor) {
+			return Dark(baseColor, 20.0f);
+		}
+		
+		public static void DrawBorder(Graphics graphics, Rectangle bounds, Color color, ButtonBorderStyle style) {
+			DrawBorder(graphics, bounds, color, 1, style, color, 1, style, color, 1, style, color, 1, style);
+		}
+		
+		public static void DrawBorder( Graphics graphics, Rectangle bounds, Color leftColor, int leftWidth,
+			ButtonBorderStyle leftStyle, Color topColor, int topWidth, ButtonBorderStyle topStyle,
+			Color rightColor, int rightWidth, ButtonBorderStyle rightStyle, Color bottomColor, int bottomWidth,
+			ButtonBorderStyle bottomStyle) {
+
+			DrawBorderInternal(graphics, bounds.Left, bounds.Top, bounds.Left, bounds.Bottom-1, leftWidth, leftColor, leftStyle, Border3DSide.Left);
+			DrawBorderInternal(graphics, bounds.Left, bounds.Top, bounds.Right-1, bounds.Top, topWidth, topColor, topStyle, Border3DSide.Top);
+			DrawBorderInternal(graphics, bounds.Right-1, bounds.Top, bounds.Right-1, bounds.Bottom-1, rightWidth, rightColor, rightStyle, Border3DSide.Right);
+			DrawBorderInternal(graphics, bounds.Left, bounds.Bottom-1, bounds.Right-1, bounds.Bottom-1, bottomWidth, bottomColor, bottomStyle, Border3DSide.Bottom);
+		}
+
+		private static void DrawBorderInternal(Graphics graphics, int startX, int startY, int endX, int endY, 
+			int width, Color color, ButtonBorderStyle style, Border3DSide side) {
+
+			Pen	pen=new Pen(color, 1);
+
+			switch(style) {
+				case ButtonBorderStyle.Solid: {
+					pen.DashStyle=DashStyle.Solid;
+					break;
+				}
+
+				case ButtonBorderStyle.Dashed: {
+					pen.DashStyle=DashStyle.Dash;
+					break;
+				}
+
+				case ButtonBorderStyle.Dotted: {
+					pen.DashStyle=DashStyle.Dot;
+					break;
+				}
+
+				case ButtonBorderStyle.Inset: {
+					pen.DashStyle=DashStyle.Solid;
+					break;
+				}
+
+				case ButtonBorderStyle.Outset: {
+					pen.DashStyle=DashStyle.Solid;
+					break;
+				}
+
+				default:
+				case ButtonBorderStyle.None: {
+					pen.Dispose();
+					return;
+				}
+			}
+
+
+			switch(style) {
+				case ButtonBorderStyle.Outset: {
+					Color		colorGrade;
+					int		hue, brightness, saturation;
+					int		brightnessSteps;
+					int		brightnessDownSteps;
+
+					Color2HBS(color, out hue, out brightness, out saturation);
+
+					brightnessDownSteps=brightness/width;
+					if (brightness>127) {
+						brightnessSteps=Math.Max(6, (160-brightness)/width);
+					} else {
+						brightnessSteps=(127-brightness)/width;
+					}
+					
+					for (int i=0; i<width; i++) {
+						switch(side) {
+							case Border3DSide.Left:	{
+								pen.Dispose();
+								colorGrade=HBS2Color(hue, Math.Min(255, brightness+brightnessSteps*(width-i)), saturation);
+								pen=new Pen(colorGrade, 1);
+								graphics.DrawLine(pen, startX+i, startY+i, endX+i, endY-i);
+								break;
+							}
+						
+							case Border3DSide.Right: {
+								pen.Dispose();
+								colorGrade=HBS2Color(hue, Math.Max(0, brightness-brightnessDownSteps*(width-i)), saturation);
+								pen=new Pen(colorGrade, 1);
+								graphics.DrawLine(pen, startX-i, startY+i, endX-i, endY-i);
+								break;
+							}
+
+							case Border3DSide.Top: {
+								pen.Dispose();
+								colorGrade=HBS2Color(hue, Math.Min(255, brightness+brightnessSteps*(width-i)), saturation);
+								pen=new Pen(colorGrade, 1);
+								graphics.DrawLine(pen, startX+i, startY+i, endX-i, endY+i);
+								break;
+							}
+					
+							case Border3DSide.Bottom: {
+								pen.Dispose();
+								colorGrade=HBS2Color(hue, Math.Max(0, brightness-brightnessDownSteps*(width-i)), saturation);
+								pen=new Pen(colorGrade, 1);
+								graphics.DrawLine(pen, startX+i, startY-i, endX-i, endY-i);
+								break;
+							}
+						}
+					}
+					break;
+				}
+
+				case ButtonBorderStyle.Inset: {
+					Color		colorGrade;
+					int		hue, brightness, saturation;
+					int		brightnessSteps;
+					int		brightnessDownSteps;
+
+					Color2HBS(color, out hue, out brightness, out saturation);
+
+					brightnessDownSteps=brightness/width;
+					if (brightness>127) {
+						brightnessSteps=Math.Max(6, (160-brightness)/width);
+					} else {
+						brightnessSteps=(127-brightness)/width;
+					}
+					
+					for (int i=0; i<width; i++) {
+						switch(side) {
+							case Border3DSide.Left:	{
+								pen.Dispose();
+								colorGrade=HBS2Color(hue, Math.Max(0, brightness-brightnessDownSteps*(width-i)), saturation);
+								pen=new Pen(colorGrade, 1);
+								graphics.DrawLine(pen, startX+i, startY+i, endX+i, endY-i);
+								break;
+							}
+						
+							case Border3DSide.Right: {
+								pen.Dispose();
+								colorGrade=HBS2Color(hue, Math.Min(255, brightness+brightnessSteps*(width-i)), saturation);
+								pen=new Pen(colorGrade, 1);
+								graphics.DrawLine(pen, startX-i, startY+i, endX-i, endY-i);
+								break;
+							}
+
+							case Border3DSide.Top: {
+								pen.Dispose();
+								colorGrade=HBS2Color(hue, Math.Max(0, brightness-brightnessDownSteps*(width-i)), saturation);
+								pen=new Pen(colorGrade, 1);
+								graphics.DrawLine(pen, startX+i, startY+i, endX-i, endY+i);
+								break;
+							}
+					
+							case Border3DSide.Bottom: {
+								pen.Dispose();
+								colorGrade=HBS2Color(hue, Math.Min(255, brightness+brightnessSteps*(width-i)), saturation);
+								pen=new Pen(colorGrade, 1);
+								graphics.DrawLine(pen, startX+i, startY-i, endX-i, endY-i);
+								break;
+							}
+						}
+					}
+					break;
+				}
+
+				/*
+					I decided to have the for-loop duplicated for speed reasons; 
+					that way we only have to switch once (as opposed to have the 
+					for-loop around the switch)
+				*/
+				default: {
+					switch(side) {
+						case Border3DSide.Left:	{
+							for (int i=0; i<width; i++) {
+								graphics.DrawLine(pen, startX+i, startY+i, endX+i, endY-i);
+							}
+							break;
+						}
+						
+						case Border3DSide.Right: {
+							for (int i=0; i<width; i++) {
+								graphics.DrawLine(pen, startX-i, startY+i, endX-i, endY-i);
+							}
+							break;
+						}
+
+						case Border3DSide.Top: {
+							for (int i=0; i<width; i++) {
+								graphics.DrawLine(pen, startX+i, startY+i, endX-i, endY+i);
+							}
+							break;
+						}
+					
+						case Border3DSide.Bottom: {
+							for (int i=0; i<width; i++) {
+								graphics.DrawLine(pen, startX+i, startY-i, endX-i, endY-i);
+							}
+							break;
+						}
+					}
+					break;
+				}
+			}
+			pen.Dispose();
+		}
+		
+		public static void DrawBorder3D(Graphics graphics, Rectangle rectangle) {
+			DrawBorder3D(graphics, rectangle, Border3DStyle.Etched, Border3DSide.All);
+		}
+		
+		public static void DrawBorder3D(Graphics graphics, Rectangle rectangle, Border3DStyle style) {
+			DrawBorder3D(graphics, rectangle, style, Border3DSide.All);
+		}
+		
+		public static void DrawBorder3D(Graphics graphics, int x, int y, int width, int height) {
+			DrawBorder3D(graphics, new Rectangle(x, y, width, height), Border3DStyle.Etched, Border3DSide.All);
+		}
+
+		public static void DrawBorder3D(Graphics graphics, int x, int y, int width, int height, Border3DStyle style) {
+			DrawBorder3D(graphics, new Rectangle(x, y, width, height), style, Border3DSide.All);
+		}
+
+		public static void DrawBorder3D( Graphics graphics, int x, int y, int width, int height, Border3DStyle style,Border3DSide sides) {
+			DrawBorder3D( graphics, new Rectangle(x, y, width, height), style, sides);
+		}
+
+		public static void DrawBorder3D( Graphics graphics, Rectangle rectangle, Border3DStyle style, Border3DSide sides) {
+			Pen			penTopLeft;
+			Pen			penTopLeftInner;
+			Pen			penBottomRight;
+			Pen			penBottomRightInner;
+			Rectangle	rect= new Rectangle(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
+			bool			doInner = false;
+
+			if ((style & Border3DStyle.Adjust)!=0) {
+				rect.Y-=2;
+				rect.X-=2;
+				rect.Width+=4;
+				rect.Height+=4;
+			}
+
+			/* default to flat */
+			penTopLeft=SystemPens.ControlDark;
+			penTopLeftInner=SystemPens.ControlDark;
+			penBottomRight=SystemPens.ControlDark;
+			penBottomRightInner=SystemPens.ControlDark;
+
+			if ((style & Border3DStyle.RaisedOuter)!=0) {
+				penTopLeft=SystemPens.ControlLightLight;
+				penBottomRight=SystemPens.ControlDarkDark;
+				if ((style & (Border3DStyle.RaisedInner | Border3DStyle.SunkenInner))!=0) {
+					doInner=true;
+				}
+			} else if ((style & Border3DStyle.SunkenOuter)!=0) {
+				penTopLeft=SystemPens.ControlDarkDark;
+				penBottomRight=SystemPens.ControlLightLight;
+				if ((style & (Border3DStyle.RaisedInner | Border3DStyle.SunkenInner))!=0) {
+					doInner=true;
+				}
+			}
+
+			if ((style & Border3DStyle.RaisedInner)!=0) {
+				if (doInner) {
+					penTopLeftInner=SystemPens.ControlLight;
+					penBottomRightInner=SystemPens.ControlDark;
+				} else {
+					penTopLeft=SystemPens.ControlLightLight;
+					penBottomRight=SystemPens.ControlDarkDark;
+				}
+			} else if ((style & Border3DStyle.SunkenInner)!=0) {
+				if (doInner) {
+					penTopLeftInner=SystemPens.ControlDark;
+					penBottomRightInner=SystemPens.ControlLight;
+				} else {
+					penTopLeft=SystemPens.ControlDarkDark;
+					penBottomRight=SystemPens.ControlLightLight;
+				}
+			}
+
+			if ((sides & Border3DSide.Middle)!=0) {
+				graphics.FillRectangle(SystemBrushes.Control, rect);
+			}
+
+			if ((sides & Border3DSide.Left)!=0) {
+				graphics.DrawLine(penTopLeft, rect.Left, rect.Bottom-1, rect.Left, rect.Top);
+				if (doInner) {
+					graphics.DrawLine(penTopLeftInner, rect.Left+1, rect.Bottom-1, rect.Left+1, rect.Top);
+				}
+			}
+
+			if ((sides & Border3DSide.Top)!=0) {
+				graphics.DrawLine(penTopLeft, rect.Left, rect.Top, rect.Right-1, rect.Top);
+
+				if (doInner) {
+					if ((sides & Border3DSide.Left)!=0) {
+						graphics.DrawLine(penTopLeftInner, rect.Left+1, rect.Top+1, rect.Right-1, rect.Top+1);
+					} else {
+						graphics.DrawLine(penTopLeftInner, rect.Left, rect.Top+1, rect.Right-1, rect.Top+1);
+					}
+				}
+			}
+
+			if ((sides & Border3DSide.Right)!=0) {
+				graphics.DrawLine(penBottomRight, rect.Right-1, rect.Top, rect.Right-1, rect.Bottom-1);
+
+				if (doInner) {
+					if ((sides & Border3DSide.Top)!=0) {
+						graphics.DrawLine(penBottomRightInner, rect.Right-2, rect.Top+1, rect.Right-2, rect.Bottom-1);
+					} else {
+						graphics.DrawLine(penBottomRightInner, rect.Right-2, rect.Top, rect.Right-2, rect.Bottom-1);
+					}
+				}
+			}
+
+			if ((sides & Border3DSide.Bottom)!=0) {
+				int	left=rect.Left;
+
+				if ((sides & Border3DSide.Left)!=0) {
+					left+=1;
+				}
+
+				graphics.DrawLine(penBottomRight, rect.Left, rect.Bottom-1, rect.Right-1, rect.Bottom-1);
+
+				if (doInner) {
+					if ((sides & Border3DSide.Right)!=0) {
+						graphics.DrawLine(penBottomRightInner, left, rect.Bottom-2, rect.Right-2, rect.Bottom-2);
+					} else {
+						graphics.DrawLine(penBottomRightInner, left, rect.Bottom-2, rect.Right-1, rect.Bottom-2);
+					}
+				}
+			}
+		}
+
+		public static void DrawButton( Graphics graphics, int x, int y, int width, int height, ButtonState state) {
+			DrawButton(graphics, new Rectangle(x, y, width, height), state);
+		}
+
+		public static void DrawButton( Graphics graphics, Rectangle rectangle, ButtonState state) {
+			DrawFrameControlStates	dfcs=DrawFrameControlStates.ButtonPush;
+
+			if ((state & ButtonState.Pushed)!=0) {
+				dfcs |= DrawFrameControlStates.Pushed;
+			}
+
+			if ((state & ButtonState.Checked)!=0) {
+				dfcs |= DrawFrameControlStates.Checked;
+			}
+
+			if ((state & ButtonState.Flat)!=0) {
+				dfcs |= DrawFrameControlStates.Flat;
+			}
+
+			if ((state & ButtonState.Inactive)!=0) {
+				dfcs |= DrawFrameControlStates.Inactive;
+			}
+			DrawFrameControl(graphics, rectangle, DrawFrameControlTypes.Button, dfcs);
+		}
+
+		/* 
+			This function actually draws the various caption elements. 
+			This way we can scale them nicely, no matter what size, and they
+			still look like MS's scaled caption buttons. (as opposed to scaling a bitmap)
+		*/
+
+		private static void DrawCaptionHelper(Graphics graphics, Color color, Pen pen, int lineWidth, int shift, Rectangle captionRect, CaptionButton button) {
+			switch(button) {
+				case CaptionButton.Close: {
+					pen.StartCap=LineCap.Triangle;
+					pen.EndCap=LineCap.Triangle;
+					if (lineWidth<2) {
+						graphics.DrawLine(pen, captionRect.Left+2*lineWidth+1+shift, captionRect.Top+2*lineWidth+shift, captionRect.Right-2*lineWidth+1+shift, captionRect.Bottom-2*lineWidth+shift);
+						graphics.DrawLine(pen, captionRect.Right-2*lineWidth+1+shift, captionRect.Top+2*lineWidth+shift, captionRect.Left+2*lineWidth+1+shift, captionRect.Bottom-2*lineWidth+shift);
+					}
+
+					graphics.DrawLine(pen, captionRect.Left+2*lineWidth+shift, captionRect.Top+2*lineWidth+shift, captionRect.Right-2*lineWidth+shift, captionRect.Bottom-2*lineWidth+shift);
+					graphics.DrawLine(pen, captionRect.Right-2*lineWidth+shift, captionRect.Top+2*lineWidth+shift, captionRect.Left+2*lineWidth+shift, captionRect.Bottom-2*lineWidth+shift);
+					return;
+				}
+
+				case CaptionButton.Help: {
+					StringFormat	sf = new StringFormat();
+					SolidBrush		sb = new SolidBrush(color);
+					Font				font = new Font("Microsoft Sans Serif", captionRect.Height, FontStyle.Bold, GraphicsUnit.Pixel);
+
+					sf.Alignment=StringAlignment.Center;
+					sf.LineAlignment=StringAlignment.Center;
+					
+
+					graphics.DrawString("?", font, sb, captionRect.X+captionRect.Width/2+shift, captionRect.Y+captionRect.Height/2+shift+lineWidth/2, sf);
+
+					sf.Dispose();
+					sb.Dispose();
+					font.Dispose();
+
+					return;
+				}
+
+				case CaptionButton.Maximize: {
+					/* Top 'caption bar' line */
+					for (int i=0; i<Math.Max(2, lineWidth); i++) {
+						graphics.DrawLine(pen, captionRect.Left+lineWidth+shift, captionRect.Top+2*lineWidth+shift+i, captionRect.Right-lineWidth-lineWidth/2+shift, captionRect.Top+2*lineWidth+shift+i);
+					}
+
+					/* Left side line */
+					for (int i=0; i<Math.Max(1, lineWidth/2); i++) {
+						graphics.DrawLine(pen, captionRect.Left+lineWidth+shift+i, captionRect.Top+2*lineWidth+shift, captionRect.Left+lineWidth+shift+i, captionRect.Bottom-lineWidth+shift);
+					}
+
+					/* Right side line */
+					for (int i=0; i<Math.Max(1, lineWidth/2); i++) {
+						graphics.DrawLine(pen, captionRect.Right-lineWidth-lineWidth/2+shift+i, captionRect.Top+2*lineWidth+shift, captionRect.Right-lineWidth-lineWidth/2+shift+i, captionRect.Bottom-lineWidth+shift);
+					}
+
+					/* Bottom line */
+					for (int i=0; i<Math.Max(1, lineWidth/2); i++) {
+						graphics.DrawLine(pen, captionRect.Left+lineWidth+shift, captionRect.Bottom-lineWidth+shift-i, captionRect.Right-lineWidth-lineWidth/2+shift, captionRect.Bottom-lineWidth+shift-i);
+					}
+					return;
+				}
+
+				case CaptionButton.Minimize: {
+					/* Bottom line */
+					for (int i=0; i<Math.Max(2, lineWidth); i++) {
+						graphics.DrawLine(pen, captionRect.Left+lineWidth+shift, captionRect.Bottom-lineWidth+shift-i, captionRect.Right-3*lineWidth+shift, captionRect.Bottom-lineWidth+shift-i);
+					}
+					return;
+				}
+
+				case CaptionButton.Restore: {
+					/** First 'window' **/
+					/* Top 'caption bar' line */
+					for (int i=0; i<Math.Max(2, lineWidth); i++) {
+						graphics.DrawLine(pen, captionRect.Left+3*lineWidth+shift, captionRect.Top+2*lineWidth+shift-i, captionRect.Right-lineWidth-lineWidth/2+shift, captionRect.Top+2*lineWidth+shift-i);
+					}
+
+					/* Left side line */
+					for (int i=0; i<Math.Max(1, lineWidth/2); i++) {
+						graphics.DrawLine(pen, captionRect.Left+3*lineWidth+shift+i, captionRect.Top+2*lineWidth+shift, captionRect.Left+3*lineWidth+shift+i, captionRect.Top+4*lineWidth+shift);
+					}
+
+					/* Right side line */
+					for (int i=0; i<Math.Max(1, lineWidth/2); i++) {
+						graphics.DrawLine(pen, captionRect.Right-lineWidth-lineWidth/2+shift-i, captionRect.Top+2*lineWidth+shift, captionRect.Right-lineWidth-lineWidth/2+shift-i, captionRect.Top+5*lineWidth-lineWidth/2+shift);
+					}
+
+					/* Bottom line */
+					for (int i=0; i<Math.Max(1, lineWidth/2); i++) {
+						graphics.DrawLine(pen, captionRect.Right-3*lineWidth-lineWidth/2+shift, captionRect.Top+5*lineWidth-lineWidth/2+shift+1+i, captionRect.Right-lineWidth-lineWidth/2+shift, captionRect.Top+5*lineWidth-lineWidth/2+shift+1+i);
+					}
+
+					/** Second 'window' **/
+					/* Top 'caption bar' line */
+					for (int i=0; i<Math.Max(2, lineWidth); i++) {
+						graphics.DrawLine(pen, captionRect.Left+lineWidth+shift, captionRect.Top+4*lineWidth+shift+1-i, captionRect.Right-3*lineWidth-lineWidth/2+shift, captionRect.Top+4*lineWidth+shift+1-i);
+					}
+
+					/* Left side line */
+					for (int i=0; i<Math.Max(1, lineWidth/2); i++) {
+						graphics.DrawLine(pen, captionRect.Left+lineWidth+shift+i, captionRect.Top+4*lineWidth+shift+1, captionRect.Left+lineWidth+shift+i, captionRect.Bottom-lineWidth+shift);
+					}
+
+					/* Right side line */
+					for (int i=0; i<Math.Max(1, lineWidth/2); i++) {
+						graphics.DrawLine(pen, captionRect.Right-3*lineWidth-lineWidth/2+shift-i, captionRect.Top+4*lineWidth+shift+1, captionRect.Right-3*lineWidth-lineWidth/2+shift-i, captionRect.Bottom-lineWidth+shift);
+					}
+
+					/* Bottom line */
+					for (int i=0; i<Math.Max(1, lineWidth/2); i++) {
+						graphics.DrawLine(pen, captionRect.Left+lineWidth+shift, captionRect.Bottom-lineWidth+shift-i, captionRect.Right-3*lineWidth-lineWidth/2+shift, captionRect.Bottom-lineWidth+shift-i);
+					}
+
+					return;
+				}
+
+			}
+		}
+
+		public static void DrawCaptionButton(Graphics graphics, int x, int y, int width, int height, CaptionButton button, ButtonState state) {
+			DrawCaptionButton(graphics, new Rectangle(x, y, width, height), button, state);
+		}
+
+		public static void DrawCaptionButton(Graphics graphics, Rectangle rectangle, CaptionButton button, ButtonState state) {
+			Rectangle	captionRect;
+			int			lineWidth;
+
+			DrawButton(graphics, rectangle, state);
+
+			if (rectangle.Width<rectangle.Height) {
+				captionRect=new Rectangle(rectangle.X+1, rectangle.Y+rectangle.Height/2-rectangle.Width/2+1, rectangle.Width-4, rectangle.Width-4);
+			} else {
+				captionRect=new Rectangle(rectangle.X+rectangle.Width/2-rectangle.Height/2+1, rectangle.Y+1, rectangle.Height-4, rectangle.Height-4);
+			}
+
+			if ((state & ButtonState.Pushed)!=0) {
+				captionRect=new Rectangle(rectangle.X+2, rectangle.Y+2, rectangle.Width-3, rectangle.Height-3);
+			}
+
+			/* Make sure we've got at least a line width of 1 */
+			lineWidth=Math.Max(1, captionRect.Width/7);
+
+			switch(button) {
+				case CaptionButton.Close: {
+					Pen	pen;
+
+					if ((state & ButtonState.Inactive)!=0) {
+						pen=new Pen(SystemColors.ControlLightLight, lineWidth);
+						DrawCaptionHelper(graphics, SystemColors.ControlLightLight, pen, lineWidth, 1, captionRect, button);
+						pen.Dispose();
+
+						pen=new Pen(SystemColors.ControlDark, lineWidth);
+						DrawCaptionHelper(graphics, SystemColors.ControlDark, pen, lineWidth, 0, captionRect, button);
+						pen.Dispose();
+						return;
+					} else {
+						pen=new Pen(SystemColors.ControlText, lineWidth);
+						DrawCaptionHelper(graphics, SystemColors.ControlText, pen, lineWidth, 0, captionRect, button);
+						pen.Dispose();
+						return;
+					}
+				}
+
+				case CaptionButton.Help:
+				case CaptionButton.Maximize:
+				case CaptionButton.Minimize:
+				case CaptionButton.Restore: {
+					if ((state & ButtonState.Inactive)!=0) {
+						DrawCaptionHelper(graphics, SystemColors.ControlLightLight, SystemPens.ControlLightLight, lineWidth, 1, captionRect, button);
+
+						DrawCaptionHelper(graphics, SystemColors.ControlDark, SystemPens.ControlDark, lineWidth, 0, captionRect, button);
+						return;
+					} else {
+						DrawCaptionHelper(graphics, SystemColors.ControlText, SystemPens.ControlText, lineWidth, 0, captionRect, button);
+						return;
+					}
+				}
+			}
+		}
+
+		public static void DrawCheckBox(Graphics graphics, int x, int y, int width, int height, ButtonState state) {
+			DrawCheckBox(graphics, new Rectangle(x, y, width, height), state);
+		}
+		
+		public static void DrawCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state) {
+			DrawFrameControlStates	dfcs=DrawFrameControlStates.ButtonCheck;
+
+			if ((state & ButtonState.Pushed)!=0) {
+				dfcs |= DrawFrameControlStates.Pushed;
+			}
+
+			if ((state & ButtonState.Checked)!=0) {
+				dfcs |= DrawFrameControlStates.Checked;
+			}
+
+			if ((state & ButtonState.Flat)!=0) {
+				dfcs |= DrawFrameControlStates.Flat;
+			}
+
+			if ((state & ButtonState.Inactive)!=0) {
+				dfcs |= DrawFrameControlStates.Inactive;
+			}
+
+			DrawFrameControl(graphics, rectangle, DrawFrameControlTypes.Button, dfcs);
+		}
+		
+		public static void DrawComboButton(Graphics graphics, Rectangle rectangle, ButtonState state) {
+			Point[]			arrow = new Point[3];
+			Point				P1;
+			Point				P2;
+			Point				P3;
+			int				centerX;
+			int				centerY;
+			int				shiftX;
+			int				shiftY;
+			Rectangle		rect;
+
+			if ((state & ButtonState.Checked)!=0) {
+				HatchBrush	hatchBrush=new HatchBrush(HatchStyle.Percent50, SystemColors.ControlLight, SystemColors.ControlLightLight);
+				graphics.FillRectangle(hatchBrush,rectangle);
+				hatchBrush.Dispose();
+			}
+
+			if ((state & ButtonState.Flat)!=0) {
+				DrawBorder(graphics, rectangle, SystemColors.ControlDark, ButtonBorderStyle.Solid);
+			} else {
+				if ((state & (ButtonState.Pushed | ButtonState.Checked))!=0) {
+					DrawBorder3D(graphics, rectangle, Border3DStyle.Sunken, Border3DSide.Left | Border3DSide.Top | Border3DSide.Right | Border3DSide.Bottom);
+				} else {
+					DrawBorder3D(graphics, rectangle, Border3DStyle.Raised, Border3DSide.Left | Border3DSide.Top | Border3DSide.Right | Border3DSide.Bottom);
+				}
+			}
+
+			rect=new Rectangle(rectangle.X+rectangle.Width/4, rectangle.Y+rectangle.Height/4, rectangle.Width/2, rectangle.Height/2);
+			centerX=rect.Left+rect.Width/2;
+			centerY=rect.Top+rect.Height/2;
+			shiftX=Math.Max(1, rect.Width/8);
+			shiftY=Math.Max(1, rect.Height/8);
+
+			if ((state & ButtonState.Pushed)!=0) {
+				shiftX++;
+				shiftY++;
+			}
+
+			rect.Y-=shiftY;
+			centerY-=shiftY;
+			P1=new Point(rect.Left, centerY);
+			P2=new Point(rect.Right, centerY);
+			P3=new Point(centerX, rect.Bottom);
+
+			arrow[0]=P1;
+			arrow[1]=P2;
+			arrow[2]=P3;
+
+			/* Draw the arrow */
+			if ((state & ButtonState.Inactive)!=0) {
+				graphics.FillPolygon(SystemBrushes.ControlLightLight, arrow, FillMode.Winding);
+
+				/* Move away from the shadow */
+				P1.X-=1;		P1.Y-=1;
+				P2.X-=1;		P2.Y-=1;
+				P3.X-=1;		P3.Y-=1;
+
+				arrow[0]=P1;
+				arrow[1]=P2;
+				arrow[2]=P3;
+				
+
+				graphics.FillPolygon(SystemBrushes.ControlDark, arrow, FillMode.Winding);
+			} else {
+				graphics.FillPolygon(SystemBrushes.ControlText, arrow, FillMode.Winding);
+			}
+		}
+		
+		public static void DrawComboButton(Graphics graphics, int x, int y, int width, int height, ButtonState state) {
+			DrawComboButton(graphics, new Rectangle(x, y, width, height), state);
+		}
+		
+		public static void DrawContainerGrabHandle(Graphics graphics, Rectangle bounds) {
+			SolidBrush	sb		= new SolidBrush(Color.White);
+			Pen			pen	= new Pen(Color.Black, 1);
+			Rectangle	rect	= new Rectangle(bounds.X, bounds.Y, bounds.Width-1, bounds.Height-1);	// Dunno why, but MS does it that way, too
+			int			X;
+			int			Y;
+
+			graphics.FillRectangle(sb, rect);
+			graphics.DrawRectangle(pen, rect);
+
+			X=rect.X+rect.Width/2;
+			Y=rect.Y+rect.Height/2;
+
+			/* Draw the cross */
+			graphics.DrawLine(pen, X, rect.Y+2, X, rect.Bottom-2);
+			graphics.DrawLine(pen, rect.X+2, Y, rect.Right-2, Y);
+
+			/* Draw 'arrows' for vertical lines */
+			graphics.DrawLine(pen, X-1, rect.Y+3, X+1, rect.Y+3);
+			graphics.DrawLine(pen, X-1, rect.Bottom-3, X+1, rect.Bottom-3);
+
+			/* Draw 'arrows' for horizontal lines */
+			graphics.DrawLine(pen, rect.X+3, Y-1, rect.X+3, Y+1);
+			graphics.DrawLine(pen, rect.Right-3, Y-1, rect.Right-3, Y+1);
+		}
+		
+		public static void DrawFocusRectangle( Graphics graphics, Rectangle rectangle) {
+			DrawFocusRectangle(graphics, rectangle, Color.White, Color.Black);
+		}
+		
+		public static void DrawFocusRectangle( Graphics graphics, Rectangle rectangle, Color foreColor, Color backColor) {
+			//Color			colorForeInverted;
+			Color			colorBackInverted;
+			Pen			pen;
+
+			//colorForeInverted=Color.FromArgb(Math.Abs(foreColor.R-255), Math.Abs(foreColor.G-255), Math.Abs(foreColor.B-255));
+			//pen=new Pen(colorForeInverted, 1);
+			// MS seems to always use black
+			pen=new Pen(Color.Black, 1);
+			graphics.DrawRectangle(pen, rectangle);
+			pen.Dispose();
+
+			colorBackInverted=Color.FromArgb(Math.Abs(backColor.R-255), Math.Abs(backColor.G-255), Math.Abs(backColor.B-255));
+			pen=new Pen(colorBackInverted, 1);
+			pen.DashStyle=DashStyle.Dot;
+			graphics.DrawRectangle(pen, rectangle);
+			pen.Dispose();
+		}
+		
+		public static void DrawGrabHandle(Graphics graphics, Rectangle rectangle, bool primary, bool enabled) {
+			SolidBrush	sb;
+			Pen			pen;
+
+			if (primary==true) {
+				pen=new Pen(Color.Black, 1);
+				if (enabled==true) {
+					sb=new SolidBrush(Color.White);
+				} else {
+					sb=new SolidBrush(SystemColors.Control);
+				}
+			} else {
+				pen=new Pen(Color.White, 1);
+				if (enabled==true) {
+					sb=new SolidBrush(Color.Black);
+				} else {
+					sb=new SolidBrush(SystemColors.Control);
+				}
+			}
+			graphics.FillRectangle(sb, rectangle);
+			graphics.DrawRectangle(pen, rectangle);
+			sb.Dispose();
+			pen.Dispose();
+		}
+		
+		public static void DrawGrid(Graphics graphics, Rectangle area, Size pixelsBetweenDots, Color backColor) {
+			Color	foreColor;
+			int	h;
+			int	b;
+			int	s;
+
+			Color2HBS(backColor, out h, out b, out s);
+
+			if (b>127) {
+				foreColor=Color.Black;
+			} else {
+				foreColor=Color.White;
+			}
+
+#if false
+			/* Commented out until I take the time and figure out 
+				which HatchStyle will match requirements. The code below
+				is only correct for Percent50.
+			*/
+			if (pixelsBetweenDots.Width==pixelsBetweenDots.Height) {
+				HatchBrush	brush=null;
+
+				switch(pixelsBetweenDots.Width) {
+					case 2: brush=new HatchBrush(HatchStyle.Percent50, foreColor, backColor); break;
+					case 4: brush=new HatchBrush(HatchStyle.Percent25, foreColor, backColor); break;
+					case 5: brush=new HatchBrush(HatchStyle.Percent20, foreColor, backColor); break;
+					default: {
+						/* Have to do it the slow way */
+						break;
+					}
+				}
+				if (brush!=null) {
+					graphics.FillRectangle(brush, area);
+					pen.Dispose();
+					brush.Dispose();
+					return;
+				}
+			}
+#endif
+			/* Slow method */
+
+			Bitmap bitmap = new Bitmap(area.Width, area.Height, graphics);
+
+			for (int x=0; x<area.Width; x+=pixelsBetweenDots.Width) {
+				for (int y=0; y<area.Height; y+=pixelsBetweenDots.Height) {
+					bitmap.SetPixel(x, y, foreColor);
+				}
+			}
+			graphics.DrawImage(bitmap, area.X, area.Y, area.Width, area.Height);
+			bitmap.Dispose();
+		}
+		
+		public static void DrawImageDisabled(Graphics graphics, Image image, int x, int y, Color background) {
+			/*
+				Microsoft seems to ignore the background and simply make 
+				the image grayscale. At least when having > 256 colors on 
+				the display.
+			*/
+
+			ImageAttributes	imageAttributes=new ImageAttributes();
+			ColorMatrix			colorMatrix=new ColorMatrix(new float[][] {
+// This table would create a perfect grayscale image, based on luminance
+//				new float[]{0.3f,0.3f,0.3f,0,0},
+//				new float[]{0.59f,0.59f,0.59f,0,0},
+//				new float[]{0.11f,0.11f,0.11f,0,0},
+//				new float[]{0,0,0,1,0,0},
+//				new float[]{0,0,0,0,1,0},
+//				new float[]{0,0,0,0,0,1}
+
+// This table generates a image that is grayscaled and then 
+// brightened up. Seems to match MS close enough.
+				new float[]{0.2f,0.2f,0.2f,0,0},
+				new float[]{0.41f,0.41f,0.41f,0,0},
+				new float[]{0.11f,0.11f,0.11f,0,0},
+				new float[]{0.15f,0.15f,0.15f,1,0,0},
+				new float[]{0.15f,0.15f,0.15f,0,1,0},
+				new float[]{0.15f,0.15f,0.15f,0,0,1}
+			});
+	
+			imageAttributes.SetColorMatrix(colorMatrix);
+			graphics.DrawImage(image, new Rectangle(x, y, image.Width, image.Height), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, imageAttributes);
+			imageAttributes.Dispose();
+		}
+		
+		public static void DrawLockedFrame(Graphics graphics, Rectangle rectangle, bool primary) {
+			Pen	penBorder;
+			Pen	penInside;
+
+			if (primary) {
+				penBorder=new Pen(Color.White, 2);
+				penInside=new Pen(Color.Black, 1);
+			} else {
+				penBorder=new Pen(Color.Black, 2);
+				penInside=new Pen(Color.White, 1);
+			}
+			penBorder.Alignment=PenAlignment.Inset;
+			penInside.Alignment=PenAlignment.Inset;
+
+			graphics.DrawRectangle(penBorder, rectangle);
+			graphics.DrawRectangle(penInside, rectangle.X+2, rectangle.Y+2, rectangle.Width-5, rectangle.Height-5);
+			penBorder.Dispose();
+			penInside.Dispose();
+		}
+		
+		public static void DrawMenuGlyph(Graphics graphics, Rectangle rectangle, MenuGlyph glyph) {
+			Rectangle	rect;
+			int			lineWidth;
+
+			// MS seems to draw the background white
+			graphics.FillRectangle(new SolidBrush(Color.White), rectangle);
+
+			switch(glyph) {
+				case MenuGlyph.Arrow: {
+					Point[]			arrow = new Point[3];
+					Point				P1;
+					Point				P2;
+					Point				P3;
+					int				centerX;
+					int				centerY;
+					int				shiftX;
+					int				shiftY;
+
+					rect=new Rectangle(rectangle.X+rectangle.Width/4, rectangle.Y+rectangle.Height/4, rectangle.Width/2, rectangle.Height/2);
+					centerX=rect.Left+rect.Width/2;
+					centerY=rect.Top+rect.Height/2;
+					shiftX=Math.Max(1, rect.Width/8);
+					shiftY=Math.Max(1, rect.Height/8);
+
+					rect.X-=shiftX;
+					centerX-=shiftX;
+
+					P1=new Point(centerX, rect.Top-1);
+					P2=new Point(centerX, rect.Bottom);
+					P3=new Point(rect.Right, centerY);
+
+					arrow[0]=P1;
+					arrow[1]=P2;
+					arrow[2]=P3;
+
+					graphics.FillPolygon(SystemBrushes.ControlText, arrow, FillMode.Winding);
+
+					return;
+				}
+
+				case MenuGlyph.Bullet: {
+					SolidBrush	sb;
+
+					lineWidth=Math.Max(2, rectangle.Width/3);
+					rect=new Rectangle(rectangle.X+lineWidth, rectangle.Y+lineWidth, rectangle.Width-lineWidth*2, rectangle.Height-lineWidth*2);
+
+					sb=new SolidBrush(SystemColors.MenuText);
+					graphics.FillEllipse(sb, rect);
+					sb.Dispose();
+					return;
+				}
+
+				case MenuGlyph.Checkmark: {
+					int			Scale;
+
+					lineWidth=Math.Max(2, rectangle.Width/6);
+					Scale=Math.Max(1, rectangle.Width/12);
+
+					rect=new Rectangle(rectangle.X+lineWidth, rectangle.Y+lineWidth, rectangle.Width-lineWidth*2, rectangle.Height-lineWidth*2);
+
+					for (int i=0; i<lineWidth; i++) {
+						graphics.DrawLine(SystemPens.MenuText, rect.Left+lineWidth/2, rect.Top+lineWidth+i, rect.Left+lineWidth/2+2*Scale, rect.Top+lineWidth+2*Scale+i);
+						graphics.DrawLine(SystemPens.MenuText, rect.Left+lineWidth/2+2*Scale, rect.Top+lineWidth+2*Scale+i, rect.Left+lineWidth/2+6*Scale, rect.Top+lineWidth-2*Scale+i);
+					}
+					return;
+				}
+			}
+		}
+		
+		public static void DrawMenuGlyph(Graphics graphics, int x, int y, int width, int height, MenuGlyph glyph) {
+			DrawMenuGlyph(graphics, new Rectangle(x, y, width, height), glyph);
+		}
+		
+		public static void DrawMixedCheckBox(Graphics graphics, Rectangle rectangle, ButtonState state) {
+			DrawCheckBox(graphics, rectangle, state);
+		}
+		
+		public static void DrawMixedCheckBox(Graphics graphics, int x, int y, int width, int height, ButtonState state) {
+			DrawMixedCheckBox(graphics, new Rectangle(x, y, width, height), state);
+		}
+
+		[MonoTODO("Finish drawing code for Caption, Menu and Scroll")]
+		private static void DrawFrameControl(Graphics graphics, Rectangle rectangle, DrawFrameControlTypes Type, DrawFrameControlStates State) {
+			switch(Type) {
+				case DrawFrameControlTypes.Button: {
+					if ((State & DrawFrameControlStates.ButtonPush)!=0) {
+						/* Goes first, affects the background */
+						if ((State & DrawFrameControlStates.Checked)!=0) {
+							HatchBrush	hatchBrush=new HatchBrush(HatchStyle.Percent50, SystemColors.ControlLight, SystemColors.ControlLightLight);
+							graphics.FillRectangle(hatchBrush,rectangle);
+							hatchBrush.Dispose();
+						}
+
+						if ((State & DrawFrameControlStates.Pushed)!=0) {
+							DrawBorder3D(graphics, rectangle, Border3DStyle.Sunken, Border3DSide.Left | Border3DSide.Top | Border3DSide.Right | Border3DSide.Bottom);
+						} else if ((State & DrawFrameControlStates.Flat)!=0) {
+							DrawBorder(graphics, rectangle, SystemColors.ControlDark, ButtonBorderStyle.Solid);
+						} else if ((State & DrawFrameControlStates.Inactive)!=0) {
+							/* Same as normal, it would seem */
+							DrawBorder3D(graphics, rectangle, Border3DStyle.Raised, Border3DSide.Left | Border3DSide.Top | Border3DSide.Right | Border3DSide.Bottom);
+						} else {
+							DrawBorder3D(graphics, rectangle, Border3DStyle.Raised, Border3DSide.Left | Border3DSide.Top | Border3DSide.Right | Border3DSide.Bottom);
+						}
+					} else if ((State & DrawFrameControlStates.ButtonRadio)!=0) {
+						Pen			penFatDark	= new Pen(SystemColors.ControlDarkDark, 2);
+						Pen			penFatLight	= new Pen(SystemColors.ControlLight, 2);
+						int			lineWidth;
+
+						graphics.DrawArc(penFatDark, rectangle.X+1, rectangle.Y+1, rectangle.Width-2, rectangle.Height-2, 135, 180);
+						graphics.DrawArc(penFatLight, rectangle.X+1, rectangle.Y+1, rectangle.Width-2, rectangle.Height-2, 315, 180);
+
+						graphics.DrawArc(SystemPens.ControlDark, rectangle, 135, 180);
+						graphics.DrawArc(SystemPens.ControlLightLight, rectangle, 315, 180);
+
+						lineWidth=Math.Max(1, Math.Min(rectangle.Width, rectangle.Height)/3);
+
+						if ((State & DrawFrameControlStates.Checked)!=0) {
+							SolidBrush	buttonBrush;
+
+							if ((State & DrawFrameControlStates.Inactive)!=0) {
+								buttonBrush=(SolidBrush)SystemBrushes.ControlDark;
+							} else {
+								buttonBrush=(SolidBrush)SystemBrushes.ControlText;
+							}
+							graphics.FillPie(buttonBrush, rectangle.X+lineWidth, rectangle.Y+lineWidth, rectangle.Width-lineWidth*2, rectangle.Height-lineWidth*2, 0, 359);
+						}
+						penFatDark.Dispose();
+						penFatLight.Dispose();
+					} else if ((State & DrawFrameControlStates.ButtonRadioImage)!=0) {
+						throw new NotImplementedException () ;
+					} else if ((State & DrawFrameControlStates.ButtonRadioMask)!=0) {
+						throw new NotImplementedException ();
+					} else {	/* Must be Checkbox */
+						Pen			pen;
+						int			lineWidth;
+						Rectangle	rect;
+						int			Scale;
+
+						/* FIXME: I'm sure there's an easier way to calculate all this, but it should do for now */
+
+						/* Goes first, affects the background */
+						if ((State & DrawFrameControlStates.Pushed)!=0) {
+							HatchBrush	hatchBrush=new HatchBrush(HatchStyle.Percent50, SystemColors.ControlLight, SystemColors.ControlLightLight);
+							graphics.FillRectangle(hatchBrush,rectangle);
+							hatchBrush.Dispose();
+						}
+
+						/* Draw the sunken frame */
+						if ((State & DrawFrameControlStates.Flat)!=0) {
+							DrawBorder(graphics, rectangle, SystemColors.ControlDark, ButtonBorderStyle.Solid);
+						} else {
+							DrawBorder3D(graphics, rectangle, Border3DStyle.Sunken, Border3DSide.Left | Border3DSide.Top | Border3DSide.Right | Border3DSide.Bottom);
+						}
+
+						/* Make sure we've got at least a line width of 1 */
+						lineWidth=Math.Max(3, rectangle.Width/6);
+						Scale=Math.Max(1, rectangle.Width/12);
+
+						rect=new Rectangle(rectangle.X+lineWidth, rectangle.Y+lineWidth, rectangle.Width-lineWidth*2, rectangle.Height-lineWidth*2);
+						if ((State & DrawFrameControlStates.Inactive)!=0) {
+							pen=SystemPens.ControlDark;
+						} else {
+							pen=SystemPens.ControlText;
+						}
+
+						if ((State & DrawFrameControlStates.Checked)!=0) {
+							/* Need to draw a check-mark */
+							for (int i=0; i<lineWidth; i++) {
+								graphics.DrawLine(pen, rect.Left+lineWidth/2, rect.Top+lineWidth+i, rect.Left+lineWidth/2+2*Scale, rect.Top+lineWidth+2*Scale+i);
+								graphics.DrawLine(pen, rect.Left+lineWidth/2+2*Scale, rect.Top+lineWidth+2*Scale+i, rect.Left+lineWidth/2+6*Scale, rect.Top+lineWidth-2*Scale+i);
+							}
+							
+						}
+					}
+					return;
+				}
+
+				case DrawFrameControlTypes.Caption: {
+					// FIXME:
+					break;
+				}
+
+				case DrawFrameControlTypes.Menu: {
+					// FIXME:
+					break;
+				}
+
+				case DrawFrameControlTypes.Scroll: {
+					// FIXME:
+					break;
+				}
+			}
+		}
+	
+		public static void DrawRadioButton(Graphics graphics, int x, int y, int width, int height, ButtonState state) {
+			DrawRadioButton(graphics, new Rectangle(x, y, width, height), state);
+		}
+		
+		public static void DrawRadioButton(Graphics graphics, Rectangle rectangle, ButtonState state) {
+			DrawFrameControlStates	dfcs=DrawFrameControlStates.ButtonRadio;
+
+			if ((state & ButtonState.Pushed)!=0) {
+				dfcs |= DrawFrameControlStates.Pushed;
+			}
+
+			if ((state & ButtonState.Checked)!=0) {
+				dfcs |= DrawFrameControlStates.Checked;
+			}
+
+			if ((state & ButtonState.Flat)!=0) {
+				dfcs |= DrawFrameControlStates.Flat;
+			}
+
+			if ((state & ButtonState.Inactive)!=0) {
+				dfcs |= DrawFrameControlStates.Inactive;
+			}
+			DrawFrameControl(graphics, rectangle, DrawFrameControlTypes.Button, dfcs);
+		}
+		
+		[MonoTODO]
+		public static void DrawReversibleFrame(Rectangle rectangle, Color backColor, FrameStyle style) {
+			//FIXME:
+		}
+		
+		[MonoTODO]
+		public static void DrawReversibleLine(Point start, Point end, Color backColor) {
+			//FIXME:
+		}
+
+		[MonoTODO]
+		public static void FillReversibleRectangle(Rectangle rectangle, Color backColor) {
+			//FIXME:
+		}
+		
+		
+		public static void DrawScrollButton(Graphics graphics, Rectangle rectangle, ScrollButton button, ButtonState state) {
+			Point[]			arrow = new Point[3];
+			Point				P1;
+			Point				P2;
+			Point				P3;
+			int				centerX;
+			int				centerY;
+			int				shiftX;
+			int				shiftY;
+			Rectangle		rect;
+
+			if ((state & ButtonState.Checked)!=0) {
+				HatchBrush	hatchBrush=new HatchBrush(HatchStyle.Percent50, SystemColors.ControlLight, SystemColors.ControlLightLight);
+				graphics.FillRectangle(hatchBrush,rectangle);
+				hatchBrush.Dispose();
+			}
+
+			if ((state & ButtonState.Flat)!=0) {
+				DrawBorder(graphics, rectangle, SystemColors.ControlDark, ButtonBorderStyle.Solid);
+			} else {
+				DrawBorder3D(graphics, rectangle, Border3DStyle.Raised, Border3DSide.Left | Border3DSide.Top | Border3DSide.Right | Border3DSide.Bottom);
+			}
+
+			rect=new Rectangle(rectangle.X+rectangle.Width/4, rectangle.Y+rectangle.Height/4, rectangle.Width/2, rectangle.Height/2);
+			centerX=rect.Left+rect.Width/2;
+			centerY=rect.Top+rect.Height/2;
+			shiftX=Math.Max(1, rect.Width/8);
+			shiftY=Math.Max(1, rect.Height/8);
+
+			if ((state & ButtonState.Pushed)!=0) {
+				shiftX++;
+				shiftY++;
+			}
+
+			switch(button) {
+				default:
+				case ScrollButton.Down: {
+					rect.Y-=shiftY;
+					centerY-=shiftY;
+					P1=new Point(rect.Left, centerY);
+					P2=new Point(rect.Right, centerY);
+					P3=new Point(centerX, rect.Bottom);
+					break;
+				}
+
+				case ScrollButton.Up: {
+					rect.Y+=shiftY;
+					centerY+=shiftY;
+					P1=new Point(rect.Left, centerY);
+					P2=new Point(rect.Right, centerY);
+					P3=new Point(centerX, rect.Top-1);
+					break;
+				}
+
+				case ScrollButton.Left: {
+					rect.X+=shiftX;
+					centerX+=shiftX;
+					P1=new Point(centerX, rect.Top-1);
+					P2=new Point(centerX, rect.Bottom);
+					P3=new Point(rect.Left, centerY);
+					break;
+				}
+
+				case ScrollButton.Right: {
+					rect.X-=shiftX;
+					centerX-=shiftX;
+					P1=new Point(centerX, rect.Top-1);
+					P2=new Point(centerX, rect.Bottom);
+					P3=new Point(rect.Right, centerY);
+					break;
+				}
+			}
+			arrow[0]=P1;
+			arrow[1]=P2;
+			arrow[2]=P3;
+
+			/* Draw the arrow */
+			if ((state & ButtonState.Inactive)!=0) {
+				graphics.FillPolygon(SystemBrushes.ControlLightLight, arrow, FillMode.Winding);
+
+				/* Move away from the shadow */
+				P1.X-=1;		P1.Y-=1;
+				P2.X-=1;		P2.Y-=1;
+				P3.X-=1;		P3.Y-=1;
+
+				arrow[0]=P1;
+				arrow[1]=P2;
+				arrow[2]=P3;
+				
+				graphics.FillPolygon(SystemBrushes.ControlDark, arrow, FillMode.Winding);
+			} else {
+				graphics.FillPolygon(SystemBrushes.ControlText, arrow, FillMode.Winding);
+			}
+		}
+		
+		public static void DrawScrollButton(Graphics graphics, int x, int y, int width, int height, ScrollButton button, ButtonState state) {
+			DrawScrollButton(graphics, new Rectangle(x, y, width, height), button, state);
+		}
+		
+		public static void DrawSelectionFrame(Graphics graphics, bool active, Rectangle outsideRect, Rectangle insideRect, Color backColor) {
+			int					h;
+			int					b;
+			int					s;
+			Color					foreColor;
+			HatchBrush			brush;
+			Color					transparent;
+			GraphicsContainer	container;
+
+			Color2HBS(backColor, out h, out b, out s);
+
+			if (b>127) {
+				foreColor=SystemColors.ControlDark;
+			} else {
+				foreColor=SystemColors.ControlLight;
+			}
+			transparent=Color.FromArgb(0, backColor);
+
+			if (active==true) {
+				brush=new HatchBrush(HatchStyle.LightUpwardDiagonal, foreColor, transparent);
+			} else {
+				brush=new HatchBrush(HatchStyle.Percent25, foreColor, transparent);
+			}
+
+			container=graphics.BeginContainer();
+			graphics.ExcludeClip(insideRect);
+			graphics.FillRectangle(brush, outsideRect);
+			graphics.EndContainer(container);
+			brush.Dispose();
+		}
+		
+		public static void DrawSizeGrip(Graphics graphics, Color backColor, Rectangle bounds) {
+			int	h;
+			int	b;
+			int	s;
+			Pen	pen1;
+			Pen	pen2;
+
+			Color2HBS(backColor, out h, out b, out s);
+
+			pen1=new Pen(HBS2Color(h, Math.Min(255, (b*166)/100), s), 1);
+			pen2=new Pen(HBS2Color(h, (b*33)/100, s), 1);
+
+			for (int i=0; i<bounds.Width; i+=4) {
+				graphics.DrawLine(pen1, bounds.Left+i, bounds.Bottom, bounds.Right, bounds.Top+i);
+				graphics.DrawLine(pen2, bounds.Left+i+1, bounds.Bottom, bounds.Right, bounds.Top+i+1);
+				graphics.DrawLine(pen2, bounds.Left+i+2, bounds.Bottom, bounds.Right, bounds.Top+i+2);
+			}
+			pen1.Dispose();
+			pen2.Dispose();
+		}
+		
+		public static void DrawSizeGrip(Graphics graphics, Color backColor, int x, int y, int width, int height) {
+			DrawSizeGrip(graphics, backColor, new Rectangle(x, y, width, height));
+		}
+		
+		public static void DrawStringDisabled(Graphics graphics, string s, Font font, Color color, RectangleF layoutRectangle, StringFormat format) {
+			SolidBrush	brush;
+
+			brush=new SolidBrush(ControlPaint.Light(color, 25));
+
+			layoutRectangle.Offset(1.0f, 1.0f);
+			graphics.DrawString(s, font, brush, layoutRectangle, format);
+
+			brush.Color=ControlPaint.Dark(color, 35);
+			layoutRectangle.Offset(-1.0f, -1.0f);
+			graphics.DrawString(s, font, brush, layoutRectangle, format);
+
+			brush.Dispose();
+		}
+		#endregion	// Public Static Methods
+	}
+}

+ 54 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ControlStyles.cs

@@ -0,0 +1,54 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: ControlStyles.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public enum ControlStyles {
+		ContainerControl	= 0x00000001,
+		UserPaint		= 0x00000002,
+		Opaque			= 0x00000004,
+		ResizeRedraw		= 0x00000010,
+		FixedWidth		= 0x00000020,
+		FixedHeight		= 0x00000040,
+		StandardClick		= 0x00000100,
+		Selectable		= 0x00000200,
+		UserMouse		= 0x00000400,
+		SupportsTransparentBackColor	= 0x00000800,
+		StandardDoubleClick	= 0x00001000,
+		AllPaintingInWmPaint	= 0x00002000,
+		CacheText		= 0x00004000,
+		EnableNotifyMessage	= 0x00008000,
+		DoubleBuffer		= 0x00010000
+	}
+}

+ 66 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ConvertEventArgs.cs

@@ -0,0 +1,66 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: ConvertEventArgs.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public class ConvertEventArgs : EventArgs {
+		private object	object_value;
+		private Type	desired_type;
+
+		#region Public Constructors
+		public ConvertEventArgs(object value, Type desiredType) {
+			this.object_value=value;
+			this.desired_type=desiredType;
+		}
+		#endregion	// Public Constructors
+
+		#region Public Instance Properties
+		public Type DesiredType {
+			get {
+				return this.desired_type;
+			}
+		}
+
+		public object Value {
+			get {
+				return this.object_value;
+			}
+
+			set {
+				this.object_value=value;
+			}
+		}
+		#endregion	// Public Instance Properties
+	}
+}

+ 38 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ConvertEventHandler.cs

@@ -0,0 +1,38 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: ConvertEventHandler.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public delegate void ConvertEventHandler (object sender, ConvertEventArgs e);
+}

+ 44 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/Copyright

@@ -0,0 +1,44 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: Copyright,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+namespace System.Windows.Forms {
+	public class CreateParams {
+		#region Public Constructors
+		#endregion	// Public Constructors
+
+		#region Public Instance Properties
+		#endregion	// Public Instance Properties
+
+		#region Public Instance Methods
+		#endregion	// Public Instance Methods
+	}
+}

+ 129 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/CreateParams.cs

@@ -0,0 +1,129 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: CreateParams.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+using System.Collections;
+using System.ComponentModel;
+
+namespace System.Windows.Forms {
+	public class CreateParams {
+		#region Local Variables
+		private string	caption;
+		private string	class_name;
+		private int	class_style;
+		private int	ex_style;
+		private int	x;
+		private int	y;
+		private int	height;
+		private int	width;
+		private int	style;
+		private object	param;
+		private IntPtr	parent;
+		#endregion 	// Local variables
+
+		#region Public Constructors
+		public CreateParams() {
+		}
+		#endregion	// Public Constructors
+
+		#region Public Instance Properties
+		public string Caption {
+			get { return caption; }
+			set { caption = value; }
+		}
+
+		public string ClassName {
+			get { return class_name; }
+			set { class_name = value; }
+		}
+
+		public int ClassStyle {
+			get { return class_style; }
+			set { class_style = value; }
+		}
+
+		public int ExStyle {
+			get { return ex_style; }
+			set { ex_style = value; }
+		}
+
+		public int X {
+			get { return x; }
+			set { x = value; }
+		}
+
+		public int Y {
+			get { return y; }
+			set { y = value; }
+		}
+
+		public int Width {
+			get { return width; }
+			set { width = value; }
+		}
+
+		public int Height {
+			get { return height; }
+			set { height = value; }
+		}
+
+		public int Style {
+			get { return style; }
+			set { style = value; }
+		}
+
+		public object Param {
+			get { return param; }
+			set { param = value; }
+		}
+
+		public IntPtr Parent {
+			get { return parent; }
+			set { parent = value; }
+		}
+		#endregion	// Public Instance Properties
+
+		#region Public Instance Methods
+		public override string ToString() {
+			return "CreateParams; X=" + X.ToString() + 
+				", Y=" + Y.ToString() +
+				", Width=" + Width.ToString() +
+				", Height=" + Height.ToString() +
+				", Style=" + Style.ToString() +
+				", Parent=" + Parent.ToString();
+		}
+		#endregion	// Public Instance Methods
+
+	}
+}

+ 45 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/DockStyle.cs

@@ -0,0 +1,45 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: DockStyle.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public enum DockStyle {
+		None	= 0,
+		Top	= 1,
+		Bottom	= 2,
+		Left	= 3,
+		Right	= 4,
+		Fill	= 5
+	}
+}

+ 42 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/DragAction.cs

@@ -0,0 +1,42 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: DragAction.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public enum DragAction {
+		Continue	= 0,
+		Drop		= 1,
+		Cancel		= 2
+	}
+}

+ 45 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/DragDropEffects.cs

@@ -0,0 +1,45 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: DragDropEffects.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public enum DragDropEffects {
+		None	= 0x00000000,
+		Copy	= 0x00000001,
+		Move	= 0x00000002,
+		Link	= 0x00000004,
+		Scroll	= unchecked((int)0x80000000),
+		All	= unchecked((int)0x80000003)
+	}
+}

+ 100 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/DragEventArgs.cs

@@ -0,0 +1,100 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: DragEventArgs.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public class DragEventArgs : EventArgs {
+		private int		x;
+		private int		y;
+		private int		keystate;
+		private DragDropEffects	allowed_effect;
+		private DragDropEffects	current_effect;
+		private IDataObject	data_object;
+
+		#region Public Constructors
+		public DragEventArgs(IDataObject data, int keyState, int x, int y, DragDropEffects allowedEffect, DragDropEffects effect) {
+			this.x=x;
+			this.y=y;
+			this.keystate=keyState;
+			this.allowed_effect=allowedEffect;	
+			this.current_effect=effect;
+			this.data_object=data;
+		}
+		#endregion	// Public Constructors
+
+		#region Public Instance Properties
+		public DragDropEffects AllowedEffect {
+			get {
+				return this.allowed_effect;
+			}
+		}
+
+		public IDataObject Data {
+			get {
+				return this.data_object;
+			}
+		}
+
+		public DragDropEffects Effect {
+			get {
+				return this.current_effect;
+			}
+
+			set {
+				if ((value & this.allowed_effect)!=0) {
+					this.current_effect=value;
+				}
+			}
+		}
+
+		public int KeyState {
+			get {
+				return this.keystate;
+			}
+		}
+
+		public int X {
+			get {
+				return this.x;
+			}
+		}
+
+		public int Y {
+			get {
+				return this.y;
+			}
+		}
+		#endregion	// Public Instance Properties
+	}
+}

+ 38 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/DragEventHandler.cs

@@ -0,0 +1,38 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: DragEventHandler.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public delegate void DragEventHandler (object sender, DragEventArgs e);
+}

+ 43 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/FlatStyle.cs

@@ -0,0 +1,43 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: FlatStyle.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public enum FlatStyle {
+		Flat		= 0,
+		Popup		= 1,
+		Standard	= 2,
+		System		= 3
+	}
+}

+ 189 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs

@@ -0,0 +1,189 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: Form.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// NOT COMPLETE
+
+using System;
+using System.Drawing;
+using System.ComponentModel;
+using System.Collections;
+using System.Runtime.InteropServices;
+using System.Threading;
+
+namespace System.Windows.Forms {
+	public class Form : ContainerControl {
+		#region Local Variables
+		//private static bool	
+		#endregion	// Local Variables
+
+		#region Public Constructor & Destructor
+		public Form() {
+			Console.WriteLine("Form Constructor called");
+			//XplatUI.Version();
+		}
+		#endregion	// Public Constructor & Destructor
+
+		#region Public Static Properties
+		#endregion	// Public Static Properties
+
+		#region Public Instance Properties
+		#endregion	// Public Instance Properties
+
+		#region Protected Instance Properties
+		#endregion	// Public Instance Properties
+
+		#region Public Static Methods
+		#endregion	// Public Static Methods
+
+		#region Public Instance Methods
+		[MonoTODO("Need to add MDI support")]
+		protected override CreateParams CreateParams {
+			get {
+				CreateParams create_params = new CreateParams();
+
+				create_params.Caption = "";
+
+				create_params.ClassName=XplatUI.DefaultClassName;
+				create_params.ClassStyle = 0;
+				create_params.ExStyle=0;
+				create_params.Parent=IntPtr.Zero;
+				create_params.Param=0;
+
+				create_params.Style |= (int)WindowStyles.WS_OVERLAPPEDWINDOW;
+
+create_params.Style |= (int)WindowStyles.WS_VISIBLE;
+
+				return create_params;
+			}
+		}
+		#endregion	// Public Instance Methods
+
+		#region Protected Instance Methods
+		#endregion	// Protected Instance Methods
+
+		#region Events
+
+		protected virtual void OnActivated(EventArgs e) {
+			if (Activated != null) {
+				Activated(this, e);
+			}
+		}
+
+		protected virtual void OnClosed(EventArgs e) {
+			if (Closed != null) {
+				Closed(this, e);
+			}
+		}
+
+		protected virtual void OnClosed(System.ComponentModel.CancelEventArgs e) {
+			if (Closing != null) {
+				Closing(this, e);
+			}
+		}
+
+		protected virtual void OnDeactivate(EventArgs e) {
+			if (Deactivate != null) {
+				Deactivate(this, e);
+			}
+		}
+
+		protected virtual void OnInputLanguageChanged(InputLanguageChangedEventArgs e) {
+			if (InputLanguageChanged!=null) {
+				InputLanguageChanged(this, e);
+			}
+		}
+
+		protected virtual void OnInputLanguageChanging(InputLanguageChangingEventArgs e) {
+			if (InputLanguageChanging!=null) {
+				InputLanguageChanging(this, e);
+			}
+		}
+
+		protected virtual void OnLoad(EventArgs e) {
+			if (Load != null) {
+				Load(this, e);
+			}
+		}
+
+		protected virtual void OnMaximizedBoundsChanged(EventArgs e) {
+			if (MaximizedBoundsChanged != null) {
+				MaximizedBoundsChanged(this, e);
+			}
+		}
+
+		protected virtual void OnMaximumSizeChanged(EventArgs e) {
+			if (MaximumSizeChanged != null) {
+				MaximumSizeChanged(this, e);
+			}
+		}
+
+		protected virtual void OnMdiChildActivate(EventArgs e) {
+			if (MdiChildActivate != null) {
+				MdiChildActivate(this, e);
+			}
+		}
+
+		protected virtual void OnMenuComplete(EventArgs e) {
+			if (MenuComplete != null) {
+				MenuComplete(this, e);
+			}
+		}
+
+		protected virtual void OnMenuStart(EventArgs e) {
+			if (MenuStart != null) {
+				MenuStart(this, e);
+			}
+		}
+
+		protected virtual void OnMinimumSizeChanged(EventArgs e) {
+			if (MinimumSizeChanged != null) {
+				MinimumSizeChanged(this, e);
+			}
+		}
+
+		public event EventHandler Activated;
+		public event EventHandler Closed;
+		public event CancelEventHandler Closing;
+		public event EventHandler Deactivate;
+		public event InputLanguageChangedEventHandler InputLanguageChanged;
+		public event InputLanguageChangingEventHandler InputLanguageChanging;
+		public event EventHandler Load;
+		public event EventHandler MaximizedBoundsChanged;
+		public event EventHandler MaximumSizeChanged;
+		public event EventHandler MdiChildActivate;
+		public event EventHandler MenuComplete;
+		public event EventHandler MenuStart;
+		public event EventHandler MinimumSizeChanged;
+		#endregion	// Events
+	}
+}

+ 41 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/FrameStyle.cs

@@ -0,0 +1,41 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: FrameStyle.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public enum FrameStyle {
+		Dashed	= 0,
+		Thick	= 1
+	}
+}

+ 66 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/GiveFeedbackEventArgs.cs

@@ -0,0 +1,66 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: GiveFeedbackEventArgs.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public class GiveFeedbackEventArgs : EventArgs {
+		private DragDropEffects	effect;
+		private bool		use_default_cursors;
+
+		#region Public Constructors
+		public GiveFeedbackEventArgs(DragDropEffects effect, bool useDefaultCursors) {
+			this.effect=effect;
+			this.use_default_cursors=useDefaultCursors;
+		}
+		#endregion	// Public Constructors
+
+		#region Public Instance Properties
+		public DragDropEffects Effect {
+			get {
+				return this.effect;
+			}
+		}
+
+		public bool UseDefaultCursors {
+			get {
+				return this.use_default_cursors;
+			}
+
+			set {
+				this.use_default_cursors=value;
+			}
+		}
+		#endregion	// Public Instance Properties
+	}
+}

+ 38 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/GiveFeedbackEventHandler.cs

@@ -0,0 +1,38 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: GiveFeedbackEventHandler.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public delegate void GiveFeedbackEventHandler (object sender, GiveFeedbackEventArgs e);
+}

+ 68 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/HelpEventArgs.cs

@@ -0,0 +1,68 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: HelpEventArgs.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+using System.Drawing;
+
+namespace System.Windows.Forms {
+	public class HelpEventArgs : EventArgs {
+		private Point	mouse_position;
+		private bool	event_handled;
+
+		#region Public Constructors
+		public HelpEventArgs(System.Drawing.Point mousePos) {
+			this.mouse_position=mousePos;
+			this.event_handled=false;
+		}
+		#endregion	// Public Constructors
+
+		#region Public Instance Properties
+		public bool Handled {
+			get {
+				return this.event_handled;
+			}
+
+			set {
+				this.event_handled=value;
+			}
+		}
+
+		public Point MousePos {
+			get {
+				return this.mouse_position;
+			}
+		}
+		#endregion	// Public Instance Properties
+	}
+}

+ 38 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/HelpEventHandler.cs

@@ -0,0 +1,38 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: HelpEventHandler.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public delegate void HelpEventHandler (object sender, HelpEventArgs e);
+}

+ 46 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/IContainerControl.cs

@@ -0,0 +1,46 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: IContainerControl.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public interface IContainerControl {
+		#region Public Instance Properties
+		Control ActiveControl {get; set;}
+		#endregion	// Public Instance Properties
+
+		#region Public Instance Methods
+		bool ActivateControl(Control active);
+		#endregion	// Public Instance Methods
+	}
+}

+ 56 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/IDataObject.cs

@@ -0,0 +1,56 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: IDataObject.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public interface IDataObject {
+		#region Public Instance Methods
+		object GetData(string format);
+		object GetData(string format, bool autoConvert);
+		object GetData(Type format);
+
+		bool GetDataPresent(string format);
+		bool GetDataPresent(string format, bool autoConvert);
+		bool GetDataPresent(Type format);
+
+		string[] GetFormats();
+		string[] GetFormats(bool autoConvert);
+
+		void SetData(object data);
+		void SetData(string format, bool autoConvert, object data);
+		void SetData(string format, object data);
+		void SetData(Type format, object data);
+		#endregion	// Public Instance Methods
+	}
+}

+ 40 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/IMessageFilter.cs

@@ -0,0 +1,40 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: IMessageFilter.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public interface IMessageFilter {
+		bool PreFilterMessage(ref Message m);
+	}
+}

+ 44 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/IWin32Window.cs

@@ -0,0 +1,44 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: IWin32Window.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public interface IWin32Window {
+		#region Public Instance Properties
+		IntPtr Handle {
+			get;
+		}
+		#endregion	// Public Instance Properties
+	}
+}

+ 51 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ImeMode.cs

@@ -0,0 +1,51 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: ImeMode.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public enum ImeMode {
+		NoControl	= 0,
+		On		= 1,
+		Off		= 2,
+		Disable		= 3,
+		Hiragana	= 4,
+		Katakana	= 5,
+		KatakanaHalf	= 6,
+		AlphaFull	= 7,
+		Alpha		= 8,
+		HangulFull	= 9,
+		Hangul		= 10,
+		Inherit		= -1
+	}
+}

+ 144 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/InputLanguage.cs

@@ -0,0 +1,144 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: InputLanguage.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// NOT COMPLETE
+
+using System.Globalization;
+
+namespace System.Windows.Forms {
+	public sealed class InputLanguage {
+		internal static InputLanguageCollection	all;
+		private IntPtr			handle;
+		private CultureInfo		culture;
+		private string			layout_name;
+		private static InputLanguage	current_input;
+		private static InputLanguage	default_input;
+
+		#region Private Constructor
+		[MonoTODO("Pull Microsofts InputLanguages and enter them here")]
+		internal InputLanguage() {
+			if (all == null) {
+				all = new InputLanguageCollection();
+
+				all.Add(new InputLanguage(IntPtr.Zero, new CultureInfo(""), "US"));
+			}
+			if (default_input == null) {
+				default_input=InputLanguage.FromCulture(CultureInfo.CurrentUICulture);
+			}
+
+			if (current_input == null) {
+				current_input=InputLanguage.FromCulture(CultureInfo.CurrentUICulture);
+			}
+		}
+
+		internal InputLanguage(IntPtr handle, CultureInfo culture, string layout_name) : this() {
+			this.handle=handle;
+			this.culture=culture;
+			this.layout_name=layout_name;
+		}
+		#endregion	// Private Constructor
+
+		#region Public Static Properties
+		public static InputLanguage CurrentInputLanguage {
+			get {
+				return current_input;
+			}
+
+			set {
+				if (all.Contains(value)) {
+					current_input=value;
+				}
+			}
+		}
+
+		public static InputLanguage DefaultInputLanguage {
+			get {
+				return default_input;
+			}
+		}
+
+		public static InputLanguageCollection InstalledInputLanguage {
+			get {
+				return all;
+			}
+		}
+		#endregion	// Public Static Properties
+
+		#region Public Instance Properties
+		public CultureInfo Culture {
+			get {
+				return this.culture;
+			}
+		}
+
+		public IntPtr Handle {
+			get {
+				return this.handle;
+			}
+		}
+
+		public string LayoutName {
+			get {
+				return this.layout_name;
+			}
+		}
+		#endregion	// Public Instance Properties
+
+		#region Public Static Methods
+		public static InputLanguage FromCulture(System.Globalization.CultureInfo culture) {
+			foreach (InputLanguage c in all) {
+				if (culture.EnglishName==c.culture.EnglishName) {
+					return new InputLanguage(c.handle, c.culture, c.layout_name);
+				}
+			}
+
+			return new InputLanguage(all[0].handle, all[0].culture, all[0].layout_name);
+		}
+		#endregion	// Public Static Methods
+
+		#region Public Instance Methods
+		public override bool Equals(object value) {
+			if (value is InputLanguage) {
+				if ((((InputLanguage)value).culture==this.culture) && (((InputLanguage)value).handle==this.handle) && (((InputLanguage)value).layout_name==this.layout_name)) {
+					return true;
+				}
+			}
+			return false;
+		}
+
+		public override int GetHashCode() {
+			return base.GetHashCode();
+		}
+		#endregion	// Public Instance Methods
+	}
+}

+ 78 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/InputLanguageChangedEventArgs.cs

@@ -0,0 +1,78 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: InputLanguageChangedEventArgs.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+using System.Globalization;
+
+namespace System.Windows.Forms {
+	public class InputLanguageChangedEventArgs {
+		private CultureInfo	culture;
+		private byte		charset;
+		private InputLanguage	input_language;
+
+		#region Public Constructors
+		public InputLanguageChangedEventArgs(System.Globalization.CultureInfo culture, byte charSet) {
+			this.culture = culture;
+			this.charset = charSet;
+			this.input_language = InputLanguage.FromCulture(culture);
+		}
+
+		public InputLanguageChangedEventArgs(InputLanguage inputLanguage, byte charSet) {
+			this.culture = inputLanguage.Culture;
+			this.charset = charSet;
+			this.input_language = inputLanguage;
+		}
+		#endregion	// Public Constructors
+
+		#region Public Instance Properties
+		public byte CharSet {
+			get {
+				return this.charset;
+			}
+		}
+
+		public CultureInfo Culture {
+			get {
+				return this.culture;
+			}
+		}
+
+		public InputLanguage InputLanguage {
+			get {
+				return this.input_language;
+			}
+		}
+		#endregion	// Public Instance Properties
+	}
+}

+ 38 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/InputLanguageChangedEventHandler.cs

@@ -0,0 +1,38 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: InputLanguageChangedEventHandler.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public delegate void InputLanguageChangedEventHandler(object sender, InputLanguageChangedEventArgs e);
+}

+ 78 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/InputLanguageChangingEventArgs.cs

@@ -0,0 +1,78 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: InputLanguageChangingEventArgs.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+using System.Globalization;
+
+namespace System.Windows.Forms {
+	public class InputLanguageChangingEventArgs {
+		private CultureInfo	culture;
+		private bool		system_charset;
+		private InputLanguage	input_language;
+
+		#region Public Constructors
+		public InputLanguageChangingEventArgs (System.Globalization.CultureInfo culture, bool sysCharSet) {
+			this.culture = culture;
+			this.system_charset = sysCharSet;
+			this.input_language = InputLanguage.FromCulture(culture);
+		}
+
+		public InputLanguageChangingEventArgs (InputLanguage inputLanguage, bool sysCharSet) {
+			this.culture = inputLanguage.Culture;
+			this.system_charset = sysCharSet;
+			this.input_language = inputLanguage;
+		}
+		#endregion	// Public Constructors
+
+		#region Public Instance Properties
+		public bool SysCharSet {
+			get {
+				return this.system_charset;
+			}
+		}
+
+		public CultureInfo Culture {
+			get {
+				return this.culture;
+			}
+		}
+
+		public InputLanguage InputLanguage {
+			get {
+				return this.input_language;
+			}
+		}
+		#endregion	// Public Instance Properties
+	}
+}

+ 38 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/InputLanguageChangingEventHandler.cs

@@ -0,0 +1,38 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: InputLanguageChangingEventHandler.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public delegate void InputLanguageChangingEventHandler(object sender, InputLanguageChangingEventArgs e);
+}

+ 91 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/InputLanguageCollection.cs

@@ -0,0 +1,91 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: InputLanguageCollection.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+using System.Collections;
+using System.Globalization;
+
+namespace System.Windows.Forms {
+	public class InputLanguageCollection : ReadOnlyCollectionBase {
+		#region Local Variables
+		internal InputLanguage[]	list;
+		#endregion	// Local Variables
+
+		#region Private Constructor
+		internal InputLanguageCollection() {
+		}
+		#endregion	// Private Constructor
+
+		#region Internal Instance Methods
+		internal void Add(InputLanguage value) {
+			list[list.Length]=value;
+		}
+		#endregion
+
+		#region Public Instance Methods
+		public InputLanguage this [int index] {
+			get {
+				if (index>=list.Length) {
+					throw new ArgumentOutOfRangeException("index");
+				}
+				return list[index];
+			}
+		}
+
+		public bool Contains(InputLanguage value) {
+			for (int i=0; i<list.Length; i++) {
+				if ((list[i].Culture==value.Culture) && (list[i].LayoutName==value.LayoutName)) {
+					return true;
+				}
+			}
+			return false;
+		}
+
+		public void CopyTo(InputLanguage[] dest, int index) {
+			if (list.Length>0) {
+				Array.Copy(list, 0, dest, index, list.Length);
+			}
+		}
+
+		public int IndexOf(InputLanguage value) {
+			for (int i=0; i<list.Length; i++) {
+				if ((list[i].Culture==value.Culture) && (list[i].LayoutName==value.LayoutName)) {
+					return i;
+				}
+			}
+			return -1;
+		}
+		#endregion	// Public Instance Methods
+	}
+}

+ 56 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/InvalidateEventArgs.cs

@@ -0,0 +1,56 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: InvalidateEventArgs.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+using System.Drawing;
+
+namespace System.Windows.Forms {
+	public class InvalidateEventArgs : EventArgs {
+		private Rectangle	invalidated_rectangle;
+
+		#region Public Constructors
+		public InvalidateEventArgs(System.Drawing.Rectangle invalidRect) {
+			this.invalidated_rectangle=invalidRect;
+		}
+		#endregion	// Public Constructors
+
+		#region Public Instance Properties
+		public Rectangle InvalidRect {
+			get {
+				return this.invalidated_rectangle;
+			}
+		}
+		#endregion	// Public Instance Properties
+	}
+}

+ 38 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/InvalidateEventHandler.cs

@@ -0,0 +1,38 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: InvalidateEventHandler.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public delegate void InvalidateEventHandler (object sender, InvalidateEventArgs e);
+}

+ 114 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/KeyEventArgs.cs

@@ -0,0 +1,114 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: KeyEventArgs.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public class KeyEventArgs : EventArgs {
+		private Keys	key_data;
+		private bool	event_handled;
+
+		#region Public Constructors
+		public KeyEventArgs(Keys keyData) {
+			this.key_data=keyData;
+			this.event_handled=false;
+		}
+		#endregion	// Public Constructors
+
+		#region Public Instance Properties
+		public virtual bool Alt {
+			get {
+				if ((this.key_data & Keys.Alt)==0) {
+					return false;
+				} else {
+					return true;
+				}
+			}
+		}
+
+		public bool Control {
+			get {
+				if ((this.key_data & Keys.Control)==0) {
+					return false;
+				} else {
+					return true;
+				}
+			}
+		}
+
+		public bool Handled {
+			get {
+				return this.event_handled;
+			}
+
+			set {
+				this.event_handled=value;
+			}
+		}
+
+		public Keys KeyCode {
+			get {
+				return (this.key_data & Keys.KeyCode);
+			}
+		}
+
+		public Keys KeyData {
+			get {
+				return this.key_data;
+			}
+		}
+
+		public int KeyValue {
+			get {
+				return Convert.ToInt32(this.key_data);
+			}
+		}
+
+		public Keys Modifiers {
+			get {
+				return (this.key_data & Keys.Modifiers);
+			}
+		}
+
+		public virtual bool Shift {
+			get {
+				if ((this.key_data & Keys.Shift)==0) {
+					return false;
+				} else {
+					return true;
+				}
+			}
+		}
+		#endregion	// Public Instance Properties
+	}
+}

+ 38 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/KeyEventHandler.cs

@@ -0,0 +1,38 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: KeyEventHandler.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public delegate void KeyEventHandler (object sender, KeyEventArgs e);
+}

+ 66 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/KeyPressEventArgs.cs

@@ -0,0 +1,66 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: KeyPressEventArgs.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public class KeyPressEventArgs : EventArgs {
+		private char	key_char;
+		private bool	event_handled;
+
+		#region Public Constructors
+		KeyPressEventArgs(char keyChar) {
+			this.key_char=keyChar;
+			this.event_handled=false;
+		}
+		#endregion	// Public Constructors
+
+		#region Public Instance Properties
+		public bool Handled {
+			get {
+				return this.event_handled;
+			}
+
+			set {
+				this.event_handled=value;
+			}
+		}
+
+		public char KeyChar {
+			get {
+				return this.key_char;
+			}
+		}
+		#endregion	// Public Instance Properties
+	}
+}

+ 38 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/KeyPressEventHandler.cs

@@ -0,0 +1,38 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: KeyPressEventHandler.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public delegate void KeyPressEventHandler (object sender, KeyPressEventArgs e);
+}

+ 222 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/Keys.cs

@@ -0,0 +1,222 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: Keys.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public enum Keys {
+		None		= 0x00000000,
+		LButton		= 0x00000001,
+		RButton		= 0x00000002,
+		Cancel		= 0x00000003,
+		MButton		= 0x00000004,
+		XButton1	= 0x00000005,
+		XButton2	= 0x00000006,
+		Back		= 0x00000008,
+		Tab		= 0x00000009,
+		LineFeed	= 0x0000000A,
+		Clear		= 0x0000000C,
+		Return		= 0x0000000D,
+		ShiftKey	= 0x00000010,
+		ControlKey	= 0x00000011,
+		Menu		= 0x00000012,
+		Pause		= 0x00000013,
+		CapsLock	= 0x00000014,
+		Captial		= 0x00000014,
+		KanaMode	= 0x00000015,
+		HanguelMode	= 0x00000015,
+		HangulMode	= 0x00000015,
+		JunjaMode	= 0x00000017,
+		FinalMode	= 0x00000018,
+		KanjiMode	= 0x00000019,
+		HanjaMode	= 0x00000019,
+		Escape		= 0x0000001B,
+		IMEConvert	= 0x0000001C,
+		IMENonConvert	= 0x0000001D,
+		IMEAceept	= 0x0000001E,
+		IMEAccept	= 0x0000001E,
+		IMEModeChange	= 0x0000001F,
+		Space		= 0x00000020,
+		PageUp		= 0x00000021,
+		Prior		= 0x00000021,
+		PageDown	= 0x00000022,
+		Next		= 0x00000022,
+		End		= 0x00000023,
+		Home		= 0x00000024,
+		Left		= 0x00000025,
+		Up		= 0x00000026,
+		Right		= 0x00000027,
+		Down		= 0x00000028,
+		Select		= 0x00000029,
+		Print		= 0x0000002A,
+		Execute		= 0x0000002B,
+		PrintScreen	= 0x0000002C,
+		Snapshot	= 0x0000002C,
+		Insert		= 0x0000002D,
+		Delete		= 0x0000002E,
+		Help		= 0x0000002F,
+		D0		= 0x00000030,
+		D1		= 0x00000031,
+		D2		= 0x00000032,
+		D3		= 0x00000033,
+		D4		= 0x00000034,
+		D5		= 0x00000035,
+		D6		= 0x00000036,
+		D7		= 0x00000037,
+		D8		= 0x00000038,
+		D9		= 0x00000039,
+		A		= 0x00000041,
+		B		= 0x00000042,
+		C		= 0x00000043,
+		D		= 0x00000044,
+		E		= 0x00000045,
+		F		= 0x00000046,
+		G		= 0x00000047,
+		H		= 0x00000048,
+		I		= 0x00000049,
+		J		= 0x0000004A,
+		K		= 0x0000004B,
+		L		= 0x0000004C,
+		M		= 0x0000004D,
+		N		= 0x0000004E,
+		O		= 0x0000004F,
+		P		= 0x00000050,
+		Q		= 0x00000051,
+		R		= 0x00000052,
+		S		= 0x00000053,
+		T		= 0x00000054,
+		U		= 0x00000055,
+		V		= 0x00000056,
+		W		= 0x00000057,
+		X		= 0x00000058,
+		Y		= 0x00000059,
+		Z		= 0x0000005A,
+		LWin		= 0x0000005B,
+		RWin		= 0x0000005C,
+		Apps		= 0x0000005D,
+		NumPad0		= 0x00000060,
+		NumPad1		= 0x00000061,
+		NumPad2		= 0x00000062,
+		NumPad3		= 0x00000063,
+		NumPad4		= 0x00000064,
+		NumPad5		= 0x00000065,
+		NumPad6		= 0x00000066,
+		NumPad7		= 0x00000067,
+		NumPad8		= 0x00000068,
+		NumPad9		= 0x00000069,
+		Multiply	= 0x0000006A,
+		Add		= 0x0000006B,
+		Separator	= 0x0000006C,
+		Subtract	= 0x0000006D,
+		Decimal		= 0x0000006E,
+		Divide		= 0x0000006F,
+		F1		= 0x00000070,
+		F2		= 0x00000071,
+		F3		= 0x00000072,
+		F4		= 0x00000073,
+		F5		= 0x00000074,
+		F6		= 0x00000075,
+		F7		= 0x00000076,
+		F8		= 0x00000077,
+		F9		= 0x00000078,
+		F10		= 0x00000079,
+		F11		= 0x0000007A,
+		F12		= 0x0000007B,
+		F13		= 0x0000007C,
+		F14		= 0x0000007D,
+		F15		= 0x0000007E,
+		F16		= 0x0000007F,
+		F17		= 0x00000080,
+		F18		= 0x00000081,
+		F19		= 0x00000082,
+		F20		= 0x00000083,
+		F21		= 0x00000084,
+		F22		= 0x00000085,
+		F23		= 0x00000086,
+		F24		= 0x00000087,
+		NumLock		= 0x00000090,
+		Scroll		= 0x00000091,
+		LShiftKey	= 0x000000A0,
+		RShiftKey	= 0x000000A1,
+		LControlKey	= 0x000000A2,
+		RControlKey	= 0x000000A3,
+		LMenu		= 0x000000A4,
+		RMenu		= 0x000000A5,
+		BrowserBack	= 0x000000A6,
+		BrowserForward	= 0x000000A7,
+		BrowserRefresh	= 0x000000A8,
+		BrowserStop	= 0x000000A9,
+		BrowserSearch	= 0x000000AA,
+		BrowserFavorites= 0x000000AB,
+		BrowserHome	= 0x000000AC,
+		VolumeMute	= 0x000000AD,
+		VolumeDown	= 0x000000AE,
+		VolumeUp	= 0x000000AF,
+		MediaNextTrack	= 0x000000B0,
+		MediaPreviousTrack= 0x000000B1,
+		MediaStop	= 0x000000B2,
+		MediaPlayPause	= 0x000000B3,
+		LaunchMail	= 0x000000B4,
+		SelectMedia	= 0x000000B5,
+		LaunchApplication1= 0x000000B6,
+		LaunchApplication2= 0x000000B7,
+		OemSemicolon	= 0x000000BA,
+		Oemplus		= 0x000000BB,
+		Oemcomma	= 0x000000BC,
+		OemMinus	= 0x000000BD,
+		OemPeriod	= 0x000000BE,
+		OemQuestion	= 0x000000BF,
+		Oemtilde	= 0x000000C0,
+		OemOpenBrackets	= 0x000000DB,
+		OemPipe		= 0x000000DC,
+		OemCloseBrackets= 0x000000DD,
+		OemQuotes	= 0x000000DE,
+		Oem8		= 0x000000DF,
+		OemBackslash	= 0x000000E2,
+		ProcessKey	= 0x000000E5,
+		Attn		= 0x000000F6,
+		Crsel		= 0x000000F7,
+		Exsel		= 0x000000F8,
+		EraseEof	= 0x000000F9,
+		Play		= 0x000000FA,
+		Zoom		= 0x000000FB,
+		NoName		= 0x000000FC,
+		Pa1		= 0x000000FD,
+		OemClear	= 0x000000FE,
+		KeyCode		= 0x0000FFFF,
+		Shift		= 0x00010000,
+		Control		= 0x00020000,
+		Alt		= 0x00040000,
+		Modifiers	= unchecked((int)0xFFFF0000)
+	}
+}

+ 472 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/Label.cs

@@ -0,0 +1,472 @@
+//
+// System.Windows.Forms.Label.cs
+//
+// Author:
+//   stubbed out by Daniel Carrera ([email protected])
+//	  implemented for Gtk+ by Rachel Hestilow ([email protected])
+//	Dennis Hayes ([email protected])
+//   WineLib implementation started by John Sohn ([email protected])
+//
+// (C) 2002/3 Ximian, Inc
+//
+
+namespace System.Windows.Forms {
+    	using System.ComponentModel;
+    	using System.Drawing;
+    	using System.Drawing.Text;
+	
+    	public class Label : Control {
+    		Image background_image;
+    		BorderStyle border_style;
+    		bool autoSize;
+    		Image image;
+    		ContentAlignment image_align;
+		StringFormat	string_format;
+//    		ImeMode default_ime_mode;
+    		bool render_transparent;
+    		FlatStyle flat_style;
+    		int preferred_height;
+    		int preferred_width;
+    		bool tab_stop;
+    		ContentAlignment text_align;
+    		bool use_mnemonic;
+    
+    		public Label () : base ()
+    		{
+			// Defaults in the Spec
+			autoSize = false;
+			border_style = BorderStyle.None;
+//			base.TabStop = false;
+			text_align = ContentAlignment.TopLeft;
+//			SetStyle (ControlStyles.Selectable, false);
+//			SetStyle (ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
+			string_format = new StringFormat();
+			string_format.HotkeyPrefix=HotkeyPrefix.Show;
+    		}
+
+#region Properties
+    		public virtual bool AutoSize {
+    			get {
+    				return autoSize;
+    			}
+    			set {
+    				autoSize = value;
+    			}
+    		}
+    
+    		public override Image BackgroundImage {
+    			get {
+    				return background_image;
+    			}
+    			set {
+    				background_image = value;
+				Refresh ();
+    			}
+    		}
+    
+    		public virtual BorderStyle BorderStyle {
+    			get {
+    				return border_style;
+    			}
+    			set {
+				if (border_style == value)
+					return;
+				
+    				border_style = value;
+				RecreateHandle ();
+    			}
+    		}
+    
+    
+    		public FlatStyle FlatStyle {
+    			get {
+    				return flat_style;
+    			}
+    			set {
+    				flat_style = value;
+				Refresh ();
+    			}
+    		}
+    
+    		public Image Image {
+    			get {
+    				return image;
+    			}
+    			set {
+    				image = value;
+				Refresh ();
+    			}
+    		}
+    
+    		public ContentAlignment ImageAlign {
+    			get {
+    				return image_align;
+    			}
+    			set {
+    				image_align = value;
+    			}
+    		}
+    
+    
+    		[MonoTODO]
+    		public int ImageIndex {
+    			get {
+    				throw new NotImplementedException ();
+    			}
+    			set {
+					//FIXME:
+			}
+    		}
+#if nodef    
+    		[MonoTODO]
+    		public ImageList ImageList {
+    			get {
+    				throw new NotImplementedException ();
+    			}
+    			set {
+					//FIXME:
+    			}
+    		}
+#endif
+    
+    		protected override ImeMode DefaultImeMode {
+    			get {
+    				return ImeMode.Disable;
+    			}
+    		}
+    
+    		public virtual int PreferredHeight {
+    			get {
+    				return preferred_height;
+    			}
+    		}
+    
+    		public virtual int PreferredWidth {
+    			get {
+    				return preferred_width;
+    			}
+    		}
+    
+    		public new bool TabStop {
+    			get {
+    				return tab_stop;
+    			}
+    			set {
+    				tab_stop = value;
+    			}
+    		}
+    
+ 		//Compact Framework
+    		public virtual ContentAlignment TextAlign {
+    			get {
+    				return text_align;
+    			}
+
+    			set {
+    				text_align = value;
+
+				// Calculate vertical alignment
+				if ((value == ContentAlignment.BottomLeft) || (value == ContentAlignment.BottomCenter) || (value == ContentAlignment.BottomRight)) {
+					string_format.LineAlignment=StringAlignment.Far;
+				} else  if ((value == ContentAlignment.TopLeft) || (value == ContentAlignment.TopCenter) || (value == ContentAlignment.TopRight)) {
+					string_format.LineAlignment=StringAlignment.Near;
+				} else {
+					string_format.LineAlignment=StringAlignment.Center;
+				}
+
+				// Calculate horizontal alignment
+				if ((value == ContentAlignment.TopLeft) || (value == ContentAlignment.MiddleLeft) || (value == ContentAlignment.BottomLeft)) {
+					string_format.Alignment=StringAlignment.Near;
+				} else  if ((value == ContentAlignment.TopRight) || (value == ContentAlignment.MiddleRight) || (value == ContentAlignment.BottomRight)) {
+					string_format.LineAlignment=StringAlignment.Far;
+				} else {
+					string_format.LineAlignment=StringAlignment.Center;
+				}
+			}
+    		}
+    
+    		public bool UseMnemonic {
+    			get {
+    				return use_mnemonic;
+    			}
+    			set {
+    				use_mnemonic = value;
+    			}
+    		}
+		
+    		protected override CreateParams CreateParams {
+    			get {
+				CreateParams createParams = base.CreateParams;
+
+				createParams.ClassName = XplatUI.DefaultClassName;
+
+				int bs = 0;
+#if notyet
+				if (border_style == BorderStyle.FixedSingle)
+					bs |= (int) WindowStyles.WS_BORDER;
+				else if (border_style == BorderStyle.Fixed3D)
+					bs |= (int) WindowStyles.WS_BORDER | (int) SS_Static_Control_Types.SS_SUNKEN;
+					
+				createParams.Style = (int) (
+					(int)WindowStyles.WS_CHILD | 
+					(int)WindowStyles.WS_VISIBLE | 
+					(int)SS_Static_Control_Types.SS_LEFT |
+					(int)WindowStyles.WS_CLIPCHILDREN |
+					(int)WindowStyles.WS_CLIPSIBLINGS |
+					(int)SS_Static_Control_Types.SS_OWNERDRAW |
+					bs);
+#else
+				createParams.Style = (int)WindowStyles.WS_CHILD | (int)WindowStyles.WS_VISIBLE |(int)WindowStyles.WS_CLIPCHILDREN | (int)WindowStyles.WS_CLIPSIBLINGS;
+#endif
+
+
+				return createParams;
+    			}
+    		}
+    
+    		protected override Size DefaultSize {
+    			get {
+    				return new Size(100,23);//Correct value
+    			}
+    		}
+    
+			protected virtual bool RenderTransparent {
+				get {
+					return render_transparent;
+				}
+				set {
+					//FIXME:
+				}
+			}
+#if nodef
+    		protected override ImeMode DefaultImeMode {
+    			get {
+				//FIXME:
+				return default_ime_mode;
+    			}
+    		}
+#endif
+    
+#endregion
+
+#region Methods
+
+    		public override string ToString()
+    		{
+			//FIXME: add name of lable, as well as text. would adding base.ToString work?
+    			return "Label: " + base.Text;
+    		}
+
+    		[MonoTODO]
+			protected override void Dispose(bool disposing){
+				base.Dispose(disposing);
+			}
+
+    		[MonoTODO]
+    		protected Rectangle CalcImageRenderBounds (
+    			Image image, Rectangle r, ContentAlignment align)
+    		{
+    			throw new NotImplementedException ();
+    		}
+    
+      		[MonoTODO]
+      		protected  override AccessibleObject CreateAccessibilityInstance()
+      		{
+				//FIXME:
+				return base.CreateAccessibilityInstance();
+      		}
+
+    		[MonoTODO]
+    		protected  void DrawImage (Graphics g, Image image, 
+    					   Rectangle r, ContentAlignment align)
+    		{
+				//FIXME:
+			}
+    
+    		protected virtual void OnAutoSizeChanged (EventArgs e)
+		{
+    			if (AutoSizeChanged != null) AutoSizeChanged (this, e);
+    		}
+    
+    		protected override void OnEnabledChanged (EventArgs e)
+    		{
+				//FIXME:
+				base.OnEnabledChanged (e);
+    		}
+    
+    		protected override void OnFontChanged (EventArgs e)
+    		{
+				//FIXME:
+				base.OnFontChanged (e);
+    		}
+    
+    		protected override void OnPaint (PaintEventArgs e)
+    		{
+				Rectangle paintBounds = ClientRectangle;
+				Bitmap bmp = new Bitmap( paintBounds.Width, paintBounds.Height,e.Graphics);
+				Graphics paintOn = Graphics.FromImage(bmp);
+			
+				Color controlColor = BackColor; //SystemColors.Control;
+				Color textColor = ForeColor; // SystemColors.ControlText;
+				if (BackColor == System.Drawing.Color.Red) {
+					Color t = System.Drawing.Color.Red;
+				}
+			
+				Rectangle rc = paintBounds;
+				Rectangle rcImageClip = paintBounds;
+				rcImageClip.Inflate(-2,-2);
+
+				SolidBrush sb = new SolidBrush( controlColor);
+				paintOn.FillRectangle(sb, rc);
+				sb.Dispose();
+				
+				// Do not place Text and Images on the borders 
+				paintOn.Clip = new Region(rcImageClip);
+				if(Image != null) {
+					int X = rc.X;
+					int Y = rc.Y;
+
+					if( ImageAlign == ContentAlignment.TopCenter ||
+						ImageAlign == ContentAlignment.MiddleCenter ||
+						ImageAlign == ContentAlignment.BottomCenter) {
+						X += (rc.Width - Image.Width) / 2;
+					}
+					else if(ImageAlign == ContentAlignment.TopRight ||
+						ImageAlign == ContentAlignment.MiddleRight||
+						ImageAlign == ContentAlignment.BottomRight) {
+						X += (rc.Width - Image.Width);
+					}
+
+					if( ImageAlign == ContentAlignment.BottomCenter ||
+						ImageAlign == ContentAlignment.BottomLeft ||
+						ImageAlign == ContentAlignment.BottomRight) {
+						Y += rc.Height - Image.Height;
+					}
+					else if(ImageAlign == ContentAlignment.MiddleCenter ||
+							ImageAlign == ContentAlignment.MiddleLeft ||
+							ImageAlign == ContentAlignment.MiddleRight) {
+						Y += (rc.Height - Image.Height) / 2;
+					}
+					paintOn.DrawImage(Image, X, Y, Image.Width, Image.Height);
+				}
+
+				if (Enabled) {
+					SolidBrush  brush;
+
+					brush=new SolidBrush(textColor);
+					paintOn.DrawString(Text, Font, brush, rc, string_format);
+					brush.Dispose();
+				}
+				else {
+					ControlPaint.DrawStringDisabled(paintOn, Text, Font, textColor, rc, string_format);
+				}
+
+				e.Graphics.DrawImage(bmp, 0, 0, paintBounds.Width, paintBounds.Height);
+				paintOn.Dispose ();
+				bmp.Dispose();
+			}
+    
+  			//Compact Framework
+    		protected override void OnParentChanged (EventArgs e)
+    		{
+    			base.OnParentChanged (e);
+    		}
+    
+    		protected virtual void OnTextAlignChanged (EventArgs e) {
+    			if (TextAlignChanged != null) TextAlignChanged (this, e);
+    		}
+    
+ 			//Compact Framework
+    		protected override void OnTextChanged (EventArgs e) {
+				base.OnTextChanged (e);
+				Invalidate ();
+				Refresh ();
+    		}
+    
+    		protected override void OnVisibleChanged (EventArgs e)
+    		{
+    			base.OnVisibleChanged (e);
+    		}
+    
+    		protected override bool ProcessMnemonic(char charCode)
+    		{
+    			return base.ProcessMnemonic (charCode);
+    		}
+    
+//    		[MonoTODO]
+//    		protected new ContentAlignment RtlTranslateAlignment (
+//    			ContentAlignment alignment)
+//    		{
+//    			throw new NotImplementedException ();
+//    		}
+//    
+//    		[MonoTODO]
+//    		protected new HorizontalAlignment RtlTranslateAlignment (
+//    			HorizontalAlignment alignment)
+//    		{
+//    			throw new NotImplementedException ();
+//    		}
+//    		
+//    		[MonoTODO]
+//    		protected new LeftRightAlignment RtlTranslateAlignment (
+//    			LeftRightAlignment align)
+//    		{
+//    			throw new NotImplementedException ();
+//    		}
+//    
+//    		[MonoTODO]
+//    		protected new virtual void Select (bool directed, bool forward)
+//    		{
+//				//FIXME:
+//			}
+
+#if nodef    
+    		protected override void SetBoundsCore (
+    			int x, int y, int width, int height,
+    			BoundsSpecified specified)
+    		{
+    			base.SetBoundsCore (x, y, width, height, specified);
+    		}
+#endif
+    
+//    		protected new void UpdateBounds()
+//    		{
+//    			base.UpdateBounds ();
+//    		}
+//    
+//    		protected new void UpdateBounds (int x, int y,
+//    					     int width, int height)
+//    		{
+//    			base.UpdateBounds (x, y, width, height);
+//    		}
+//    
+//    
+//    		protected new void UpdateBounds (int x, int y, int width,
+//						 int height, int clientWidth,
+//						 int clientHeight)
+//		{
+//    			base.UpdateBounds (x, y, width, height, clientWidth, clientHeight);
+//		}
+
+    		protected override void WndProc(ref Message m)
+    		{
+				switch ((Msg) m.Msg) {
+					case Msg.WM_DRAWITEM: {
+						m.Result = (IntPtr)1;
+					}
+						break;
+					default:
+						base.WndProc (ref m);
+						break;
+				}
+    		}
+#endregion
+
+#region Events
+    		public event EventHandler AutoSizeChanged;
+   
+    		public event EventHandler TextAlignChanged;
+#endregion
+		
+    	}
+    }

+ 62 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/LayoutEventArgs.cs

@@ -0,0 +1,62 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: LayoutEventArgs.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public class LayoutEventArgs : EventArgs {
+		private Control	affected_control;
+		private string	affected_property;
+
+		#region Public Constructors
+		public LayoutEventArgs(Control affectedControl, string affectedProperty) {
+			this.affected_control = affectedControl;
+			this.affected_property = affectedProperty;
+		}
+		#endregion	// Public Constructors
+
+		#region Public Instance Properties
+		public Control AffectedControl {
+			get {
+				return this.affected_control;
+			}
+		}
+
+		public string AffectedProperty {
+			get {
+				return this.affected_property;
+			}
+		}
+		#endregion	// Public Instance Properties
+	}
+}

+ 38 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/LayoutEventHandler.cs

@@ -0,0 +1,38 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: LayoutEventHandler.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public delegate void LayoutEventHandler (object sender, LayoutEventArgs e);
+}

+ 44 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuGlyph.cs

@@ -0,0 +1,44 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: MenuGlyph.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public enum MenuGlyph {
+		Arrow		= 0,
+		Min		= 0,
+		Checkmark	= 1,
+		Bullet		= 2,
+		Max		= 2
+	}
+}

+ 128 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/Message.cs

@@ -0,0 +1,128 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: Message.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+using System; 
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Diagnostics;
+
+namespace System.Windows.Forms {
+	public struct Message {
+		private int	msg;
+		private IntPtr	hwnd;
+		private IntPtr	lParam;
+		private IntPtr	wParam;
+		private IntPtr	result;
+
+		#region Public Instance Properties
+		public IntPtr Hwnd {
+			get { return hwnd; }
+			set { hwnd=value; }
+		}
+
+		public IntPtr LParam {
+			get { return lParam; }
+			set { lParam=value; }
+		}
+
+		public int Msg {
+			get { return msg; }
+			set { msg=value; }
+		}
+
+		public IntPtr Result {
+			get { return result; }
+			set { result=value; }
+		}
+
+		public IntPtr WParam {
+			get { return wParam; }
+			set { wParam=value; }
+		}
+		#endregion	// Public Instance Properties
+
+		#region Public Static Methods
+		public static Message Create(IntPtr hWnd, int msg, IntPtr wparam, IntPtr lparam) {
+			Message new_message = new Message();
+
+			new_message.msg=msg;
+			new_message.hwnd=hWnd;
+			new_message.wParam=wparam;
+			new_message.lParam=lparam;
+			return new_message;
+		}
+		#endregion	// Public Static Methods
+
+		#region Public Instance Methods
+		public override bool Equals(object o) {
+			if (!(o is Message)) {
+				return false;
+			}
+
+			return (this == (Message)o);
+		}
+
+		public static bool operator == (Message msg_a, Message msg_b) {
+			return ((msg_a.msg == msg_b.msg) && 
+				(msg_a.hwnd == msg_b.hwnd) && 
+				(msg_a.lParam == msg_b.lParam) && 
+				(msg_a.wParam == msg_b.wParam) && 
+				(msg_a.result == msg_b.result));
+		}
+
+		public static bool operator != (Message msg_a, Message msg_b) {
+			return ((msg_a.msg != msg_b.msg) || 
+				(msg_a.hwnd != msg_b.hwnd) || 
+				(msg_a.lParam != msg_b.lParam) || 
+				(msg_a.wParam != msg_b.wParam) || 
+				(msg_a.result != msg_b.result));
+		}
+
+		public override int GetHashCode() {
+			return base.GetHashCode();
+		}
+
+		public object GetLParam(Type cls) {
+			object o = Marshal.PtrToStructure(this.lParam, cls);
+			
+			return(o);
+		}
+
+		public override string ToString() {
+			return String.Format("[{0} {1} {2} {3}]", msg.ToString(), lParam.ToString(), wParam.ToString(), hwnd.ToString());
+		}
+		#endregion	// Public Instance Methods
+	}
+}

+ 45 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/MouseButtons.cs

@@ -0,0 +1,45 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: MouseButtons.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public enum MouseButtons {
+		None		= 0x00000000,
+		Left		= 0x00000000,
+		Right		= 0x00000000,
+		Middle		= 0x00000000,
+		XButton1	= 0x00000000,
+		XButton2	= 0x00000000
+	}
+}

+ 86 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/MouseEventArgs.cs

@@ -0,0 +1,86 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: MouseEventArgs.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public class MouseEventArgs {
+		private MouseButtons	buttons;
+		private int		clicks;
+		private int		delta;
+		private int		x;
+		private int		y;
+
+		#region Public Constructors
+		public MouseEventArgs(MouseButtons buttons, int clicks, int x, int y, int delta) {
+			this.buttons=buttons;
+			this.clicks=clicks;
+			this.delta=delta;
+			this.x=x;
+			this.y=y;
+		}
+		#endregion	// Public Constructors
+
+		#region Public Instance Properties
+		public MouseButtons Button {
+			get {
+				return this.buttons;
+			}
+		}
+
+		public int Clicks {
+			get {
+				return this.clicks;
+			}
+		}
+
+		public int Delta {
+			get {
+				return this.delta;
+			}
+		}
+
+		public int X {
+			get {
+				return this.x;
+			}
+		}
+
+		public int Y {
+			get {
+				return this.y;
+			}
+		}
+		#endregion	// Public Instance Properties
+	}
+}

+ 38 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/MouseEventHandler.cs

@@ -0,0 +1,38 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: MouseEventHandler.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public delegate void MouseEventHandler (object sender, MouseEventArgs e);
+}

+ 168 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/NativeWindow.cs

@@ -0,0 +1,168 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: NativeWindow.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+using System.Runtime.Remoting;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
+using System.Collections;
+using System.Diagnostics;
+
+namespace System.Windows.Forms
+{
+	public class NativeWindow : MarshalByRefObject {
+		internal IntPtr			window_handle;
+		static private Hashtable	window_collection = new Hashtable();
+
+		#region Public Constructors
+		public NativeWindow() {
+			window_handle=IntPtr.Zero;
+		}
+		#endregion	// Public Constructors
+
+		#region Public Instance Properties
+		public IntPtr Handle {
+			get {
+				return window_handle;
+			}
+		}
+
+		public bool IsHandleCreated {
+			get {
+				return (window_handle != IntPtr.Zero);
+			}
+		}
+		#endregion	// Public Instance Properties
+
+		#region Public Static Methods
+		public static NativeWindow FromHandle(IntPtr handle) {
+			NativeWindow window=new NativeWindow();
+
+			window.AssignHandle(handle);
+			return window;
+		}
+		#endregion	// Public Static Methods
+
+		#region Public Instance Methods
+		public void AssignHandle(IntPtr handle) {
+			if (window_handle != IntPtr.Zero) {
+				window_collection.Remove(window_handle);
+			}
+			window_handle=handle;
+			window_collection.Add(window_handle, this);
+			OnHandleChange();
+		}
+
+		public virtual void CreateHandle(CreateParams create_params) {
+			if (create_params != null) {
+				window_handle=XplatUI.CreateWindow(create_params);
+
+				if (window_handle != IntPtr.Zero) {
+					window_collection.Add(window_handle, this);
+				}
+			}
+		}
+
+		public void DefWndProc(ref Message m) {
+			m.Result=XplatUI.DefWndProc(ref m);
+		}
+
+		public virtual void DestroyHandle() {
+			window_collection.Remove(window_handle);
+			XplatUI.DestroyWindow(window_handle);
+			window_handle=IntPtr.Zero;
+		}
+
+		public virtual void ReleaseHandle() {
+			window_handle=IntPtr.Zero;
+			OnHandleChange();
+		}
+
+		#endregion	// Public Instance Methods
+
+		#region Protected Instance Methods
+		~NativeWindow() {
+			if (window_handle!=IntPtr.Zero) {
+				DestroyHandle();
+			}
+		}
+
+		protected virtual void OnHandleChange() {
+		}
+
+		protected virtual void OnThreadException(Exception e) {
+			Application.OnThreadException(e);
+		}
+
+		protected virtual void WndProc(ref Message m) {
+#if debug
+			Console.WriteLine("NativeWindow.cs: WndProc(ref Message m) called");
+#endif
+			DefWndProc(ref m);
+		}
+
+		internal static IntPtr WndProc(IntPtr hWnd, Msg msg, IntPtr wParam, IntPtr lParam) {
+			Message		m = new Message();
+			NativeWindow	window = null;
+
+			try {
+				window = (NativeWindow)window_collection[hWnd];
+				m.Hwnd=hWnd;
+				m.Msg=(int)msg;
+				m.WParam=wParam;
+				m.LParam=lParam;
+				m.Result=IntPtr.Zero;
+
+				if (window != null) {
+					window.WndProc(ref m);
+				} else {
+					m.Result=XplatUI.DefWndProc(ref m);
+				}
+			}
+
+			catch(System.Exception ex) {
+				if (window != null) {
+					window.OnThreadException(ex);
+				}
+			}
+
+#if debug
+			Console.WriteLine("NativeWindow.cs: Message {0}, result {1}", msg, m.Result);
+#endif
+
+			return m.Result;
+		}
+		#endregion	// Protected Instance Methods
+	}
+}

+ 84 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/PaintEventArgs.cs

@@ -0,0 +1,84 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: PaintEventArgs.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+using System.Drawing;
+
+namespace System.Windows.Forms {
+	public class PaintEventArgs : EventArgs {
+		private Graphics	graphics;
+		private Rectangle	clip_rectangle;
+
+		#region Public Constructors
+		public PaintEventArgs(System.Drawing.Graphics graphics, System.Drawing.Rectangle clipRect) {
+			this.graphics=graphics;
+			this.clip_rectangle=clipRect;
+		}
+		#endregion	// Public Constructors
+
+		#region Public Instance Properties
+		public Rectangle ClipRectangle {
+			get {
+				return this.clip_rectangle;
+			}
+		}
+
+		public Graphics Graphics {
+			get {
+				return this.graphics;
+			}
+		}
+		#endregion	// Public Instance Properties
+
+		#region Public Instance Methods
+		public void Dispose() {
+			Dispose(true);
+			GC.SuppressFinalize(this);
+		}
+		#endregion	// Public Instance Methods
+
+		#region Protected Instance Methods
+		~PaintEventArgs() {
+			Dispose(false);
+		}
+
+		protected virtual void Dispose(bool disposing) {
+			if (this.graphics!=null) {
+				graphics.Dispose();
+				this.graphics=null;
+			}
+		}
+		#endregion	// Protected Instance Methods
+	}
+}

+ 38 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/PaintEventHandler.cs

@@ -0,0 +1,38 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: PaintEventHandler.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public delegate void PaintEventHandler (object sender, PaintEventArgs e);
+}

+ 288 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ProgressBar.cs

@@ -0,0 +1,288 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (C) 2004 Novell, Inc.
+//
+// Autors:
+//		Jordi Mas i Hernandez	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: ProgressBar.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+using System.Drawing;
+using System.ComponentModel;
+using System.Drawing.Imaging;
+using System.Drawing.Drawing2D;
+
+namespace System.Windows.Forms 
+{
+	/* Scroll bar Theme painter class*/
+	#region ThemePainter support
+	internal class ThemePainter_ProgressBar 
+	{
+		static private Color shadow = Color.FromArgb (255, 172, 168, 153);
+		static private Color light = Color.FromArgb (255, 255, 255, 255);		
+		static private SolidBrush br_shadow = new SolidBrush (shadow);
+		static private SolidBrush br_light = new SolidBrush (light);
+		private static SolidBrush br_main = new SolidBrush (Color.FromArgb (255, 236, 233, 216));
+		private static SolidBrush br_bar = new SolidBrush (Color.FromArgb (255, 49, 106, 197));			
+		private static int space_betweenblocs = 2;
+		
+		/* Draw a progress bar */
+		static public void drawProgressBar (Graphics dc, Rectangle area, 
+			Rectangle client_area, int barpos_pixels, int bloc_width)
+		{	
+			
+			Rectangle rect = new Rectangle (client_area.X, client_area.Y,
+				bloc_width, client_area.Height);	
+				
+			/* Background*/
+			dc.FillRectangle (br_main, area);				
+			
+			/* Draw background*/
+			while ((rect.X - client_area.X) < barpos_pixels) {            		        
+            		        
+                		dc.FillRectangle (br_bar, rect);
+                		rect.X  += rect.Width + space_betweenblocs;
+            		}			
+            		
+            		/* Draw border */
+            		dc.FillRectangle (br_shadow, area.X, area.Y, area.Width, 1);
+            		dc.FillRectangle (br_shadow, area.X, area.Y, 1, area.Height);
+            		dc.FillRectangle (br_light, area.X, area.Y + area.Height - 1, area.Width, 1);
+            		dc.FillRectangle (br_light, area.X + area.Width - 1, area.Y, 1, area.Height);
+		}
+
+	}
+	#endregion	// ThemePainter support
+
+	public sealed class ProgressBar : Control 
+	{	
+		#region Local Variables
+		private int maximum;
+		private int minimum;
+		private int step;
+		private int val;	
+		private Bitmap bmp_mem = null;
+		private Graphics dc_mem = null;				
+		private Rectangle paint_area = new Rectangle ();		
+		private Rectangle client_area = new Rectangle ();
+		#endregion	// Local Variables
+
+		#region Public Constructors
+		public ProgressBar() 
+		{			
+			maximum = 100;
+			minimum = 0;
+			step = 10;
+			val = 0;
+			
+			SetStyle (ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
+			SetStyle (ControlStyles.ResizeRedraw | ControlStyles.Opaque, true);
+		}
+		#endregion	// Public Constructors
+
+		#region Public Instance Properties
+		public int Maximum {
+			get {
+				return maximum;
+			}
+			set {
+				if (value < 0)
+					throw new ArgumentException( 
+						string.Format("Value '{0}' must be greater than or equal to 0.", value ));
+						
+				maximum = value;
+				Invalidate ();		
+			}
+		}
+		
+		public int Minimum {
+			get {
+				return minimum;
+			}
+			set {
+				if (value < 0)
+					throw new ArgumentException( 
+						string.Format("Value '{0}' must be greater than or equal to 0.", value ));
+						
+				minimum = value;
+				Invalidate ();
+			}
+		}
+
+		public int Step {
+			get { 	return step; }
+			set {
+				step = value;
+				Invalidate ();
+			}
+		}		
+		
+		public int Value {
+			get {
+				return val;
+			}
+			set {
+				if (value < Minimum || value > Maximum)
+					throw new ArgumentException(
+						string.Format("'{0}' is not a valid value for 'Value'. 'Value' should be between 'Minimum' and 'Maximum'", value));
+
+				val = value; 
+				Invalidate ();
+			}
+		}
+		#endregion	// Public Instance Properties
+
+		#region Protected Instance Properties
+		protected override CreateParams CreateParams {
+			get {
+				CreateParams createParams = base.CreateParams;
+
+				createParams.ClassName = XplatUI.DefaultClassName;
+
+				createParams.Style = (int) (
+					WindowStyles.WS_CHILD | 
+					WindowStyles.WS_VISIBLE);
+					
+				return createParams;
+			}		
+		}
+
+		protected override ImeMode DefaultImeMode {
+			get {	return ImeMode.Disable;	}
+		}
+
+		protected override Size DefaultSize {
+			get {	return new Size(100, 23); }
+		}
+		#endregion	// Protected Instance Properties
+		
+		#region Public Instance Methods
+		public void Increment (int value) 
+		{
+			int newValue = Value + value;
+			
+			if (newValue < Minimum)
+				newValue = Minimum;
+				
+			if (newValue > Maximum)
+				newValue = Maximum;
+				
+			Value = newValue;
+			Invalidate ();
+		}
+
+		public void PerformStep () {
+			if (Value >= Maximum)
+				return;
+			
+			Value = Value + Step;			
+			Invalidate ();
+		}
+		#endregion	// Public Instance Methods
+
+		private void UpdateAreas ()
+		{
+			paint_area.X = paint_area.Y = 0;
+			paint_area.Width = Width; 
+			paint_area.Height = Height;						
+			
+			client_area.X = client_area.Y = 2;
+			client_area.Width = Width - 4; 
+			client_area.Height = Height - 4;												
+		}
+		
+		protected override void OnResize (EventArgs e) 
+    		{
+    			//Console.WriteLine ("Onresize");
+    			base.OnResize (e);    
+    			
+    			if (Width <= 0 || Height <= 0)
+    				return;
+			
+			UpdateAreas ();
+			
+			/* Area for double buffering */			
+			bmp_mem = new Bitmap (Width, Height, PixelFormat.Format32bppArgb);	
+			dc_mem = Graphics.FromImage (bmp_mem);								
+    		}
+		
+		protected override void OnHandleCreated (EventArgs e) 
+		{			
+			base.OnHandleCreated(e);
+			
+			//Console.WriteLine ("OnHandleCreated");
+			
+			UpdateAreas ();
+			
+			bmp_mem = new Bitmap (Width, Height, PixelFormat.Format32bppArgb);	
+			dc_mem = Graphics.FromImage (bmp_mem);							
+			draw ();
+		}
+		
+		public override string ToString() 
+		{
+			return string.Format ("{0}, Minimum: {1}, Maximum: {2}, Value: {3}", 
+						GetType().FullName.ToString (),
+						Maximum.ToString (),
+						Minimum.ToString (),
+						Value.ToString () );
+		}
+		
+		/* Disable background painting to avoid flickering, since we do our painting*/
+		protected override void OnPaintBackground (PaintEventArgs pevent) 
+    		{
+    			// None
+    		}		
+		
+		private void draw ()
+		{	
+			int bloc_width, barpos_pixels;			
+			int steps = (Maximum - Minimum) / step;			
+			
+			bloc_width = ((client_area.Height) * 2 ) / 3;			
+			barpos_pixels = ((Value - Minimum) * client_area.Width) / (Maximum - Minimum);									
+			
+			//Console.WriteLine ("draw bloc witdh:{0} barpos: {1}", bloc_width, barpos_pixels);
+			//Console.WriteLine ("draw Max {0} Min {1} Value {2}", 
+			//	Maximum, Minimum, Value);
+					
+			ThemePainter_ProgressBar.drawProgressBar (dc_mem, paint_area, client_area, barpos_pixels,
+				bloc_width);
+		}
+		
+				
+		protected override void OnPaint (PaintEventArgs pevent)
+		{	
+			if (Width <= 0 || Height <=  0 || Visible == false)
+    				return;
+										
+			/* Copies memory drawing buffer to screen*/		
+			draw();
+			pevent.Graphics.DrawImage (bmp_mem, 0, 0);			
+		}	
+	}
+}

+ 88 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/QueryAccessibilityHelpEventArgs.cs

@@ -0,0 +1,88 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: QueryAccessibilityHelpEventArgs.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public class QueryAccessibilityHelpEventArgs : EventArgs {
+		private string	help_namespace;
+		private string	help_string;
+		private string	help_keyword;
+
+		#region Public Constructors
+		public QueryAccessibilityHelpEventArgs() {
+			this.help_namespace = null;
+			this.help_string = null;
+			this.help_keyword = null;
+		}
+
+		public QueryAccessibilityHelpEventArgs(string helpNamespace, string helpString, string helpKeyword) {
+			this.help_namespace=helpNamespace;
+			this.help_string=helpString;
+			this.help_keyword=helpKeyword;
+		}
+		#endregion	// Public Constructors
+
+		#region Public Instance Properties
+		public string HelpKeyword {
+			get  {
+				return this.help_keyword;
+			}
+
+			set {
+				this.help_keyword = value;
+			}
+		}
+
+		public string HelpNamespace {
+			get {
+				return this.help_namespace;
+			}
+
+			set {
+				this.help_namespace = value;
+			}
+		}
+
+		public string HelpString {
+			get {
+				return this.help_string;
+			}
+
+			set {
+				this.help_string = value;
+			}
+		}
+		#endregion	// Public Instance Properties
+	}
+}

+ 38 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/QueryAccessibilityHelpEventHandler.cs

@@ -0,0 +1,38 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: QueryAccessibilityHelpEventHandler.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public delegate void QueryAccessibilityHelpEventHandler (object sender, QueryAccessibilityHelpEventArgs e);
+}

+ 74 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/QueryContinueDragEventArgs.cs

@@ -0,0 +1,74 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: QueryContinueDragEventArgs.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public class QueryContinueDragEventArgs : EventArgs {
+		private int		key_state;
+		private bool		escape_pressed;
+		private DragAction	drag_action;
+
+		#region Public Constructors
+		public QueryContinueDragEventArgs(int keyState, bool escapePressed, DragAction action) {
+			this.key_state=keyState;
+			this.escape_pressed=escapePressed;
+			this.drag_action=action;
+		}
+		#endregion	// Public Constructors
+
+		#region Public Instance Properties
+		public DragAction Action {
+			get {
+				return this.drag_action;
+			}
+
+			set {
+				this.drag_action=value;
+			}
+		}
+
+		public bool EscapePressed {
+			get {
+				return this.escape_pressed;
+			}
+		}
+
+		public int KeyState {
+			get {
+				return this.key_state;
+			}
+		}
+		#endregion	// Public Instance Properties
+	}
+}

+ 38 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/QueryContinueDragEventHandler.cs

@@ -0,0 +1,38 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: QueryContinueDragEventHandler.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public delegate void QueryContinueDragEventHandler (object sender, QueryContinueDragEventArgs e);
+}

+ 42 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/RightToLeft.cs

@@ -0,0 +1,42 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: RightToLeft.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public enum RightToLeft {
+		No	= 0,
+		Yes	= 1,
+		Inherit	= 2
+	}
+}

+ 560 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/SWF.csproj

@@ -0,0 +1,560 @@
+<VisualStudioProject>
+    <CSHARP
+        ProjectType = "Local"
+        ProductVersion = "7.10.3077"
+        SchemaVersion = "2.0"
+        ProjectGuid = "{5E6430B2-6B9F-4E76-802E-20207EF80391}"
+    >
+        <Build>
+            <Settings
+                ApplicationIcon = ""
+                AssemblyKeyContainerName = ""
+                AssemblyName = "System.Windows.Forms"
+                AssemblyOriginatorKeyFile = ""
+                DefaultClientScript = "JScript"
+                DefaultHTMLPageLayout = "Grid"
+                DefaultTargetSchema = "IE50"
+                DelaySign = "false"
+                OutputType = "Library"
+                PreBuildEvent = ""
+                PostBuildEvent = ""
+                RootNamespace = "System.Windows.Forms"
+                RunPostBuildEvent = "OnBuildSuccess"
+                StartupObject = ""
+            >
+                <Config
+                    Name = "Debug"
+                    AllowUnsafeBlocks = "false"
+                    BaseAddress = "285212672"
+                    CheckForOverflowUnderflow = "false"
+                    ConfigurationOverrideFile = ""
+                    DefineConstants = ""
+                    DocumentationFile = ""
+                    DebugSymbols = "true"
+                    FileAlignment = "4096"
+                    IncrementalBuild = "false"
+                    NoStdLib = "false"
+                    NoWarn = ""
+                    Optimize = "false"
+                    OutputPath = "bin\Debug\"
+                    RegisterForComInterop = "false"
+                    RemoveIntegerChecks = "false"
+                    TreatWarningsAsErrors = "false"
+                    WarningLevel = "1"
+                />
+                <Config
+                    Name = "Release"
+                    AllowUnsafeBlocks = "false"
+                    BaseAddress = "285212672"
+                    CheckForOverflowUnderflow = "false"
+                    ConfigurationOverrideFile = ""
+                    DefineConstants = ""
+                    DocumentationFile = ""
+                    DebugSymbols = "false"
+                    FileAlignment = "4096"
+                    IncrementalBuild = "false"
+                    NoStdLib = "false"
+                    NoWarn = ""
+                    Optimize = "false"
+                    OutputPath = "bin\Release\"
+                    RegisterForComInterop = "false"
+                    RemoveIntegerChecks = "false"
+                    TreatWarningsAsErrors = "false"
+                    WarningLevel = "1"
+                />
+            </Settings>
+            <References>
+                <Reference
+                    Name = "Accessibility"
+                    AssemblyName = "Accessibility"
+                    HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Accessibility.dll"
+                />
+                <Reference
+                    Name = "System.Drawing"
+                    AssemblyName = "System.Drawing"
+                    HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll"
+                />
+                <Reference
+                    Name = "System"
+                    AssemblyName = "System"
+                    HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
+                />
+            </References>
+        </Build>
+        <Files>
+            <Include>
+                <File
+                    RelPath = "AccessibleObject.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "AccessibleRole.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "AccessibleStates.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "AnchorStyles.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Application.cs"
+                    SubType = "Component"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "ApplicationContext.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "BaseCollection.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Binding.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "BindingContext.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "BindingMemberInfo.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "BindingsCollection.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "BindingsManagerBase.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Border3DSide.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Border3DStyle.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "BorderStyle.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "BoundsSpecified.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "ButtonBorderStyle.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "ButtonState.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "CaptionButton.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "ContainerControl.cs"
+                    SubType = "Component"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Control.cs"
+                    SubType = "Component"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Control.resx"
+                    DependentUpon = "Control.cs"
+                    BuildAction = "EmbeddedResource"
+                />
+                <File
+                    RelPath = "ControlEventArgs.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "ControlEventHandler.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "ControlPaint.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "ControlStyles.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "ConvertEventArgs.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "ConvertEventHandler.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "CreateParams.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "DockStyle.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "DragAction.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "DragDropEffects.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "DragEventArgs.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "DragEventHandler.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "FlatStyle.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Form.cs"
+                    SubType = "Component"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "FrameStyle.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "GiveFeedbackEventArgs.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "GiveFeedbackEventHandler.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "HelpEventArgs.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "HelpEventHandler.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "IContainerControl.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "IDataObject.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "ImeMode.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "IMessageFilter.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "InputLanguage.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "InputLanguageChangedEventArgs.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "InputLanguageChangedEventHandler.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "InputLanguageChangingEventArgs.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "InputLanguageChangingEventHandler.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "InputLanguageCollection.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "InvalidateEventArgs.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "InvalidateEventHandler.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "IWin32Window.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "KeyEventArgs.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "KeyEventHandler.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "KeyPressEventArgs.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "KeyPressEventHandler.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Keys.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Label.cs"
+                    SubType = "Component"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "LayoutEventArgs.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "LayoutEventHandler.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "MenuGlyph.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "Message.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "MouseButtons.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "MouseEventArgs.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "MouseEventHandler.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "NativeWindow.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "PaintEventArgs.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "PaintEventHandler.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "ProgressBar.cs"
+                    SubType = "Component"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "QueryAccessibilityHelpEventArgs.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "QueryAccessibilityHelpEventHandler.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "QueryContinueDragEventArgs.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "QueryContinueDragEventHandler.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "RightToLeft.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "ScrollableControl.cs"
+                    SubType = "Component"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "ScrollableControl.resx"
+                    DependentUpon = "ScrollableControl.cs"
+                    BuildAction = "EmbeddedResource"
+                />
+                <File
+                    RelPath = "ScrollBar.cs"
+                    SubType = "Component"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "ScrollBars.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "ScrollButton.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "ScrollEventArgs.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "ScrollEventHandler.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "ScrollEventType.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "TODOAttribute.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "UICues.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "UICuesEventArgs.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "UICuesEventHandler.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "X11Structs.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "XplatUI.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "XplatUIDriver.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "XplatUIStructs.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "XplatUIWin32.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+                <File
+                    RelPath = "XplatUIX11.cs"
+                    SubType = "Code"
+                    BuildAction = "Compile"
+                />
+            </Include>
+        </Files>
+    </CSHARP>
+</VisualStudioProject>
+

+ 48 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/SWF.csproj.user

@@ -0,0 +1,48 @@
+<VisualStudioProject>
+    <CSHARP LastOpenVersion = "7.10.3077" >
+        <Build>
+            <Settings ReferencePath = "" >
+                <Config
+                    Name = "Debug"
+                    EnableASPDebugging = "false"
+                    EnableASPXDebugging = "false"
+                    EnableUnmanagedDebugging = "false"
+                    EnableSQLServerDebugging = "false"
+                    RemoteDebugEnabled = "false"
+                    RemoteDebugMachine = ""
+                    StartAction = "Project"
+                    StartArguments = ""
+                    StartPage = ""
+                    StartProgram = ""
+                    StartURL = ""
+                    StartWorkingDirectory = ""
+                    StartWithIE = "true"
+                />
+                <Config
+                    Name = "Release"
+                    EnableASPDebugging = "false"
+                    EnableASPXDebugging = "false"
+                    EnableUnmanagedDebugging = "false"
+                    EnableSQLServerDebugging = "false"
+                    RemoteDebugEnabled = "false"
+                    RemoteDebugMachine = ""
+                    StartAction = "Project"
+                    StartArguments = ""
+                    StartPage = ""
+                    StartProgram = ""
+                    StartURL = ""
+                    StartWorkingDirectory = ""
+                    StartWithIE = "false"
+                />
+            </Settings>
+        </Build>
+        <OtherProjectSettings
+            CopyProjectDestinationFolder = ""
+            CopyProjectUncPath = ""
+            CopyProjectOption = "0"
+            ProjectView = "ProjectFiles"
+            ProjectTrust = "0"
+        />
+    </CSHARP>
+</VisualStudioProject>
+

+ 856 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollBar.cs

@@ -0,0 +1,856 @@
+//
+// System.Windows.Forms.ScrollBar.cs
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (C) 2004, Novell, Inc.
+//
+// Authors:
+//	Jordi Mas i Hernandez	[email protected]
+//
+//
+
+// NOT COMPLETE
+
+using System.Drawing;
+using System.Drawing.Imaging;
+using System.Drawing.Drawing2D;
+using System.ComponentModel;
+using System.Runtime.InteropServices;
+using System.Timers;
+
+namespace System.Windows.Forms 
+{	
+	
+	/* Scroll bar Theme painter class*/
+	internal class ThemePainter 
+	{		
+		static private Color light = Color.FromArgb (255, 255, 255, 255);
+		static private Color shadow = Color.FromArgb (255, 172, 168, 153);
+		static private Color disabled = Color.FromArgb (255, 172, 168, 153);
+		static private Color dark = Color.FromArgb (255, 113, 111, 100);
+		static private Color main = Color.FromArgb (255, 236, 233, 216);
+		static private Color lighttop = Color.FromArgb (255, 241, 239, 226);					
+		static private SolidBrush br_lighttop = new SolidBrush (lighttop);
+		static private SolidBrush br_light = new SolidBrush (light);
+		static private SolidBrush br_shadow = new SolidBrush (shadow);
+		static private SolidBrush br_main = new SolidBrush (main);
+		static private SolidBrush br_dark = new SolidBrush (dark);		
+		static private Pen pen_shadow = new Pen (shadow);
+		static private HatchBrush br_backgr = new HatchBrush (HatchStyle.Percent50, light, main);
+		static private Pen pen_arrow = new Pen (Color.Black);
+		static private Pen pen_disabled = new Pen (disabled);
+		static private SolidBrush br_arrow = new SolidBrush (Color.Black);
+		static private SolidBrush br_disabled = new SolidBrush (disabled);		
+		static private int scrollbutton_height = 17;
+		static private int scrollbutton_width = 17;
+		
+		static public int ScrollButtonHeight {
+			get { return scrollbutton_height; }			
+		}
+		
+		static public int ScrollButtonWidth {
+			get { return scrollbutton_width; }			
+		}
+		
+		/* Generic button */
+		static public void drawButton (Graphics dc, Rectangle area, ButtonState state)
+		{			
+			if ((state & ButtonState.Pushed) == ButtonState.Pushed) {
+								
+				dc.FillRectangle (br_main, area.X + 1, 
+					area.Y + 1, area.Width - 2 , area.Height - 2);					
+				
+				dc.DrawRectangle (pen_shadow, area.X, 
+					area.Y, area.Width, area.Height);					
+			}
+			
+			if (state == ButtonState.Normal) {
+			
+				dc.FillRectangle (br_lighttop, area.X, area.Y, area.Width, 1);
+				dc.FillRectangle (br_light, area.X, area.Y + 1, area.Width - 1, 1);
+				dc.FillRectangle (br_light, area.X, area.Y + 2, 1,
+					area.Height - 2 - 1);
+				
+				dc.FillRectangle (br_shadow, area.X, area.Y + area.Height - 1, 
+					area.Width - 1, 1);
+									
+				dc.FillRectangle (br_dark, area.X, area.Y + area.Height, 
+					area.Width, 1);
+					
+				dc.FillRectangle (br_shadow, area.X + area.Width - 1, 
+					area.Y + 1, 1, area.Height);
+					
+				dc.FillRectangle (br_dark, area.X + area.Width, 
+					area.Y, 1, area.Height);
+				
+				dc.FillRectangle (br_main, area.X + 1, 
+					area.Y + 2, area.Width - 2, area.Height - 3);					
+			}
+		}		
+		
+		/* Scroll button: regular button + direction arrow */		
+		static public void drawScrollButton (Graphics dc, Rectangle area, ScrollButton type, ButtonState state, bool enabled)
+		{
+			drawButton (dc, area, state);
+			
+			/* Paint arrows */	
+			switch (type) {
+			case ScrollButton.Up:
+			{			
+				int x = area.X +  (area.Width / 2) - 4;
+				int y = area.Y + 9;
+				
+				for (int i = 0; i < 3; i++)
+					if (enabled)
+						dc.DrawLine (pen_arrow, x + i, y - i, x + i + 6 - 2*i, y - i);	
+					else
+						dc.DrawLine (pen_disabled, x + i, y - i, x + i + 6 - 2*i, y - i);	
+					
+				if (enabled)
+					dc.FillRectangle (br_arrow, x + 3, area.Y + 6, 1, 1);					
+				else
+					dc.FillRectangle (br_disabled, x + 3, area.Y + 6, 1, 1);					
+					
+				break;
+			}
+			case ScrollButton.Down:
+			{			
+				int x = area.X +  (area.Width / 2) - 4;
+				int y = area.Y + 5;
+				
+				for (int i = 4; i != 0; i--)
+					if (enabled)
+						dc.DrawLine (pen_arrow, x + i, y + i, x + i + 8 - 2*i, y + i);	
+					else
+						dc.DrawLine (pen_disabled, x + i, y + i, x + i + 8 - 2*i, y + i);						
+					
+				if (enabled)
+					dc.FillRectangle (br_arrow, x + 4, y + 4, 1, 1);					
+				else					
+					dc.FillRectangle (br_disabled, x + 4, y + 4, 1, 1);					
+					
+				break;
+			}			
+			
+			case ScrollButton.Left:
+			{			
+				int y = area.Y +  (area.Height / 2) - 4;
+				int x = area.X + 9;
+				
+				for (int i = 0; i < 3; i++)
+					if (enabled)
+						dc.DrawLine (pen_arrow, x - i, y + i, x - i, y + i + 6 - 2*i);	
+					else
+						dc.DrawLine (pen_disabled, x - i, y + i, x - i, y + i + 6 - 2*i);	
+					
+				if (enabled)
+					dc.FillRectangle (br_arrow, x - 3, y + 3, 1, 1);					
+				else
+					dc.FillRectangle (br_disabled, x - 3, y + 3, 1, 1);					
+					
+				break;
+			}
+			
+			case ScrollButton.Right:
+			{			
+				int y = area.Y +  (area.Height / 2) - 4;
+				int x = area.X + 5;
+				
+				for (int i = 4; i != 0; i--)
+					if (enabled)
+						dc.DrawLine (pen_arrow, x + i, y + i, x + i, y + i + 8 - 2*i);	
+					else
+						dc.DrawLine (pen_disabled, x + i, y + i, x + i, y + i + 8 - 2*i);	
+					
+				if (enabled)
+					dc.FillRectangle (br_arrow, x + 4, y + 4, 1, 1);					
+				else
+					dc.FillRectangle (br_disabled, x + 3, y + 3, 1, 1);
+					
+				break;
+			}
+			
+			default:
+				break;
+			
+			}
+		}	
+		
+		/* Paint a complete ScrollBar and all its components */
+		static  public void drawScrollBar (Graphics dc, Rectangle area, Rectangle thumb_pos,
+			ref Rectangle first_arrow_area, ref Rectangle second_arrow_area,
+			ButtonState first_arrow, ButtonState second_arrow,
+			bool enabled, bool vertical)
+		{			
+			//Console.WriteLine ("ThumPos: " + thumb_pos);
+			
+			if (vertical) {
+				scrollbutton_width = area.Width;
+				
+				first_arrow_area.X = first_arrow_area. Y = 0;
+				first_arrow_area.Width = scrollbutton_width;
+				first_arrow_area.Height = scrollbutton_height;				
+				
+				second_arrow_area.X = 0;
+				second_arrow_area.Y = area.Height - scrollbutton_height;
+				second_arrow_area.Width = scrollbutton_width;
+				second_arrow_area.Height = scrollbutton_height;				
+				
+				/* Buttons */
+				drawScrollButton (dc, first_arrow_area, ScrollButton.Up, first_arrow, enabled);
+				drawScrollButton (dc, second_arrow_area, ScrollButton.Down, second_arrow, enabled);		
+				
+				/* Background */
+				dc.FillRectangle (br_backgr, 0,  scrollbutton_height, area.Width, 
+					area.Height - (scrollbutton_height * 2));			
+
+			}
+			else {
+				
+				scrollbutton_height = area.Height;
+				first_arrow_area.X = first_arrow_area. Y = 0;
+				first_arrow_area.Width = scrollbutton_width;
+				first_arrow_area.Height = scrollbutton_height;
+				
+				second_arrow_area.Y = 0;
+				second_arrow_area.X = area.Width - scrollbutton_width;
+				second_arrow_area.Width = scrollbutton_width;
+				second_arrow_area.Height = scrollbutton_height;
+				
+				
+				/* Buttons */
+				drawScrollButton (dc, first_arrow_area, ScrollButton.Left, first_arrow, enabled);
+				drawScrollButton (dc, second_arrow_area, ScrollButton.Right, second_arrow, enabled);		
+								
+				/* Background */
+				dc.FillRectangle (br_backgr, scrollbutton_width, 0, area.Width - (scrollbutton_width * 2),
+				 	area.Height);			
+			}			
+				
+			/* Thumbail */	
+			if (enabled)
+				drawButton (dc, thumb_pos, ButtonState.Normal);					
+		}		
+	}
+	
+	public class ScrollBar : Control 
+	{		
+		#region Local Variables
+		private int position;
+		private int minimum;
+		private int maximum;		
+		private int largeChange;
+		private int smallChange;
+		private int scrollbutton_height;
+		private int scrollbutton_width;	          	    
+		private Rectangle paint_area = new Rectangle ();
+		private ScrollBars type;
+		private Bitmap bmp_mem = null;
+		private Graphics dc_mem = null;				
+		private Rectangle first_arrow_area = new Rectangle ();		// up or left
+		private Rectangle second_arrow_area = new Rectangle ();		// down or right		
+		private Rectangle thumb_pos = new Rectangle ();		
+		private Rectangle thumb_area = new Rectangle ();		
+		private ButtonState firstbutton_state = ButtonState.Normal;
+		private ButtonState secondbutton_state = ButtonState.Normal;
+		private bool thumb_pressed = false;
+		private float pixel_per_pos = 0;
+		private System.Timers.Timer firstclick_timer = new System.Timers.Timer ();
+		private System.Timers.Timer holdclick_timer = new System.Timers.Timer ();
+		private int thumb_pixel_click_move;			
+		private int thumb_size = 0;		
+		protected bool vert;
+				
+		public event ScrollEventHandler scroll_event;
+		public event EventHandler valueChanged_event;				
+		#endregion	// Local Variables
+				
+		public void add_Scroll (System.Windows.Forms.ScrollEventHandler value) 
+		{
+			scroll_event = value;	
+		}
+
+		public ScrollBar() : base()
+		{				
+			position = 0;
+			minimum = 0;
+			maximum = 100;
+			largeChange = 10;
+			smallChange = 1;			
+//			base.TabStop = false;
+//			RightToLeft = RightToLeft.No;
+			scroll_event = null;
+			valueChanged_event = null;			
+						
+			SetStyle (ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
+			SetStyle (ControlStyles.ResizeRedraw | ControlStyles.Opaque, true);
+		}
+
+		[EditorBrowsable (EditorBrowsableState.Never)]	 
+		public override Color BackColor 
+		{
+			get { return base.BackColor; }
+			set { base.BackColor = value;}
+		}
+
+		[EditorBrowsable (EditorBrowsableState.Never)]	 
+		[MonoTODO]
+		public override Image BackgroundImage 
+		{
+			get {
+				throw new NotImplementedException();	
+			}
+			set { 
+				throw new NotImplementedException();
+			}
+		}
+
+		[EditorBrowsable (EditorBrowsableState.Never)]	 
+		public override Color ForeColor 
+		{
+			get { return base.ForeColor; }
+			set { base.ForeColor = value; }
+		}
+
+		[EditorBrowsable (EditorBrowsableState.Never)]	 
+		[MonoTODO]
+		public new ImeMode ImeMode 
+		{
+			get { return ImeMode.Disable;
+throw new NotImplementedException(); }
+			set { throw new NotImplementedException(); }
+		}
+
+		
+		public int LargeChange {
+			get { return largeChange; }
+			set {
+				if (value < 0)
+					throw new Exception( string.Format("Value '{0}' must be greater than or equal to 0.", value));
+
+				if (largeChange != value) {
+					largeChange = value;	
+					Invalidate ();
+				}
+			}
+		}
+		
+		public int Maximum {
+			get { return maximum; }
+			set {
+				maximum = value;
+
+				if (maximum < minimum)
+					minimum = maximum;
+			}
+		}
+		
+		public int Minimum {
+			get { return minimum; }
+			set {
+				minimum = value;
+
+				if (minimum > maximum)
+					maximum = minimum;		
+			}
+		}
+		
+		public int SmallChange {
+			get { return smallChange; }
+			set {
+				if ( value < 0 )
+					throw new Exception( string.Format("Value '{0}' must be greater than or equal to 0.", value));
+				 
+				if (smallChange != value) {
+					smallChange = value;	
+					Invalidate ();
+				}
+			}
+		}
+
+		[EditorBrowsable (EditorBrowsableState.Never)]	 
+		public override string Text {
+			 get { return base.Text;  }
+			 set { base.Text = value; }
+		 }
+
+		
+		public int Value {
+			get { return position; }
+			set {
+				if ( value < Minimum || value > Maximum )
+					throw new ArgumentException(
+						string.Format("'{0}' is not a valid value for 'Value'. 'Value' should be between 'Minimum' and 'Maximum'", value));
+
+				if (position != value){
+					position = value;
+					
+					if (valueChanged_event != null)
+						valueChanged_event (this, EventArgs.Empty);
+				}
+			}
+		}
+
+		public override string ToString()
+		{	
+			return string.Format("{0}, Minimum: {1}, Maximum: {2}, Value: {3}",
+						GetType( ).FullName.ToString( ), Minimum, Maximum, position);
+		}
+		
+		protected override CreateParams CreateParams {
+			get {				
+				CreateParams createParams = base.CreateParams;				
+				createParams.ClassName = XplatUI.DefaultClassName;
+				createParams.Style = (int) (
+						WindowStyles.WS_CHILD | 
+						WindowStyles.WS_VISIBLE);
+				return createParams;
+			}
+		}
+
+		protected override ImeMode DefaultImeMode {
+			get { return ImeMode.Disable; }
+		}
+		
+		
+		private void fire_scroll_event (ScrollEventArgs event_args)
+		{
+			if (scroll_event == null)
+				return;
+				
+			scroll_event (this, event_args);					
+			
+			//if (event_args.NewValue != position)
+			//	UpdatePos (event_args.NewValue, true);
+		}
+		
+		protected virtual void OnValueChanged (EventArgs e)
+		{					
+			if (valueChanged_event != null) {
+				Console.Write ("OnValueChanged");
+				valueChanged_event (this, e);
+			}
+		}
+
+		
+		private void draw()
+		{					
+			ThemePainter.drawScrollBar (dc_mem, paint_area, thumb_pos,
+				ref first_arrow_area, ref second_arrow_area,
+				firstbutton_state, secondbutton_state, Enabled,	vert);										
+			
+			scrollbutton_height = ThemePainter.ScrollButtonHeight;
+			scrollbutton_width = ThemePainter.ScrollButtonWidth;			
+		}
+				
+		private void CalcThumbArea ()
+		{	
+			// Thumb area
+			
+			if (vert) {
+				
+				if (Height < scrollbutton_height * 2)
+					thumb_size = 0;
+				else
+					if (Height < 70)
+						thumb_size = 8;
+					else
+						thumb_size = Height /10;
+					
+				thumb_area.X = 0;
+				thumb_area.Y = scrollbutton_height;
+				thumb_area.Width = Width;
+				thumb_area.Height = Height - scrollbutton_height -  scrollbutton_height;			
+				pixel_per_pos = ((float)(thumb_area.Height - thumb_size) / (float) ((Maximum - Minimum - LargeChange) + 1));									
+				
+			} else	{
+				
+				if (Width < scrollbutton_width * 2)
+					thumb_size = 0;
+				else
+					if (Width < 70)
+						thumb_size = 8;
+					else
+						thumb_size = Width /10;
+				
+				thumb_area.Y = 0;
+				thumb_area.X = scrollbutton_width;
+				thumb_area.Height = Height;
+				thumb_area.Width = Width - scrollbutton_width -  scrollbutton_width;			
+				pixel_per_pos = ((float)(thumb_area.Width - thumb_size) / (float) ((Maximum - Minimum - LargeChange) + 1));			
+			}
+			
+			//Console.WriteLine ("thumb_area:" + thumb_area);
+			//Console.WriteLine ("Maximum {0} Minimum {1} " , Maximum, Minimum);						
+		}
+		
+    		protected override void OnResize (EventArgs e) 
+    		{
+    			base.OnResize (e);    
+    			
+    			if (Width <= 0 || Height <= 0)
+    				return;
+			
+			paint_area.X = paint_area. Y = 0;
+			paint_area.Width = Width; 
+			paint_area.Height = Height;						
+			
+			/* Area for double buffering */
+			
+			bmp_mem = new Bitmap (Width, Height, PixelFormat.Format32bppArgb);	
+			dc_mem = Graphics.FromImage (bmp_mem);				
+			
+			CalcThumbArea ();
+			UpdatePos (position, true);
+    		}
+    		
+
+		/*
+			Called when the control is created
+		*/		
+		protected override void CreateHandle()
+		{	
+			Console.WriteLine ("CreateHandle()");			
+			
+			base.CreateHandle();	// Let control.cs create the underlying Window							
+			
+			scrollbutton_height = ThemePainter.ScrollButtonHeight;
+			scrollbutton_width = ThemePainter.ScrollButtonWidth;
+						
+			/* Area for double buffering */
+			bmp_mem = new Bitmap (Width, Height, PixelFormat.Format32bppArgb);	
+			dc_mem = Graphics.FromImage (bmp_mem);				
+			
+			//Console.WriteLine ("OnCreate: Width " + Width + " Height " +  Height);
+			CalcThumbArea ();
+			UpdatePos (Value, true);
+			draw();					
+			
+		}
+		
+		protected override void OnPaint (PaintEventArgs pevent)
+		{	
+			if (Width <= 0 || Height <=  0 || Visible == false)
+    				return;
+										
+			/* Copies memory drawing buffer to screen*/		
+			draw();
+			pevent.Graphics.DrawImage (bmp_mem, 0, 0);			
+		}	
+		
+		/* Disable background painting to avoid flickering, since we do our painting*/
+		protected override void OnPaintBackground (PaintEventArgs pevent) 
+    		{
+    			// None
+    		}		
+		
+    		protected override void OnClick (EventArgs e)
+    		{
+    			Console.WriteLine ("On click");    			
+    		}
+    		
+    		private void UpdatePos (int newPos, bool update_trumbpos)
+    		{    	
+    			int old = position;
+    					
+    			if (newPos < minimum)
+    				position = minimum;
+    			else
+    				if (newPos > maximum)
+    					position = maximum;    			
+    					else
+    						position = newPos;  						    			    			    						
+    						
+    			//Console.WriteLine ("event : {0} {1} {2}", scroll_event != null, position, old);    			
+    			
+			if (update_trumbpos) 
+				if (vert)
+					UpdateThumbPos (thumb_area.Y + (int)(((float)(position - Minimum)) * pixel_per_pos), false);							    			
+				else
+					UpdateThumbPos (thumb_area.X + (int)(((float)(position - Minimum)) * pixel_per_pos), false);							    			
+					
+			if (position != old) // Fire event
+				fire_scroll_event (new ScrollEventArgs (ScrollEventType.ThumbTrack, position));
+			
+    		}	
+    		
+    		private void UpdateThumbPos (int pixel, bool update_value)
+    		{    			    			    			
+    			float new_pos = 0;
+    			
+    			if (vert) {
+	    			if (pixel < thumb_area.Y)
+	    				thumb_pos.Y = thumb_area.Y;
+	    			else
+	    				if (pixel > thumb_area.Y + thumb_area.Height - thumb_size)
+	    					thumb_pos.Y = thumb_area.Y +  thumb_area.Height - thumb_size;    			
+	    				else
+	    					thumb_pos.Y = pixel;		 
+				
+				thumb_pos = new Rectangle (0, thumb_pos.Y, Width, thumb_size);								
+				new_pos = (float) (thumb_pos.Y - thumb_area.Y);
+				new_pos = new_pos / pixel_per_pos;
+			} else	{
+				
+				if (pixel < thumb_area.X)
+	    				thumb_pos.X = thumb_area.X;
+	    			else
+	    				if (pixel > thumb_area.X + thumb_area.Width - thumb_size)
+	    					thumb_pos.X = thumb_area.X +  thumb_area.Width - thumb_size;    			
+	    				else
+	    					thumb_pos.X = pixel;		 
+				
+				thumb_pos = new Rectangle (thumb_pos.X, 0, thumb_size, Height);								
+				new_pos = (float) (thumb_pos.X - thumb_area.X);
+				new_pos = new_pos / pixel_per_pos;
+			}
+			
+			//Console.WriteLine ("UpdateThumbPos: thumb_pos.Y {0} thumb_area.Y {1} pixel_per_pos {2}, new pos {3}, pixel {4}",
+			//	thumb_pos.Y, thumb_area.Y, pixel_per_pos, new_pos, pixel);
+			
+			if (update_value) 				
+				UpdatePos ((int) new_pos, false);						
+    		}
+    		
+    		private void OnHoldClickTimer (Object source, ElapsedEventArgs e)
+		{			
+			if ((firstbutton_state & ButtonState.Pushed) == ButtonState.Pushed)								
+				SmallDecrement();
+				
+			if ((secondbutton_state & ButtonState.Pushed) == ButtonState.Pushed)				
+				SmallIncrement();
+				
+			Invalidate ();
+		}
+    		
+    		private void OnFirstClickTimer (Object source, ElapsedEventArgs e)
+		{
+			//Console.WriteLine ("OnFirstClickTimer");
+			firstclick_timer.Enabled = false;			
+			holdclick_timer.Elapsed += new ElapsedEventHandler (OnHoldClickTimer);
+		        holdclick_timer.Interval = 50;
+		        holdclick_timer.Enabled = true;		        
+		}			
+		
+    		protected override void OnMouseMove (MouseEventArgs e) 
+    		{    			
+    			if (!first_arrow_area.Contains (new Point (e.X, e.Y)) && 
+    				((firstbutton_state & ButtonState.Pushed) == ButtonState.Pushed)) {				    				
+				firstbutton_state = ButtonState.Normal;				
+				Invalidate ();
+			}			
+			
+			if (!second_arrow_area.Contains (new Point (e.X, e.Y)) && 
+    				((secondbutton_state & ButtonState.Pushed) == ButtonState.Pushed)) {				    				
+				secondbutton_state = ButtonState.Normal;				
+				Invalidate ();
+			}			
+			
+			if (thumb_pos.Contains (new Point (e.X, e.Y)) && thumb_pressed) {				    				
+    				
+    				int pixel_pos;
+    				
+    				if (vert)
+    				 	pixel_pos = e.Y - (thumb_pixel_click_move - thumb_pos.Y);
+    				else
+    				 	pixel_pos = e.X - (thumb_pixel_click_move - thumb_pos.X);
+    				
+    				UpdateThumbPos (pixel_pos, true);
+    				
+    				if (vert)
+    					thumb_pixel_click_move = e.Y;    				
+    				else
+    					thumb_pixel_click_move = e.X;    				
+
+				//System.Console.WriteLine ("OnMouseMove thumb "+ e.Y 
+				//	+ " clickpos " + thumb_pixel_click_move   + " pos:" + thumb_pos.Y);    								
+					
+				Invalidate ();
+			}						
+			
+			if (!thumb_pos.Contains (new Point (e.X, e.Y)) && thumb_pressed) {				
+    				thumb_pressed = false;				
+				Invalidate ();
+			}
+			
+    		}	    		
+    		
+    		protected override void OnMouseDown (MouseEventArgs e) 
+    		{
+    			//System.Console.WriteLine ("OnMouseDown");    			
+    			
+    			Point point = new Point (e.X, e.Y);
+    			
+    			if (first_arrow_area.Contains (point)) {				
+				firstbutton_state = ButtonState.Pushed;
+				Invalidate ();
+			}
+			
+			if (second_arrow_area.Contains (point)) {
+				secondbutton_state = ButtonState.Pushed;				
+				Invalidate ();
+			}
+			
+			if (thumb_pos.Contains (point)) {								
+				thumb_pressed = true;				
+				Invalidate ();
+				if (vert)
+					thumb_pixel_click_move = e.Y;
+				else
+					thumb_pixel_click_move = e.X;
+			}			
+			else
+				if (thumb_area.Contains (point)) {								
+					
+					if (vert) {					
+						if (e.Y > thumb_pos.Y + thumb_pos.Height)
+							LargeIncrement();
+						else
+							LargeDecrement();
+					} else 	{
+						if (e.X > thumb_pos.X + thumb_pos.Width)
+							LargeIncrement();
+						else
+							LargeDecrement();
+					}				
+						
+					Invalidate ();
+				}			
+			
+			
+			/* If arrows are pressed, lunch timer for auto-repeat */
+			if ((((firstbutton_state & ButtonState.Pushed) == ButtonState.Pushed)
+			|| ((secondbutton_state & ButtonState.Pushed) == ButtonState.Pushed)) && 
+				firstclick_timer.Enabled == false) {			
+				//Console.WriteLine ("Activate Timer");
+				firstclick_timer.Elapsed += new ElapsedEventHandler (OnFirstClickTimer);
+		        	firstclick_timer.Interval = 400;
+		        	firstclick_timer.Enabled = true;
+		        	firstclick_timer.AutoReset = false;		        	
+			}  			
+    		}
+    		
+    		private void SmallIncrement()
+    		{
+			if (vert)
+				UpdateThumbPos (thumb_pos.Y + SmallChange, true);
+			else
+				UpdateThumbPos (thumb_pos.X + SmallChange, true);
+				
+			fire_scroll_event (new ScrollEventArgs (ScrollEventType.SmallIncrement, position));
+			fire_scroll_event (new ScrollEventArgs (ScrollEventType.EndScroll, position));
+    		}
+    		
+    		private void SmallDecrement()
+    		{
+			if (vert)
+				UpdateThumbPos (thumb_pos.Y - SmallChange, true);
+			else
+				UpdateThumbPos (thumb_pos.X - SmallChange, true);		
+				
+			fire_scroll_event (new ScrollEventArgs (ScrollEventType.SmallDecrement, position));
+			fire_scroll_event (new ScrollEventArgs (ScrollEventType.EndScroll, position));
+    		}
+    		
+    		private void LargeIncrement()
+    		{
+			if (vert)
+				UpdateThumbPos (thumb_pos.Y + LargeChange, true);
+			else
+				UpdateThumbPos (thumb_pos.X + LargeChange, true);
+				
+			fire_scroll_event (new ScrollEventArgs (ScrollEventType.LargeIncrement, position));
+			fire_scroll_event (new ScrollEventArgs (ScrollEventType.EndScroll, position));
+    		}
+    		
+    		private void LargeDecrement()
+    		{
+			if (vert)
+				UpdateThumbPos (thumb_pos.Y - LargeChange, true);
+			else
+				UpdateThumbPos (thumb_pos.X - LargeChange, true);		
+				
+			fire_scroll_event (new ScrollEventArgs (ScrollEventType.LargeDecrement, position));
+			fire_scroll_event (new ScrollEventArgs (ScrollEventType.EndScroll, position));
+    		}
+    		protected override void OnMouseUp (MouseEventArgs e) 
+    		{
+    			//System.Console.WriteLine ("OnMouseUp");
+    			
+    			if (first_arrow_area.Contains (new Point (e.X, e.Y))) {				
+    				
+				firstbutton_state = ButtonState.Normal;												
+				SmallDecrement ();				
+				Invalidate ();
+				holdclick_timer.Enabled = false;
+			}
+			
+			if (second_arrow_area.Contains (new Point (e.X, e.Y))) {				
+				
+				secondbutton_state = ButtonState.Normal;						
+				SmallIncrement ();	
+				Invalidate ();
+				holdclick_timer.Enabled = false;
+			}
+			
+			if (thumb_pos.Contains (new Point (e.X, e.Y))) {																
+				
+				fire_scroll_event (new ScrollEventArgs (ScrollEventType.ThumbPosition, position));
+				fire_scroll_event (new ScrollEventArgs (ScrollEventType.EndScroll, position));
+				
+				thumb_pressed = false;				
+				Invalidate ();
+			}
+    		}
+    		
+    		//TODO: Untested
+    		protected override void OnKeyDown (KeyEventArgs key)
+		{
+			switch (key.KeyCode){
+			case Keys.Up:
+			{
+				SmallDecrement();					
+				break;	
+			}
+			case Keys.Down:
+			{
+				SmallIncrement();					
+				break;	
+			}
+			case Keys.PageUp:
+			{
+				LargeDecrement();					
+				break;	
+			}
+			case Keys.PageDown:
+			{
+				LargeIncrement();					
+				break;	
+			}
+			default:
+				break;
+			}
+
+		}    		
+	 }
+}
+
+

+ 43 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollBars.cs

@@ -0,0 +1,43 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: ScrollBars.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public enum ScrollBars {
+		None		= 0,
+		Horizontal	= 1,
+		Vertical	= 2,
+		Both		= 3
+	}
+}

+ 45 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollButton.cs

@@ -0,0 +1,45 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: ScrollButton.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public enum ScrollButton {
+		Min	= 0,
+		Up	= 0,
+		Down	= 1,
+		Left	= 2,
+		Right	= 3,
+		Max	= 3
+	}
+}

+ 68 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollEventArgs.cs

@@ -0,0 +1,68 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: ScrollEventArgs.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public class ScrollEventArgs {
+		#region Local Variables
+		private ScrollEventType	type;
+		private int		new_value;
+		#endregion
+
+		#region Public Constructors
+		public ScrollEventArgs(ScrollEventType type, int newValue) {
+			this.type = type;
+			this.new_value = newValue;
+		}
+		#endregion	// Public Constructors
+
+		#region Public Instance Properties
+		public int NewValue {
+			get {
+				return new_value;
+			}
+
+			set {
+				new_value = value;
+			}
+		}
+
+		public ScrollEventType Type {
+			get {
+				return type;
+			}
+		}
+		#endregion	// Public Instance Properties
+	}
+}

+ 38 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollEventHandler.cs

@@ -0,0 +1,38 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: ScrollEventHandler.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public delegate void ScrollEventHandler(object sender, ScrollEventArgs e);
+}

+ 48 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollEventType.cs

@@ -0,0 +1,48 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: ScrollEventType.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public enum ScrollEventType {
+		SmallDecrement	= 0,
+		SmallIncrement	= 1,
+		LargeDecrement	= 2,
+		LargeIncrement	= 3,
+		ThumbPosition	= 4,
+		ThumbTrack	= 5,
+		First		= 6,
+		Last		= 7,
+		EndScroll	= 8
+	}
+}

+ 306 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs

@@ -0,0 +1,306 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: ScrollableControl.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// NOT COMPLETE
+
+using System;
+using System.ComponentModel;
+using System.Drawing;
+
+namespace System.Windows.Forms {
+	public class ScrollableControl : Control {
+		#region Public Constructors
+		public ScrollableControl() {
+		}
+		#endregion	// Public Constructors
+
+		#region Protected Static Fields
+		protected const int ScrollStateAutoScrolling = 1;
+		protected const int ScrollStateFullDrag = 16;
+		protected const int ScrollStateHScrollVisible = 2;
+		protected const int ScrollStateUserHasScrolled = 8;
+		protected const int ScrollStateVScrollVisible= 4;
+		#endregion	// Protected Static Fields
+
+		#region Subclass DockPaddingEdges
+		public class DockPaddingEdges : ICloneable {
+			// Local Variables;
+			private int all;
+			private int left;
+			private int right;
+			private int top;
+			private int bottom;
+
+			// Public Instance Properties
+			public int All {
+				get {
+					return all;
+				}
+
+				set {
+					all=value;
+				}
+			}
+
+			public int Bottom {
+				get {
+					return bottom;
+				}
+
+				set {
+					bottom=value;
+				}
+			}
+
+			public int Left {
+				get {
+					return left;
+				}
+
+				set {
+					left=value;
+				}
+			}
+
+			public int Right {
+				get {
+					return right;
+				}
+
+				set {
+					right=value;
+				}
+			}
+
+			public int Top {
+				get {
+					return top;
+				}
+
+				set {
+					top=value;
+				}
+			}
+
+			public static bool operator == (DockPaddingEdges obj_a, DockPaddingEdges obj_b) {
+				if (	(obj_a.all == obj_b.all) && (obj_a.left == obj_b.left) &&
+					(obj_a.right == obj_b.right) && (obj_a.top == obj_b.top) && 
+					(obj_a.bottom == obj_b.bottom)) {
+						return true;
+				}
+
+				return false;
+			}
+
+			public static bool operator != (DockPaddingEdges obj_a, DockPaddingEdges obj_b) {
+				return !(obj_a==obj_b);
+			}
+
+			// Public Instance Methods
+			public override bool Equals(object other) {
+				if (! (other is DockPaddingEdges)) {
+					return false;
+				}
+
+				return (this==(DockPaddingEdges)other);
+			}
+
+			public override int GetHashCode() {
+				return all*top*bottom*right*left;
+			}
+
+			public override string ToString() {
+				return "All = "+all.ToString()+" Top = "+top.ToString()+" Left = "+left.ToString()+" Bottom = "+bottom.ToString()+" Right = "+right.ToString();
+			}
+
+			object ICloneable.Clone() {
+				DockPaddingEdges padding_edge;
+
+				padding_edge=new DockPaddingEdges();
+
+				padding_edge.all=all;
+				padding_edge.left=left;
+				padding_edge.right=right;
+				padding_edge.top=top;
+				padding_edge.bottom=bottom;
+
+				return padding_edge;
+			}
+		}
+		#endregion
+
+		#region Subclass DockPaddingEdgesConverter
+		public class DockPaddingEdgesConverter : System.ComponentModel.TypeConverter {
+			// Public Constructors
+			public DockPaddingEdgesConverter() {
+			}
+
+			// Public Instance Methods
+			public override PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, Attribute[] attributes) {
+				throw new NotImplementedException();
+			}
+
+			public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) {
+				throw new NotImplementedException();
+			}
+		}
+		#endregion
+
+		#region Public Instance Properties
+		public virtual bool AutoScroll {
+			get {
+				throw new NotImplementedException();
+			}
+
+			set {
+				throw new NotImplementedException();
+			}
+		}
+
+		public Size AutoScrollMargin {
+			get {
+				throw new NotImplementedException();
+			}
+
+			set {
+				throw new NotImplementedException();
+			}
+		}
+
+		public Size AutoScrollMinSize {
+			get {
+				throw new NotImplementedException();
+			}
+
+			set {
+				throw new NotImplementedException();
+			}
+		}
+
+		public Point AutoScrollPosition {
+			get {
+				throw new NotImplementedException();
+			}
+
+			set {
+				throw new NotImplementedException();
+			}
+		}
+
+		public override Rectangle DisplayRectangle {
+			get {
+				throw new NotImplementedException();
+			}
+		}
+
+		public DockPaddingEdges DockPadding {
+			get {
+				throw new NotImplementedException();
+			}
+		}
+		#endregion	// Public Instance Properties
+
+		#region Protected Instance Methods
+		protected override CreateParams CreateParams {
+			get {
+				return base.CreateParams;
+			}
+		}
+
+		protected bool HScroll {
+			get {
+				throw new NotImplementedException();
+			}
+
+			set {
+				throw new NotImplementedException();
+			}
+		}
+
+		protected bool VScroll {
+			get {
+				throw new NotImplementedException();
+			}
+
+			set {
+				throw new NotImplementedException();
+			}
+		}
+		#endregion	// Protected Instance Methods
+
+		#region Public Instance Methods
+		public void ScrollControlIntoView(Control activeControl) {
+		}
+
+		public void SetAutoScrollMargin(int x, int y) {
+		}
+		#endregion	// Public Instance Methods
+
+		#region Protected Instance Methods
+		protected virtual void AdjustFormScrollbars(bool displayScrollbars) {
+		}
+
+		protected bool GetScrollState(int bit) {
+			throw new NotImplementedException();
+		}
+
+		protected override void OnLayout(LayoutEventArgs levent) {
+			throw new NotImplementedException();
+		}
+
+		protected override void OnMouseWheel(MouseEventArgs e) {
+			throw new NotImplementedException();
+		}
+
+		protected override void OnVisibleChanged(EventArgs e) {
+			throw new NotImplementedException();
+		}
+
+		protected override void ScaleCore(float dx, float dy) {
+			throw new NotImplementedException();
+		}
+
+		protected void SetDisplayRectLocation(int x, int y) {
+			throw new NotImplementedException();
+		}
+
+		protected void SetScrollState(int bit, bool value) {
+			throw new NotImplementedException();
+		}
+
+		protected override void WndProc(ref Message m) {
+			base.WndProc(ref m);
+		}
+		#endregion	// Protected Instance Methods
+	}
+}

+ 4 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/TODO

@@ -0,0 +1,4 @@
+Things that need to be done:
+
+X11 Driver
+- 

+ 54 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/TODOAttribute.cs

@@ -0,0 +1,54 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Ravi Pratap	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: TODOAttribute.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System {
+	[AttributeUsage (AttributeTargets.All)]
+	internal class MonoTODOAttribute : Attribute {
+		string comment;
+
+		public MonoTODOAttribute() {
+		}
+
+		public MonoTODOAttribute(string comment) {
+			this.comment = comment;
+		}
+
+		public string Comment {
+			get {
+				return comment;
+			}
+		}
+	}
+}

+ 46 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/UICues.cs

@@ -0,0 +1,46 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: UICues.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public enum UICues {
+		None		= 0x00000000,
+		ShowFocus	= 0x00000001,
+		ShowKeyboard	= 0x00000002,
+		Shown		= 0x00000003,
+		ChangeFocus	= 0x00000004,
+		ChangeKeyboard	= 0x00000008,
+		Changed		= 0x0000000C
+	}
+}

+ 94 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/UICuesEventArgs.cs

@@ -0,0 +1,94 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: UICuesEventArgs.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public class UICuesEventArgs : EventArgs {
+		private UICues	cues;
+
+		#region Public Constructors
+		public UICuesEventArgs(UICues uicues) {
+			this.cues = uicues;
+		}
+		#endregion
+
+		#region Public Instance Properties
+		public UICues Changed {
+			get {
+				return (cues & UICues.Changed);
+			}
+		}
+
+		public bool ChangeFocus {
+			get {
+				if ((cues & UICues.ChangeFocus)==0) {
+					return false;
+				} else {
+					return true;
+				}
+			}
+		}
+
+		public bool ChangeKeyboard {
+			get {
+				if ((cues & UICues.ChangeKeyboard)==0) {
+					return false;
+				} else {
+					return true;
+				}
+			}
+		}
+
+		public bool ShowFocus {
+			get {
+				if ((cues & UICues.ShowFocus)==0) {
+					return false;
+				} else {
+					return true;
+				}
+			}
+		}
+
+		public bool ShowKeyboard {
+			get {
+				if ((cues & UICues.ShowKeyboard)==0) {
+					return false;
+				} else {
+					return true;
+				}
+			}
+		}
+		#endregion	// Public Instance Properties
+	}
+}

+ 38 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/UICuesEventHandler.cs

@@ -0,0 +1,38 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: UICuesEventHandler.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// COMPLETE
+
+namespace System.Windows.Forms {
+	public delegate void UICuesEventHandler (Object Sender, UICuesEventArgs e);
+}

+ 630 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Structs.cs

@@ -0,0 +1,630 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2004 Novell, Inc.
+//
+// Authors:
+//	Peter Bartok	[email protected]
+//
+//
+// $Revision: 1.1 $
+// $Modtime: $
+// $Log: X11Structs.cs,v $
+// Revision 1.1  2004/07/09 05:21:25  pbartok
+// - Initial check-in
+//
+//
+
+// NOT COMPLETE
+
+using System;
+using System.ComponentModel;
+using System.Collections;
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+
+/// X11 Version
+namespace System.Windows.Forms {
+	#region X11 Structures
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XAnyEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		window;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XKeyEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		window;
+		internal IntPtr		root;
+		internal IntPtr		subwindow;
+		internal int		time;
+		internal int		x;
+		internal int		y;
+		internal int		x_root;
+		internal int		y_root;
+		internal int		state;
+		internal int		keycode;
+		internal bool		same_screen;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XButtonEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		window;
+		internal IntPtr		root;
+		internal IntPtr		subwindow;
+		internal int		time;
+		internal int		x;
+		internal int		y;
+		internal int		x_root;
+		internal int		y_root;
+		internal int		state;
+		internal int		button;
+		internal bool		same_screen;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XMotionEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		window;
+		internal IntPtr		root;
+		internal IntPtr		subwindow;
+		internal int		time;
+		internal int		x;
+		internal int		y;
+		internal int		x_root;
+		internal int		y_root;
+		internal int		state;
+		internal byte		is_hint;
+		internal bool		same_screen;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XCrossingEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		window;
+		internal IntPtr		root;
+		internal IntPtr		subwindow;
+		internal int		time;
+		internal int		x;
+		internal int		y;
+		internal int		x_root;
+		internal int		y_root;
+		internal int		mode;
+		internal int		detail;
+		internal bool		same_screen;
+		internal bool		focus;
+		internal int		state;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XFocusChangeEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		window;
+		internal int		mode;
+		internal int		detail;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XKeymapEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		window;
+		internal byte		key_vector0;
+		internal byte		key_vector1;
+		internal byte		key_vector2;
+		internal byte		key_vector3;
+		internal byte		key_vector4;
+		internal byte		key_vector5;
+		internal byte		key_vector6;
+		internal byte		key_vector7;
+		internal byte		key_vector8;
+		internal byte		key_vector9;
+		internal byte		key_vector10;
+		internal byte		key_vector11;
+		internal byte		key_vector12;
+		internal byte		key_vector13;
+		internal byte		key_vector14;
+		internal byte		key_vector15;
+		internal byte		key_vector16;
+		internal byte		key_vector17;
+		internal byte		key_vector18;
+		internal byte		key_vector19;
+		internal byte		key_vector20;
+		internal byte		key_vector21;
+		internal byte		key_vector22;
+		internal byte		key_vector23;
+		internal byte		key_vector24;
+		internal byte		key_vector25;
+		internal byte		key_vector26;
+		internal byte		key_vector27;
+		internal byte		key_vector28;
+		internal byte		key_vector29;
+		internal byte		key_vector30;
+		internal byte		key_vector31;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XExposeEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		window;
+		internal int		x;
+		internal int		y;
+		internal int		width;
+		internal int		height;
+		internal int		count;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XGraphicsExposeEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		drawable;
+		internal int		x;
+		internal int		y;
+		internal int		width;
+		internal int		height;
+		internal int		count;
+		internal int		major_code;
+		internal int		minor_code;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XNoExposeEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		drawable;
+		internal int		major_code;
+		internal int		minor_code;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XVisibilityEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		window;
+		internal int		state;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XCreateWindowEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		parent;
+		internal IntPtr		window;
+		internal int		x;
+		internal int		y;
+		internal int		width;
+		internal int		height;
+		internal int		border_width;
+		internal bool		override_redirect;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XDestroyWindowEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		xevent;
+		internal IntPtr		window;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XUnmapEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		xevent;
+		internal IntPtr		window;
+		internal bool		from_configure;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XMapEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		xevent;
+		internal IntPtr		window;
+		internal bool		override_redirect;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XMapRequestEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		parent;
+		internal IntPtr		window;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XReparentEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		xevent;
+		internal IntPtr		window;
+		internal IntPtr		parent;
+		internal int		x;
+		internal int		y;
+		internal bool		override_redirect;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XConfigureEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		xevent;
+		internal IntPtr		window;
+		internal int		x;
+		internal int		y;
+		internal int		width;
+		internal int		height;
+		internal int		border_width;
+		internal IntPtr		above;
+		internal bool		override_redirect;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XGravityEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		xevent;
+		internal IntPtr		window;
+		internal int		x;
+		internal int		y;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XResizeRequestEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		window;
+		internal int		width;
+		internal int		height;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XConfigureRequestEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		window;
+		internal int		width;
+		internal int		height;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XCirculateEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		xevent;
+		internal IntPtr		window;
+		internal int		place;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XCirculateRequestEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		parent;
+		internal IntPtr		window;
+		internal int		place;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XPropertyEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		window;
+		internal IntPtr		atom;
+		internal int		time;
+		internal int		state;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XSelectionClearEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		window;
+		internal IntPtr		selection;
+		internal int		time;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XSelectionRequestEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		owner;
+		internal IntPtr		requestor;
+		internal IntPtr		selection;
+		internal IntPtr		target;
+		internal IntPtr		property;
+		internal int		time;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XSelectionEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		requestor;
+		internal IntPtr		selection;
+		internal IntPtr		target;
+		internal IntPtr		property;
+		internal int		time;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XColormapEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		window;
+		internal IntPtr		colormap;
+		internal bool		c_new;
+		internal int		state;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XClientMessageEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		window;
+		internal IntPtr		message_type;
+		internal int		format;
+		internal int		l0;
+		internal int		l1;
+		internal int		l2;
+		internal int		l3;
+		internal int		l4;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XMappingEvent {
+		internal XEventName	type;
+		internal int		serial;
+		internal bool		send_event;
+		internal IntPtr		display;
+		internal IntPtr		window;
+		internal int		request;
+		internal int		first_keycode;
+		internal int		count;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XErrorEvent {
+		internal XEventName	type;
+		internal IntPtr		display;
+		internal IntPtr		resourceid;
+		internal int		serial;
+		internal byte		error_code;
+		internal byte		request_code;
+		internal byte		minor_code;
+	}
+
+	[StructLayout(LayoutKind.Sequential, Pack=4)]
+	internal struct XEventPad {
+		internal int pad0;
+		internal int pad1;
+		internal int pad2;
+		internal int pad3;
+		internal int pad4;
+		internal int pad5;
+		internal int pad6;
+		internal int pad7;
+		internal int pad8;
+		internal int pad9;
+		internal int pad10;
+		internal int pad11;
+		internal int pad12;
+		internal int pad13;
+		internal int pad14;
+		internal int pad15;
+		internal int pad16;
+		internal int pad17;
+		internal int pad18;
+		internal int pad19;
+		internal int pad20;
+		internal int pad21;
+		internal int pad22;
+		internal int pad23;
+	}
+
+	[StructLayout(LayoutKind.Explicit)]
+	internal struct XEvent {
+		[ FieldOffset(0) ] internal XEventName type;
+		[ FieldOffset(0) ] internal XAnyEvent AnyEvent;
+		[ FieldOffset(0) ] internal XKeyEvent KeyEvent;
+		[ FieldOffset(0) ] internal XButtonEvent ButtonEvent;
+		[ FieldOffset(0) ] internal XMotionEvent MotionEvent;
+		[ FieldOffset(0) ] internal XCrossingEvent CrossingEvent;
+		[ FieldOffset(0) ] internal XFocusChangeEvent FocusChangeEvent;
+		[ FieldOffset(0) ] internal XExposeEvent ExposeEvent;
+		[ FieldOffset(0) ] internal XGraphicsExposeEvent GraphicsExposeEvent;
+		[ FieldOffset(0) ] internal XNoExposeEvent NoExposeEvent;
+		[ FieldOffset(0) ] internal XVisibilityEvent VisibilityEvent;
+		[ FieldOffset(0) ] internal XCreateWindowEvent CreateWindowEvent;
+		[ FieldOffset(0) ] internal XDestroyWindowEvent DestroyWindowEvent;
+		[ FieldOffset(0) ] internal XUnmapEvent UnmapEvent;
+		[ FieldOffset(0) ] internal XMapEvent MapEvent;
+		[ FieldOffset(0) ] internal XMapRequestEvent MapRequestEvent;
+		[ FieldOffset(0) ] internal XReparentEvent ReparentEvent;
+		[ FieldOffset(0) ] internal XConfigureEvent ConfigureEvent;
+		[ FieldOffset(0) ] internal XGravityEvent GravityEvent;
+		[ FieldOffset(0) ] internal XResizeRequestEvent ResizeRequestEvent;
+		[ FieldOffset(0) ] internal XConfigureRequestEvent ConfigureRequestEvent;
+		[ FieldOffset(0) ] internal XCirculateEvent CirculateEvent;
+		[ FieldOffset(0) ] internal XCirculateRequestEvent CirculateRequestEvent;
+		[ FieldOffset(0) ] internal XPropertyEvent PropertyEvent;
+		[ FieldOffset(0) ] internal XSelectionClearEvent SelectionClearEvent;
+		[ FieldOffset(0) ] internal XSelectionRequestEvent SelectionRequestEvent;
+		[ FieldOffset(0) ] internal XSelectionEvent SelectionEvent;
+		[ FieldOffset(0) ] internal XColormapEvent ColormapEvent;
+		[ FieldOffset(0) ] internal XClientMessageEvent ClientMessageEvent;
+		[ FieldOffset(0) ] internal XMappingEvent MappingEvent;
+		[ FieldOffset(0) ] internal XErrorEvent ErrorEvent;
+		[ FieldOffset(0) ] internal XKeymapEvent KeymapEvent;
+
+		//[MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=24)]
+		//[ FieldOffset(0) ] internal int[] pad;
+		[ FieldOffset(0) ] internal XEventPad Pad;
+	} 
+	#endregion
+
+	#region X11 Enumerations
+	internal enum XWindowClass {
+		InputOutput	= 1,
+		InputOnly	= 2
+	}
+
+	internal enum XEventName {
+		KeyPress                = 2,
+		KeyRelease              = 3,
+		ButtonPress             = 4,
+		ButtonRelease           = 5,
+		MotionNotify            = 6,
+		EnterNotify             = 7,
+		LeaveNotify             = 8,
+		FocusIn                 = 9,
+		FocusOut                = 10,
+		KeymapNotify            = 11,
+		Expose                  = 12,
+		GraphicsExpose          = 13,
+		NoExpose                = 14,
+		VisibilityNotify        = 15,
+		CreateNotify            = 16,
+		DestroyNotify           = 17,
+		UnmapNotify             = 18,
+		MapNotify               = 19,
+		MapRequest              = 20,
+		ReparentNotify          = 21,
+		ConfigureNotify         = 22,
+		ConfigureRequest        = 23,
+		GravityNotify           = 24,
+		ResizeRequest           = 25,
+		CirculateNotify         = 26,
+		CirculateRequest        = 27,
+		PropertyNotify          = 28,
+		SelectionClear          = 29,
+		SelectionRequest        = 30,
+		SelectionNotify         = 31,
+		ColormapNotify          = 32,
+		ClientMessage           = 33,
+		MappingNotify           = 34,
+		LASTEvent               = 35
+	}
+
+	internal enum XWindowAttribute {
+		CWBackPixmap	= 1,
+		CWBackPixel	= 2,
+		CWBorderPixmap	= 4,
+		CWBorderPixel	= 8,
+		CWBitGravity	= 16,
+		CWWinGravity	= 32,
+		CWBackingStore	= 64,
+		CWBackingPlanes	= 128,
+		CWBackingPixel	= 256,
+		CWOverrideRedirect = 512,
+		CWSaveUnder	= 1024,
+		CWEventMask	= 2048,
+		CWDontPropagate	= 4096,
+		CWColorMap	= 8192,
+		CWCursor	= 16384
+	}
+
+	internal enum XKeySym {
+		XK_Shift_L	= 0xFFE1,
+		XK_Shift_R	= 0xFFE2,
+		XK_Control_L	= 0xFFE3,
+		XK_Control_R	= 0xFFE4,
+		XK_Caps_Lock	= 0xFFE5,
+		XK_Shift_Lock	= 0xFFE6,
+
+		XK_Meta_L	= 0xFFE7,
+		XK_Meta_R	= 0xFFE8,
+		XK_Alt_L	= 0xFFE9,
+		XK_Alt_R	= 0xFFEA,
+		XK_Super_L	= 0xFFEB,
+		XK_Super_R	= 0xFFEC,
+		XK_Hyper_L	= 0xFFED,
+		XK_Hyper_R	= 0xFFEE,
+	}
+	#endregion
+}
+

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.