Kaynağa Gözat

2002-9-24 John Sohn <[email protected]>
* Application.cs: Run method now creates the Form
* ContainerControl.cs: no implementation but made sure overridden
methods call the base class
* Control.cs: Implemented several more methods in the implementation
of this class. Implemented ControlCollection, allowing controls
to be added and removed from the Form.
* Form.cs: Implemented more methods of the Form class
* FormTest.cs: Added code to draw and display a Label
* Label.cs: Initial implementation of Label class. The Label can
be added and displayed on a Form.
* NativeWindow.cs: modified debugging (console) output
* ScrollableControl.cs: no implementation but made sure overridden
methods call the base class
* Win32.cs: added more Win32 imports and definitions
* monostub.c: now store the application HINSTANCE
* makefile: added Label.cs to makefile

svn path=/trunk/mcs/; revision=7758

John Sohn 23 yıl önce
ebeveyn
işleme
7ef9bfb6a3

+ 3 - 1
mcs/class/System.Windows.Forms/System.Windows.Forms/Application.cs

@@ -218,7 +218,9 @@ namespace System.Windows.Forms {
 		// Documents say this parameter name should be mainform, 
 		// but the verifier says context.
 		{
-			ApplicationContext context = new ApplicationContext (form);
+			form.CreateControl ();
+			ApplicationContext context = new ApplicationContext (
+				form);
 			Run (context);
 		}
 		

+ 8 - 11
mcs/class/System.Windows.Forms/System.Windows.Forms/ContainerControl.cs

@@ -38,9 +38,8 @@ namespace System.Windows.Forms {
 		//	set { throw new NotImplementedException (); }
 		//}
 		
-		[MonoTODO]
 		protected override CreateParams CreateParams {
-			get { throw new NotImplementedException (); }
+			get { return base.CreateParams; }
 		}
 		
 		[MonoTODO]
@@ -51,10 +50,11 @@ namespace System.Windows.Forms {
 		/// --- Methods ---
 		/// internal .NET framework supporting methods, not stubbed out:
 		/// - protected virtual void UpdateDefaultButton()
-		[MonoTODO]
-		protected override void AdjustFormScrollbars (bool displayScrollbars) 
+
+		protected override void AdjustFormScrollbars (
+			bool displayScrollbars) 
 		{
-			throw new NotImplementedException ();
+			base.AdjustFormScrollbars (displayScrollbars);
 		}
 		
 		[MonoTODO]
@@ -71,16 +71,14 @@ namespace System.Windows.Forms {
 		//}
 		
 		// [event methods]
-		[MonoTODO]
 		protected override void OnControlRemoved (ControlEventArgs e) 
 		{
-			throw new NotImplementedException ();
+			base.OnControlRemoved (e);
 		}
 		
-		[MonoTODO]
-		protected override void OnCreateControl () 
+		protected override void OnCreateControl ()
 		{
-			throw new NotImplementedException ();
+			base.OnCreateControl ();
 		}
 		// end of [event methods]
 		
@@ -120,7 +118,6 @@ namespace System.Windows.Forms {
 			throw new NotImplementedException ();
 		}
 		
-		[MonoTODO]
 		protected override void WndProc(ref Message m) 
 		{
 			base.WndProc(ref m);

Dosya farkı çok büyük olduğundan ihmal edildi
+ 317 - 261
mcs/class/System.Windows.Forms/System.Windows.Forms/Control.cs


+ 34 - 49
mcs/class/System.Windows.Forms/System.Windows.Forms/Form.cs

@@ -76,23 +76,21 @@ namespace System.Windows.Forms {
 			}
 		}
 
-		[MonoTODO]
 		public override bool AutoScroll {
 			get {
-				throw new NotImplementedException ();
+				return base.AutoScroll;
 			}
 			set {
-				throw new NotImplementedException ();
+				base.AutoScroll = value;
 			}
 		}
 
-		[MonoTODO]
 		public override Color BackColor {
 			get {
-				throw new NotImplementedException ();
+				return base.BackColor;
 			}
 			set {
-				throw new NotImplementedException ();
+				base.BackColor = value;
 			}
 		}
 
@@ -412,7 +410,7 @@ namespace System.Windows.Forms {
 		//  --- Public Methods
 		public void Activate ()
 		{
-			Win32.SetActiveWindow (window.Handle);
+			Win32.SetActiveWindow (Handle);
 		}
 
 		[MonoTODO]
@@ -423,7 +421,7 @@ namespace System.Windows.Forms {
 
 		public void Close ()
 		{
-			Win32.CloseWindow (window.Handle);
+			Win32.CloseWindow (Handle);
 		}
 
 		//inherited
@@ -504,7 +502,7 @@ namespace System.Windows.Forms {
 
 		public void SetDesktopLocation (int x, int y)
 		{
-			Win32.SetWindowPos ((IntPtr) window.Handle, (IntPtr) 0, 
+			Win32.SetWindowPos ((IntPtr) Handle, (IntPtr) 0, 
 					    x, y, 0, 0, 
 					    (int) (Win32.SWP_NOSIZE | 
 					    Win32.SWP_NOZORDER));
@@ -512,7 +510,7 @@ namespace System.Windows.Forms {
 
 		public new void Show ()
 		{
-			Win32.ShowWindow (window.Handle, (int) Win32.SW_SHOW);
+			Win32.ShowWindow (Handle, (int) Win32.SW_SHOW);
 		}
 
 		[MonoTODO]
@@ -561,7 +559,6 @@ namespace System.Windows.Forms {
 // 			}
 // 		}
 
-		[MonoTODO]
 		public event InputLanguageChangingEventHandler InputLanguageChanging; // {
 // 			add {
 // 				throw new NotImplementedException ();
@@ -571,7 +568,6 @@ namespace System.Windows.Forms {
 // 			}
 // 		}
 
-		[MonoTODO]
 		public event EventHandler  Load; // {
 // 			add {
 // 				throw new NotImplementedException ();
@@ -581,7 +577,6 @@ namespace System.Windows.Forms {
 // 			}
 // 		}
 
-		[MonoTODO]
 		public event EventHandler  MaximizedBoundsChanged; // {
 // 			add {
 // 				throw new NotImplementedException ();
@@ -591,7 +586,6 @@ namespace System.Windows.Forms {
 // 			}
 // 		}
 
-		[MonoTODO]
 		public event EventHandler MaximumSizeChanged; // {
 // 			add {
 // 				throw new NotImplementedException ();
@@ -601,7 +595,6 @@ namespace System.Windows.Forms {
 // 			}
 // 		}
 
-		[MonoTODO]
 		public event EventHandler  MdiChildActivate; // {
 // 			add {
 // 				throw new NotImplementedException ();
@@ -611,7 +604,6 @@ namespace System.Windows.Forms {
 // 			}
 // 		}
 
-		[MonoTODO]
 		public event EventHandler  MenuComplete; // {
 // 			add {
 // 				throw new NotImplementedException ();
@@ -621,7 +613,6 @@ namespace System.Windows.Forms {
 // 			}
 // 		}
 
-		[MonoTODO]
 		public event EventHandler  MenuStart; // {
 // 			add {
 // 				throw new NotImplementedException ();
@@ -631,7 +622,6 @@ namespace System.Windows.Forms {
 // 			}
 // 		}
 
-		[MonoTODO]
 		public event EventHandler  MinimumSizedChanged; // {
 // 			add {
 // 				throw new NotImplementedException ();
@@ -644,17 +634,15 @@ namespace System.Windows.Forms {
 		
 		//  --- Protected Properties
 		
-		[MonoTODO]
 		protected override CreateParams CreateParams {
 			get {
 				return base.CreateParams;
 			}
 		}
 
-		[MonoTODO]
 		protected override ImeMode DefaultImeMode {
 			get {
-				throw new NotImplementedException ();
+				return base.DefaultImeMode;
 			}
 		}
 
@@ -676,21 +664,22 @@ namespace System.Windows.Forms {
 		
 		//  --- Protected Methods
 		
-		[MonoTODO]
 		protected override void AdjustFormScrollbars (bool displayScrollbars)
 		{
-			throw new NotImplementedException ();
+			base.AdjustFormScrollbars (displayScrollbars);
 		}
 
-		//[MonoTODO]
-		//protected override ControlCollection CreateControlsInstance()
-		//{
-		//		throw new NotImplementedException ();
-		//}
+		protected override Control.ControlCollection CreateControlsInstance ()
+		{
+			return base.CreateControlsInstance ();
+		}
 
 		protected override void CreateHandle ()
 		{
 			base.CreateHandle ();
+
+			if (IsHandleCreated)
+				OnHandleCreated (new EventArgs());
 		}
 
 		protected override void DefWndProc (ref Message m)
@@ -718,21 +707,23 @@ namespace System.Windows.Forms {
 
 		protected override void OnCreateControl ()
 		{
-			
+			base.OnCreateControl ();
 		}
 
 		protected override void OnFontChanged (EventArgs e)
 		{
-
+			base.OnFontChanged (e);
 		}
 
 		protected override void OnHandleCreated (EventArgs e)
 		{
-
+			Console.WriteLine ("OnHandleCreated");
+			base.OnHandleCreated (e);
 		}
 
 		protected override void OnHandleDestroyed (EventArgs e)
 		{
+			base.OnHandleDestroyed (e);
 		}
 
 		protected virtual void OnInputLanguageChanged (InputLanguageChangedEventArgs e)
@@ -795,7 +786,7 @@ namespace System.Windows.Forms {
 
 		protected override void  OnResize (EventArgs e)
 		{
-
+			base.OnResize (e);
 		}
 
 		protected override void  OnStyleChanged (EventArgs e)
@@ -963,24 +954,22 @@ namespace System.Windows.Forms {
 		// </summary>
 		// TODO: implement support classes and derive from 
 		// proper classes
-		public /*new(remove error)*/ class  ControlCollection /*: System.Windows.Forms.Control.ControlCollection, ICollection*/ {
+		// FIXME: use this or the one defined on Control?
+		public class  ControlCollectionX : System.Windows.Forms.Control.ControlCollection /*,ICollection*/ {
 
 			//  --- Constructor
-			[MonoTODO]
 			// base class not defined (yet!)
-			public ControlCollection (Form owner) /*: base(owner)*/ {
-				throw new NotImplementedException ();
+			public ControlCollectionX (Form owner) : base(owner) {
+
 			}
 		
 			//  --- Public Methods
 
-			[MonoTODO]
 			// TODO: see what causes this compile error
-			//public override void Add(Control value) {
-			//	throw new NotImplementedException ();
-			//}
+			public override void Add(Control value) {
+				base.Add (value);
+			}
 
-			[MonoTODO]
 			public override bool Equals (object o) {
 				throw new NotImplementedException ();
 			}
@@ -989,22 +978,18 @@ namespace System.Windows.Forms {
 			//	throw new NotImplementedException ();
 			//}
 
-			[MonoTODO]
 			public override int GetHashCode () {
 				//FIXME add our proprities
 				return base.GetHashCode ();
 			}
 
-			// Inherited
 			//public override int GetChildIndex(Control c) {
-			//	throw new NotImplementedException ();
+				//return base.GetChildIndex (c);
 			//}
 
-			//[MonoTODO]
-			// Control not yet usuable due to dependencies
-			//public override void Remove(Control value) {
-			//	throw new NotImplementedException ();
-			//}
+			public override void Remove(Control value) {
+				base.Remove (value);
+			}
 		} // end of Subclass
 	}
 }

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

@@ -0,0 +1,319 @@
+//
+// 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])
+// (C) 2002 Ximian, Inc
+//
+
+namespace System.Windows.Forms {
+	using System.Drawing;
+
+	// <summary>
+	//
+	// </summary>
+	
+	public class Label : Control {
+	
+		public Label () : base ()
+		{
+
+		}
+		
+		[MonoTODO]
+		public virtual bool AutoSize {
+			get {
+				throw new NotImplementedException ();
+			}
+			set {
+				throw new NotImplementedException ();
+			}
+		}
+
+		[MonoTODO]
+		public FlatStyle FlatStyle {
+			get {
+				throw new NotImplementedException ();
+			}
+			set {
+				throw new NotImplementedException ();
+			}
+		}
+
+		[MonoTODO]
+		public Image Image {
+			get {
+				throw new NotImplementedException ();
+			}
+			set {
+				throw new NotImplementedException ();
+			}
+		}
+
+		[MonoTODO]
+		public ContentAlignment ImageAlign {
+			get {
+				throw new NotImplementedException ();
+			}
+			set {
+				throw new NotImplementedException ();
+			}
+		}
+
+		[MonoTODO]
+		public int ImageIndex {
+			get {
+				throw new NotImplementedException ();
+			}
+			set {
+				throw new NotImplementedException ();
+			}
+		}
+
+		[MonoTODO]
+		public ImageList ImageList {
+			get {
+				throw new NotImplementedException ();
+			}
+			set {
+				throw new NotImplementedException ();
+			}
+		}
+		[MonoTODO]
+		public new ImeMode ImeMode {
+			get {
+				throw new NotImplementedException ();
+			}
+			set {
+				throw new NotImplementedException ();
+			}
+		}
+
+		[MonoTODO]
+		public int PreferredHeight {
+			get {
+				throw new NotImplementedException ();
+			}
+		}
+
+		[MonoTODO]
+		public int PreferredWidth {
+			get {
+				throw new NotImplementedException ();
+			}
+		}
+
+		[MonoTODO]
+		public new bool TabStop {
+			get {
+				throw new NotImplementedException ();
+			}
+			set {
+				throw new NotImplementedException ();
+			}
+		}
+
+		[MonoTODO]
+		//virtual
+		public ContentAlignment TextAlign {
+			get {
+				throw new NotImplementedException ();
+			}
+			set {
+				throw new NotImplementedException ();
+			}
+		}
+
+		[MonoTODO]
+		public bool UseMnemonic {
+			get {
+				throw new NotImplementedException ();
+			}
+			set {
+				throw new NotImplementedException ();
+			}
+		}
+
+		//
+		//  --- Public Methods
+		//
+		[MonoTODO]
+		public override bool Equals(object o)
+		{
+			throw new NotImplementedException ();
+		}
+		//public static bool Equals(object o1, object o2)
+		//{
+		//	throw new NotImplementedException ();
+		//}
+		[MonoTODO]
+		public override int GetHashCode() {
+			//FIXME add our proprities
+			return base.GetHashCode();
+		}
+		//public void Select()
+		//{
+		//	throw new NotImplementedException ();
+		//}
+		[MonoTODO]
+		public override string ToString()
+		{
+			throw new NotImplementedException ();
+		}
+
+		//
+		//  --- Public Events
+		// 
+		public event EventHandler AutoSizeChanged; // {
+// 			add {
+// 				throw new NotImplementedException ();
+// 			}
+// 			remove {
+// 				throw new NotImplementedException ();
+// 			}
+// 		}
+
+		public event EventHandler TextAlignChanged; // {
+// 			add {
+// 				throw new NotImplementedException ();
+// 			}
+// 			remove {
+// 				throw new NotImplementedException ();
+// 			}
+// 		}
+
+		//
+		//  --- Protected Methods
+		//
+		[MonoTODO]
+		protected  Rectangle CalcImageRenderBounds( Image image, Rectangle rect,  ContentAlignment align)
+		{
+			throw new NotImplementedException ();
+		}
+// 		[MonoTODO]
+// 		protected  override AccessibleObject CreateAccessibilityInstance()
+// 		{
+// 			throw new NotImplementedException ();
+// 		}
+
+		//protected  void Dispose()
+		//{
+		//	throw new NotImplementedException ();
+		//}
+		//protected  override void Dispose(bool val)
+		//{
+		//	throw new NotImplementedException ();
+		//}
+
+		[MonoTODO]
+		protected  void DrawImage (Graphics g, Image img, 
+					   Rectangle r, ContentAlignment align)
+		{
+			throw new NotImplementedException ();
+		}
+
+		[MonoTODO]
+		protected override void  OnEnabledChanged (EventArgs e)
+		{
+			throw new NotImplementedException ();
+		}
+
+		[MonoTODO]
+		protected override void  OnFontChanged (EventArgs e)
+		{
+			throw new NotImplementedException ();
+		}
+
+		[MonoTODO]
+		protected override void  OnPaint (PaintEventArgs e)
+		{
+			throw new NotImplementedException ();
+		}
+
+		[MonoTODO]
+		protected override void  OnParentChanged (EventArgs e)
+		{
+			throw new NotImplementedException ();
+		}
+
+		[MonoTODO]
+		protected override void  OnTextChanged (EventArgs e) {
+			throw new NotImplementedException ();
+			//((Gtk.Label) Widget).Text = Text;
+		}
+
+		[MonoTODO]
+		protected override void  OnVisibleChanged (EventArgs e)
+		{
+			throw new NotImplementedException ();
+		}
+
+		[MonoTODO]
+		protected override bool ProcessMnemonic(char charCode)
+		{
+			throw new NotImplementedException ();
+		}
+
+		//protected ContentAlignment RtlTranslateAlignment( ContentAlignment alignment)
+		//{
+		//	throw new NotImplementedException ();
+		//}
+		//protected HorizontalAlignment RtlTranslateAlignment( HorizontalAlignment alignment)
+		//{
+		//	throw new NotImplementedException ();
+		//}
+		//protected override void Select(bool val1, bool val2)
+		//{
+		//	throw new NotImplementedException ();
+		//}
+
+		[MonoTODO]
+		protected override void SetBoundsCore(  int x, int y,  int width, int height,  BoundsSpecified specified)
+		{
+			throw new NotImplementedException ();
+		}
+		//protected void UpdateBounds()
+		//{
+		//	throw new NotImplementedException ();
+		//}
+		//protected void UpdateBounds(int b1, int b2, int b3, int b4)
+		//{
+		//	throw new NotImplementedException ();
+		//}
+
+		protected override void WndProc(ref Message m)
+		{
+			base.WndProc (ref m);
+		}
+
+		// missing stubs:
+		public new Control Parent {
+			get { return base.Parent; } 
+			set { base.Parent = value; }
+		}
+
+		protected override void CreateHandle () 
+		{
+			CreateParams createParams = new CreateParams ();
+			window = new ControlNativeWindow (this);
+
+			// FIXME: set based on attributes
+			createParams.Caption = Text;
+			createParams.ClassName = "STATIC";
+			createParams.X = 10;
+			createParams.Y = 10;
+			createParams.Width = 100;
+			createParams.Height = 50;
+			createParams.ClassStyle = 0;
+			createParams.ExStyle = 0;
+			createParams.Param = 0;
+			createParams.Parent = Parent.Handle;
+			createParams.Style = (int) (
+				Win32.WS_CHILD | 
+				Win32.WS_VISIBLE | Win32.SS_LEFT );
+			window.CreateHandle (createParams);
+		}
+	}
+}

+ 12 - 8
mcs/class/System.Windows.Forms/System.Windows.Forms/NativeWindow.cs

@@ -181,7 +181,8 @@ namespace System.Windows.Forms {
 
 		protected virtual void WndProc (ref Message m) 
 		{
-			Console.WriteLine ("NativeWindow.WndProc");
+			if (m.Msg == Win32.WM_CREATE)
+				Console.WriteLine ("NW WndProc WM_CREATE");
 			DefWndProc (ref m);
 		}
 
@@ -196,8 +197,6 @@ namespace System.Windows.Forms {
  		static private IntPtr WndProc (
 			IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam) 
 		{
- 		        Console.WriteLine ("in WndProc");
-
 			// windowCollection is a collection of all the 
 			// NativeWindow(s) that have been created.
 			// Dispatch the current message to the approriate
@@ -205,16 +204,21 @@ namespace System.Windows.Forms {
  			NativeWindow window = 
 			        (NativeWindow) windowCollection[hWnd];
  			Message message = new Message ();
-
+			message.HWnd = hWnd;
+			message.Msg = msg;
+			message.WParam = wParam;
+			message.LParam = lParam;
  			message.Result = (IntPtr) 0;
 
+			if (msg == Win32.WM_CREATE)
+				Console.WriteLine ("WM_CREATE (static)");
+
  			if (window != null) {
- 				message.HWnd = hWnd;
- 				message.Msg = msg;
- 				message.WParam = wParam;
- 				message.LParam = lParam;
+			if (msg == Win32.WM_CREATE)
+				Console.WriteLine ("WM_CREATE (static != null)");
  				window.WndProc(ref message);
  			} else {
+				Console.WriteLine ("no window, defwndproc");
  				// even though we are not managing the
  				// window let the window get the message
  				message.Result = Win32.DefWindowProcA (

+ 3 - 7
mcs/class/System.Windows.Forms/System.Windows.Forms/ScrollableControl.cs

@@ -68,10 +68,9 @@ namespace System.Windows.Forms {
 			}
 		}
 
-		[MonoTODO]
 		public override Rectangle DisplayRectangle {
 			get {
-				throw new NotImplementedException ();
+				return base.DisplayRectangle;
 			}
 		}
 
@@ -202,10 +201,9 @@ namespace System.Windows.Forms {
 		//  --- Protected Properties
 		//
 
-		[MonoTODO]
 		protected override CreateParams CreateParams {
 			get {
-				throw new NotImplementedException ();
+				return base.CreateParams;
 			}
 		}
 
@@ -272,10 +270,9 @@ namespace System.Windows.Forms {
 		//	throw new NotImplementedException ();
 		//}
 
-		[MonoTODO]
 		protected override void ScaleCore (float dx, float dy)
 		{
-			throw new NotImplementedException ();
+			base.ScaleCore (dx, dy);
 		}
 
 		//protected void UpdateBounds()
@@ -291,7 +288,6 @@ namespace System.Windows.Forms {
 		//	throw new NotImplementedException ();
 		//}
 
-		[MonoTODO]
 		protected override void WndProc (ref Message m)
 		{
 			base.WndProc (ref m);

+ 36 - 0
mcs/class/System.Windows.Forms/System.Windows.Forms/Win32.cs

@@ -142,6 +142,11 @@ namespace System.Windows.Forms {
 		public static extern IntPtr SetParent (
 			IntPtr hWndChild, IntPtr hWndNewParent);
 
+		[DllImport ("user32.dll", 
+			    CallingConvention = CallingConvention.StdCall, 
+			    CharSet = CharSet.Auto)]
+		public static extern IntPtr GetParent (IntPtr hWnd);
+
 		[DllImport ("user32.dll", 
 			    CallingConvention = CallingConvention.StdCall, 
 			    CharSet = CharSet.Auto)]
@@ -638,5 +643,36 @@ namespace System.Windows.Forms {
 		public const int HWND_TOPMOST = -1;
 		public const int HWND_NOTOPMOST = -2;
 		public const int HWND_MESSAGE = -3;
+
+		// Static Control Styles
+		public const int SS_LEFT             = 0x00000000L;
+		public const int SS_CENTER           = 0x00000001L;
+		public const int SS_RIGHT            = 0x00000002L;
+		public const int SS_ICON             = 0x00000003L;
+		public const int SS_BLACKRECT        = 0x00000004L;
+		public const int SS_GRAYRECT         = 0x00000005L;
+		public const int SS_WHITERECT        = 0x00000006L;
+		public const int SS_BLACKFRAME       = 0x00000007L;
+		public const int SS_GRAYFRAME        = 0x00000008L;
+		public const int SS_WHITEFRAME       = 0x00000009L;
+
+		public const int SS_SIMPLE           = 0x0000000BL;
+		public const int SS_LEFTNOWORDWRAP   = 0x0000000CL;
+		
+		public const int SS_OWNERDRAW        = 0x0000000DL;
+		public const int SS_BITMAP           = 0x0000000EL;
+		public const int SS_ENHMETAFILE      = 0x0000000FL;
+
+		public const int SS_ETCHEDHORZ       = 0x00000010L;
+		public const int SS_ETCHEDVERT       = 0x00000011L;
+		public const int SS_ETCHEDFRAME      = 0x00000012L;
+		public const int SS_TYPEMASK         = 0x0000001FL;
+		
+		public const int SS_NOPREFIX         = 0x00000080L;
+		public const int SS_NOTIFY           = 0x00000100L;
+		public const int SS_CENTERIMAGE      = 0x00000200L;
+		public const int SS_RIGHTJUST        = 0x00000400L;
+		public const int SS_REALSIZEIMAGE    = 0x00000800L;
+		public const int SS_SUNKEN           = 0x00001000L;
 	}
 }

+ 5 - 0
mcs/class/System.Windows.Forms/System.Windows.Forms/makefile

@@ -83,10 +83,15 @@ SOURCES = \
 	../System.Windows.Forms/MessageBoxIcon.cs \
 	../System.Windows.Forms/MessageBoxDefaultButton.cs \
 	../System.Windows.Forms/MessageBoxOptions.cs \
+	../System.Windows.Forms/FlatStyle.cs \
+	../System.Windows.Forms/ImageListStreamer.cs \
+	../System.Windows.Forms/ImageList.cs \
+	../System.Windows.Forms/ColorDepth.cs \
 	IContainerControl.cs \
 	Control.cs \
 	ScrollableControl.cs \
 	ContainerControl.cs \
+	Label.cs \
 	Form.cs \
 	Application.cs \
 	NativeWindow.cs \

+ 5 - 1
mcs/class/System.Windows.Forms/System.Windows.Forms/monostub.c

@@ -55,6 +55,8 @@ ATOM WINAPI RegisterClassA (const WNDCLASSA *);
 HMODULE WINAPI GetModuleHandleA (LPCSTR);
 INT WINAPI MessageBoxExA (HWND, LPCSTR, LPCSTR, UINT, WORD);
 
+HINSTANCE applicationInstance = NULL;
+
 // register WNDCLASS for use in embeded application, this is a work around
 // for Bugzilla item #29548
 int PASCAL MonoRegisterClass (UINT style, WNDPROC lpfnWndProc, INT cbClsExtra,
@@ -68,7 +70,7 @@ int PASCAL MonoRegisterClass (UINT style, WNDPROC lpfnWndProc, INT cbClsExtra,
 	wc.lpszClassName = lpszClassName;
 	wc.lpfnWndProc = lpfnWndProc;
 	wc.style = style;
-	wc.hInstance = hInstance;
+	wc.hInstance = applicationInstance;
 	wc.hIcon = hIcon;
 	wc.hCursor = hCursor;
 	wc.hbrBackground = hbrBackground;
@@ -88,6 +90,8 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
 	MonoAssembly *assembly = NULL;
 	int retval = 0;
 
+	applicationInstance = hInstance;
+
 	printf ("initializing JIT engine\n");	
 	domain = mono_jit_init (lpszCmdLine);
 	

+ 3 - 1
mcs/class/System.Windows.Forms/WINELib/Application.cs

@@ -218,7 +218,9 @@ namespace System.Windows.Forms {
 		// Documents say this parameter name should be mainform, 
 		// but the verifier says context.
 		{
-			ApplicationContext context = new ApplicationContext (form);
+			form.CreateControl ();
+			ApplicationContext context = new ApplicationContext (
+				form);
 			Run (context);
 		}
 		

+ 8 - 11
mcs/class/System.Windows.Forms/WINELib/ContainerControl.cs

@@ -38,9 +38,8 @@ namespace System.Windows.Forms {
 		//	set { throw new NotImplementedException (); }
 		//}
 		
-		[MonoTODO]
 		protected override CreateParams CreateParams {
-			get { throw new NotImplementedException (); }
+			get { return base.CreateParams; }
 		}
 		
 		[MonoTODO]
@@ -51,10 +50,11 @@ namespace System.Windows.Forms {
 		/// --- Methods ---
 		/// internal .NET framework supporting methods, not stubbed out:
 		/// - protected virtual void UpdateDefaultButton()
-		[MonoTODO]
-		protected override void AdjustFormScrollbars (bool displayScrollbars) 
+
+		protected override void AdjustFormScrollbars (
+			bool displayScrollbars) 
 		{
-			throw new NotImplementedException ();
+			base.AdjustFormScrollbars (displayScrollbars);
 		}
 		
 		[MonoTODO]
@@ -71,16 +71,14 @@ namespace System.Windows.Forms {
 		//}
 		
 		// [event methods]
-		[MonoTODO]
 		protected override void OnControlRemoved (ControlEventArgs e) 
 		{
-			throw new NotImplementedException ();
+			base.OnControlRemoved (e);
 		}
 		
-		[MonoTODO]
-		protected override void OnCreateControl () 
+		protected override void OnCreateControl ()
 		{
-			throw new NotImplementedException ();
+			base.OnCreateControl ();
 		}
 		// end of [event methods]
 		
@@ -120,7 +118,6 @@ namespace System.Windows.Forms {
 			throw new NotImplementedException ();
 		}
 		
-		[MonoTODO]
 		protected override void WndProc(ref Message m) 
 		{
 			base.WndProc(ref m);

Dosya farkı çok büyük olduğundan ihmal edildi
+ 317 - 261
mcs/class/System.Windows.Forms/WINELib/Control.cs


+ 34 - 49
mcs/class/System.Windows.Forms/WINELib/Form.cs

@@ -76,23 +76,21 @@ namespace System.Windows.Forms {
 			}
 		}
 
-		[MonoTODO]
 		public override bool AutoScroll {
 			get {
-				throw new NotImplementedException ();
+				return base.AutoScroll;
 			}
 			set {
-				throw new NotImplementedException ();
+				base.AutoScroll = value;
 			}
 		}
 
-		[MonoTODO]
 		public override Color BackColor {
 			get {
-				throw new NotImplementedException ();
+				return base.BackColor;
 			}
 			set {
-				throw new NotImplementedException ();
+				base.BackColor = value;
 			}
 		}
 
@@ -412,7 +410,7 @@ namespace System.Windows.Forms {
 		//  --- Public Methods
 		public void Activate ()
 		{
-			Win32.SetActiveWindow (window.Handle);
+			Win32.SetActiveWindow (Handle);
 		}
 
 		[MonoTODO]
@@ -423,7 +421,7 @@ namespace System.Windows.Forms {
 
 		public void Close ()
 		{
-			Win32.CloseWindow (window.Handle);
+			Win32.CloseWindow (Handle);
 		}
 
 		//inherited
@@ -504,7 +502,7 @@ namespace System.Windows.Forms {
 
 		public void SetDesktopLocation (int x, int y)
 		{
-			Win32.SetWindowPos ((IntPtr) window.Handle, (IntPtr) 0, 
+			Win32.SetWindowPos ((IntPtr) Handle, (IntPtr) 0, 
 					    x, y, 0, 0, 
 					    (int) (Win32.SWP_NOSIZE | 
 					    Win32.SWP_NOZORDER));
@@ -512,7 +510,7 @@ namespace System.Windows.Forms {
 
 		public new void Show ()
 		{
-			Win32.ShowWindow (window.Handle, (int) Win32.SW_SHOW);
+			Win32.ShowWindow (Handle, (int) Win32.SW_SHOW);
 		}
 
 		[MonoTODO]
@@ -561,7 +559,6 @@ namespace System.Windows.Forms {
 // 			}
 // 		}
 
-		[MonoTODO]
 		public event InputLanguageChangingEventHandler InputLanguageChanging; // {
 // 			add {
 // 				throw new NotImplementedException ();
@@ -571,7 +568,6 @@ namespace System.Windows.Forms {
 // 			}
 // 		}
 
-		[MonoTODO]
 		public event EventHandler  Load; // {
 // 			add {
 // 				throw new NotImplementedException ();
@@ -581,7 +577,6 @@ namespace System.Windows.Forms {
 // 			}
 // 		}
 
-		[MonoTODO]
 		public event EventHandler  MaximizedBoundsChanged; // {
 // 			add {
 // 				throw new NotImplementedException ();
@@ -591,7 +586,6 @@ namespace System.Windows.Forms {
 // 			}
 // 		}
 
-		[MonoTODO]
 		public event EventHandler MaximumSizeChanged; // {
 // 			add {
 // 				throw new NotImplementedException ();
@@ -601,7 +595,6 @@ namespace System.Windows.Forms {
 // 			}
 // 		}
 
-		[MonoTODO]
 		public event EventHandler  MdiChildActivate; // {
 // 			add {
 // 				throw new NotImplementedException ();
@@ -611,7 +604,6 @@ namespace System.Windows.Forms {
 // 			}
 // 		}
 
-		[MonoTODO]
 		public event EventHandler  MenuComplete; // {
 // 			add {
 // 				throw new NotImplementedException ();
@@ -621,7 +613,6 @@ namespace System.Windows.Forms {
 // 			}
 // 		}
 
-		[MonoTODO]
 		public event EventHandler  MenuStart; // {
 // 			add {
 // 				throw new NotImplementedException ();
@@ -631,7 +622,6 @@ namespace System.Windows.Forms {
 // 			}
 // 		}
 
-		[MonoTODO]
 		public event EventHandler  MinimumSizedChanged; // {
 // 			add {
 // 				throw new NotImplementedException ();
@@ -644,17 +634,15 @@ namespace System.Windows.Forms {
 		
 		//  --- Protected Properties
 		
-		[MonoTODO]
 		protected override CreateParams CreateParams {
 			get {
 				return base.CreateParams;
 			}
 		}
 
-		[MonoTODO]
 		protected override ImeMode DefaultImeMode {
 			get {
-				throw new NotImplementedException ();
+				return base.DefaultImeMode;
 			}
 		}
 
@@ -676,21 +664,22 @@ namespace System.Windows.Forms {
 		
 		//  --- Protected Methods
 		
-		[MonoTODO]
 		protected override void AdjustFormScrollbars (bool displayScrollbars)
 		{
-			throw new NotImplementedException ();
+			base.AdjustFormScrollbars (displayScrollbars);
 		}
 
-		//[MonoTODO]
-		//protected override ControlCollection CreateControlsInstance()
-		//{
-		//		throw new NotImplementedException ();
-		//}
+		protected override Control.ControlCollection CreateControlsInstance ()
+		{
+			return base.CreateControlsInstance ();
+		}
 
 		protected override void CreateHandle ()
 		{
 			base.CreateHandle ();
+
+			if (IsHandleCreated)
+				OnHandleCreated (new EventArgs());
 		}
 
 		protected override void DefWndProc (ref Message m)
@@ -718,21 +707,23 @@ namespace System.Windows.Forms {
 
 		protected override void OnCreateControl ()
 		{
-			
+			base.OnCreateControl ();
 		}
 
 		protected override void OnFontChanged (EventArgs e)
 		{
-
+			base.OnFontChanged (e);
 		}
 
 		protected override void OnHandleCreated (EventArgs e)
 		{
-
+			Console.WriteLine ("OnHandleCreated");
+			base.OnHandleCreated (e);
 		}
 
 		protected override void OnHandleDestroyed (EventArgs e)
 		{
+			base.OnHandleDestroyed (e);
 		}
 
 		protected virtual void OnInputLanguageChanged (InputLanguageChangedEventArgs e)
@@ -795,7 +786,7 @@ namespace System.Windows.Forms {
 
 		protected override void  OnResize (EventArgs e)
 		{
-
+			base.OnResize (e);
 		}
 
 		protected override void  OnStyleChanged (EventArgs e)
@@ -963,24 +954,22 @@ namespace System.Windows.Forms {
 		// </summary>
 		// TODO: implement support classes and derive from 
 		// proper classes
-		public /*new(remove error)*/ class  ControlCollection /*: System.Windows.Forms.Control.ControlCollection, ICollection*/ {
+		// FIXME: use this or the one defined on Control?
+		public class  ControlCollectionX : System.Windows.Forms.Control.ControlCollection /*,ICollection*/ {
 
 			//  --- Constructor
-			[MonoTODO]
 			// base class not defined (yet!)
-			public ControlCollection (Form owner) /*: base(owner)*/ {
-				throw new NotImplementedException ();
+			public ControlCollectionX (Form owner) : base(owner) {
+
 			}
 		
 			//  --- Public Methods
 
-			[MonoTODO]
 			// TODO: see what causes this compile error
-			//public override void Add(Control value) {
-			//	throw new NotImplementedException ();
-			//}
+			public override void Add(Control value) {
+				base.Add (value);
+			}
 
-			[MonoTODO]
 			public override bool Equals (object o) {
 				throw new NotImplementedException ();
 			}
@@ -989,22 +978,18 @@ namespace System.Windows.Forms {
 			//	throw new NotImplementedException ();
 			//}
 
-			[MonoTODO]
 			public override int GetHashCode () {
 				//FIXME add our proprities
 				return base.GetHashCode ();
 			}
 
-			// Inherited
 			//public override int GetChildIndex(Control c) {
-			//	throw new NotImplementedException ();
+				//return base.GetChildIndex (c);
 			//}
 
-			//[MonoTODO]
-			// Control not yet usuable due to dependencies
-			//public override void Remove(Control value) {
-			//	throw new NotImplementedException ();
-			//}
+			public override void Remove(Control value) {
+				base.Remove (value);
+			}
 		} // end of Subclass
 	}
 }

+ 26 - 16
mcs/class/System.Windows.Forms/WINELib/FormTest.cs

@@ -2,20 +2,15 @@ using System;
 using System.Windows.Forms;
 
 // Test basic functionality of the Application and Form class
-class FormTest : Form
-{
-	public class DoubleClickMessageFilter : IMessageFilter {
+class FormTest : Form {
 
-		public bool PreFilterMessage(ref Message m)
-		{
-			Console.WriteLine ("PreFilter(ing) message");
-			
-			if (m.Msg == Win32.WM_MOUSEMOVE) {
-				Console.WriteLine ("captured mousemove");
-				return true;
-			}
-			return false;
-		}
+	Label label;
+
+	public FormTest () : base ()
+	{
+		label = new Label ();
+		label.Parent = this;
+		label.Text = "Hello";
 	}
 
 	// - verifies the WndProc can be overridden propery 
@@ -29,11 +24,26 @@ class FormTest : Form
 				   Application.MessageLoop);
 	}
 
+	public class MouseMoveMessageFilter : IMessageFilter {
+
+		public bool PreFilterMessage(ref Message m)
+		{
+			Console.WriteLine ("PreFilter(ing) message");
+			
+			if (m.Msg == Win32.WM_MOUSEMOVE) {
+				Console.WriteLine ("captured mousemove");
+				return true;
+			}
+			return false;
+		}
+	}
+
+
 	static public void Test1 ()
 	{
 		MessageBox.Show ("test derived form");
 		FormTest form = new FormTest ();
-		DoubleClickMessageFilter f = new DoubleClickMessageFilter();
+		MouseMoveMessageFilter f = new MouseMoveMessageFilter();
 		Application.AddMessageFilter (f);
 
                 // should be false
@@ -41,7 +51,7 @@ class FormTest : Form
 				   Application.MessageLoop);
 
 		Application.Run (form);
-		Application.RemoveMessageFilter (f);
+		Application.RemoveMessageFilter (f); 
 	}
 
 	static public void Test2 ()
@@ -56,7 +66,7 @@ class FormTest : Form
  	static public int Main (String[] args)
 	{
 		Test1();
-		Test2();
+		//Test2();
 		return 0;
 	}
 }

+ 319 - 0
mcs/class/System.Windows.Forms/WINELib/Label.cs

@@ -0,0 +1,319 @@
+//
+// 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])
+// (C) 2002 Ximian, Inc
+//
+
+namespace System.Windows.Forms {
+	using System.Drawing;
+
+	// <summary>
+	//
+	// </summary>
+	
+	public class Label : Control {
+	
+		public Label () : base ()
+		{
+
+		}
+		
+		[MonoTODO]
+		public virtual bool AutoSize {
+			get {
+				throw new NotImplementedException ();
+			}
+			set {
+				throw new NotImplementedException ();
+			}
+		}
+
+		[MonoTODO]
+		public FlatStyle FlatStyle {
+			get {
+				throw new NotImplementedException ();
+			}
+			set {
+				throw new NotImplementedException ();
+			}
+		}
+
+		[MonoTODO]
+		public Image Image {
+			get {
+				throw new NotImplementedException ();
+			}
+			set {
+				throw new NotImplementedException ();
+			}
+		}
+
+		[MonoTODO]
+		public ContentAlignment ImageAlign {
+			get {
+				throw new NotImplementedException ();
+			}
+			set {
+				throw new NotImplementedException ();
+			}
+		}
+
+		[MonoTODO]
+		public int ImageIndex {
+			get {
+				throw new NotImplementedException ();
+			}
+			set {
+				throw new NotImplementedException ();
+			}
+		}
+
+		[MonoTODO]
+		public ImageList ImageList {
+			get {
+				throw new NotImplementedException ();
+			}
+			set {
+				throw new NotImplementedException ();
+			}
+		}
+		[MonoTODO]
+		public new ImeMode ImeMode {
+			get {
+				throw new NotImplementedException ();
+			}
+			set {
+				throw new NotImplementedException ();
+			}
+		}
+
+		[MonoTODO]
+		public int PreferredHeight {
+			get {
+				throw new NotImplementedException ();
+			}
+		}
+
+		[MonoTODO]
+		public int PreferredWidth {
+			get {
+				throw new NotImplementedException ();
+			}
+		}
+
+		[MonoTODO]
+		public new bool TabStop {
+			get {
+				throw new NotImplementedException ();
+			}
+			set {
+				throw new NotImplementedException ();
+			}
+		}
+
+		[MonoTODO]
+		//virtual
+		public ContentAlignment TextAlign {
+			get {
+				throw new NotImplementedException ();
+			}
+			set {
+				throw new NotImplementedException ();
+			}
+		}
+
+		[MonoTODO]
+		public bool UseMnemonic {
+			get {
+				throw new NotImplementedException ();
+			}
+			set {
+				throw new NotImplementedException ();
+			}
+		}
+
+		//
+		//  --- Public Methods
+		//
+		[MonoTODO]
+		public override bool Equals(object o)
+		{
+			throw new NotImplementedException ();
+		}
+		//public static bool Equals(object o1, object o2)
+		//{
+		//	throw new NotImplementedException ();
+		//}
+		[MonoTODO]
+		public override int GetHashCode() {
+			//FIXME add our proprities
+			return base.GetHashCode();
+		}
+		//public void Select()
+		//{
+		//	throw new NotImplementedException ();
+		//}
+		[MonoTODO]
+		public override string ToString()
+		{
+			throw new NotImplementedException ();
+		}
+
+		//
+		//  --- Public Events
+		// 
+		public event EventHandler AutoSizeChanged; // {
+// 			add {
+// 				throw new NotImplementedException ();
+// 			}
+// 			remove {
+// 				throw new NotImplementedException ();
+// 			}
+// 		}
+
+		public event EventHandler TextAlignChanged; // {
+// 			add {
+// 				throw new NotImplementedException ();
+// 			}
+// 			remove {
+// 				throw new NotImplementedException ();
+// 			}
+// 		}
+
+		//
+		//  --- Protected Methods
+		//
+		[MonoTODO]
+		protected  Rectangle CalcImageRenderBounds( Image image, Rectangle rect,  ContentAlignment align)
+		{
+			throw new NotImplementedException ();
+		}
+// 		[MonoTODO]
+// 		protected  override AccessibleObject CreateAccessibilityInstance()
+// 		{
+// 			throw new NotImplementedException ();
+// 		}
+
+		//protected  void Dispose()
+		//{
+		//	throw new NotImplementedException ();
+		//}
+		//protected  override void Dispose(bool val)
+		//{
+		//	throw new NotImplementedException ();
+		//}
+
+		[MonoTODO]
+		protected  void DrawImage (Graphics g, Image img, 
+					   Rectangle r, ContentAlignment align)
+		{
+			throw new NotImplementedException ();
+		}
+
+		[MonoTODO]
+		protected override void  OnEnabledChanged (EventArgs e)
+		{
+			throw new NotImplementedException ();
+		}
+
+		[MonoTODO]
+		protected override void  OnFontChanged (EventArgs e)
+		{
+			throw new NotImplementedException ();
+		}
+
+		[MonoTODO]
+		protected override void  OnPaint (PaintEventArgs e)
+		{
+			throw new NotImplementedException ();
+		}
+
+		[MonoTODO]
+		protected override void  OnParentChanged (EventArgs e)
+		{
+			throw new NotImplementedException ();
+		}
+
+		[MonoTODO]
+		protected override void  OnTextChanged (EventArgs e) {
+			throw new NotImplementedException ();
+			//((Gtk.Label) Widget).Text = Text;
+		}
+
+		[MonoTODO]
+		protected override void  OnVisibleChanged (EventArgs e)
+		{
+			throw new NotImplementedException ();
+		}
+
+		[MonoTODO]
+		protected override bool ProcessMnemonic(char charCode)
+		{
+			throw new NotImplementedException ();
+		}
+
+		//protected ContentAlignment RtlTranslateAlignment( ContentAlignment alignment)
+		//{
+		//	throw new NotImplementedException ();
+		//}
+		//protected HorizontalAlignment RtlTranslateAlignment( HorizontalAlignment alignment)
+		//{
+		//	throw new NotImplementedException ();
+		//}
+		//protected override void Select(bool val1, bool val2)
+		//{
+		//	throw new NotImplementedException ();
+		//}
+
+		[MonoTODO]
+		protected override void SetBoundsCore(  int x, int y,  int width, int height,  BoundsSpecified specified)
+		{
+			throw new NotImplementedException ();
+		}
+		//protected void UpdateBounds()
+		//{
+		//	throw new NotImplementedException ();
+		//}
+		//protected void UpdateBounds(int b1, int b2, int b3, int b4)
+		//{
+		//	throw new NotImplementedException ();
+		//}
+
+		protected override void WndProc(ref Message m)
+		{
+			base.WndProc (ref m);
+		}
+
+		// missing stubs:
+		public new Control Parent {
+			get { return base.Parent; } 
+			set { base.Parent = value; }
+		}
+
+		protected override void CreateHandle () 
+		{
+			CreateParams createParams = new CreateParams ();
+			window = new ControlNativeWindow (this);
+
+			// FIXME: set based on attributes
+			createParams.Caption = Text;
+			createParams.ClassName = "STATIC";
+			createParams.X = 10;
+			createParams.Y = 10;
+			createParams.Width = 100;
+			createParams.Height = 50;
+			createParams.ClassStyle = 0;
+			createParams.ExStyle = 0;
+			createParams.Param = 0;
+			createParams.Parent = Parent.Handle;
+			createParams.Style = (int) (
+				Win32.WS_CHILD | 
+				Win32.WS_VISIBLE | Win32.SS_LEFT );
+			window.CreateHandle (createParams);
+		}
+	}
+}

+ 12 - 8
mcs/class/System.Windows.Forms/WINELib/NativeWindow.cs

@@ -181,7 +181,8 @@ namespace System.Windows.Forms {
 
 		protected virtual void WndProc (ref Message m) 
 		{
-			Console.WriteLine ("NativeWindow.WndProc");
+			if (m.Msg == Win32.WM_CREATE)
+				Console.WriteLine ("NW WndProc WM_CREATE");
 			DefWndProc (ref m);
 		}
 
@@ -196,8 +197,6 @@ namespace System.Windows.Forms {
  		static private IntPtr WndProc (
 			IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam) 
 		{
- 		        Console.WriteLine ("in WndProc");
-
 			// windowCollection is a collection of all the 
 			// NativeWindow(s) that have been created.
 			// Dispatch the current message to the approriate
@@ -205,16 +204,21 @@ namespace System.Windows.Forms {
  			NativeWindow window = 
 			        (NativeWindow) windowCollection[hWnd];
  			Message message = new Message ();
-
+			message.HWnd = hWnd;
+			message.Msg = msg;
+			message.WParam = wParam;
+			message.LParam = lParam;
  			message.Result = (IntPtr) 0;
 
+			if (msg == Win32.WM_CREATE)
+				Console.WriteLine ("WM_CREATE (static)");
+
  			if (window != null) {
- 				message.HWnd = hWnd;
- 				message.Msg = msg;
- 				message.WParam = wParam;
- 				message.LParam = lParam;
+			if (msg == Win32.WM_CREATE)
+				Console.WriteLine ("WM_CREATE (static != null)");
  				window.WndProc(ref message);
  			} else {
+				Console.WriteLine ("no window, defwndproc");
  				// even though we are not managing the
  				// window let the window get the message
  				message.Result = Win32.DefWindowProcA (

+ 3 - 7
mcs/class/System.Windows.Forms/WINELib/ScrollableControl.cs

@@ -68,10 +68,9 @@ namespace System.Windows.Forms {
 			}
 		}
 
-		[MonoTODO]
 		public override Rectangle DisplayRectangle {
 			get {
-				throw new NotImplementedException ();
+				return base.DisplayRectangle;
 			}
 		}
 
@@ -202,10 +201,9 @@ namespace System.Windows.Forms {
 		//  --- Protected Properties
 		//
 
-		[MonoTODO]
 		protected override CreateParams CreateParams {
 			get {
-				throw new NotImplementedException ();
+				return base.CreateParams;
 			}
 		}
 
@@ -272,10 +270,9 @@ namespace System.Windows.Forms {
 		//	throw new NotImplementedException ();
 		//}
 
-		[MonoTODO]
 		protected override void ScaleCore (float dx, float dy)
 		{
-			throw new NotImplementedException ();
+			base.ScaleCore (dx, dy);
 		}
 
 		//protected void UpdateBounds()
@@ -291,7 +288,6 @@ namespace System.Windows.Forms {
 		//	throw new NotImplementedException ();
 		//}
 
-		[MonoTODO]
 		protected override void WndProc (ref Message m)
 		{
 			base.WndProc (ref m);

+ 36 - 0
mcs/class/System.Windows.Forms/WINELib/Win32.cs

@@ -142,6 +142,11 @@ namespace System.Windows.Forms {
 		public static extern IntPtr SetParent (
 			IntPtr hWndChild, IntPtr hWndNewParent);
 
+		[DllImport ("user32.dll", 
+			    CallingConvention = CallingConvention.StdCall, 
+			    CharSet = CharSet.Auto)]
+		public static extern IntPtr GetParent (IntPtr hWnd);
+
 		[DllImport ("user32.dll", 
 			    CallingConvention = CallingConvention.StdCall, 
 			    CharSet = CharSet.Auto)]
@@ -638,5 +643,36 @@ namespace System.Windows.Forms {
 		public const int HWND_TOPMOST = -1;
 		public const int HWND_NOTOPMOST = -2;
 		public const int HWND_MESSAGE = -3;
+
+		// Static Control Styles
+		public const int SS_LEFT             = 0x00000000L;
+		public const int SS_CENTER           = 0x00000001L;
+		public const int SS_RIGHT            = 0x00000002L;
+		public const int SS_ICON             = 0x00000003L;
+		public const int SS_BLACKRECT        = 0x00000004L;
+		public const int SS_GRAYRECT         = 0x00000005L;
+		public const int SS_WHITERECT        = 0x00000006L;
+		public const int SS_BLACKFRAME       = 0x00000007L;
+		public const int SS_GRAYFRAME        = 0x00000008L;
+		public const int SS_WHITEFRAME       = 0x00000009L;
+
+		public const int SS_SIMPLE           = 0x0000000BL;
+		public const int SS_LEFTNOWORDWRAP   = 0x0000000CL;
+		
+		public const int SS_OWNERDRAW        = 0x0000000DL;
+		public const int SS_BITMAP           = 0x0000000EL;
+		public const int SS_ENHMETAFILE      = 0x0000000FL;
+
+		public const int SS_ETCHEDHORZ       = 0x00000010L;
+		public const int SS_ETCHEDVERT       = 0x00000011L;
+		public const int SS_ETCHEDFRAME      = 0x00000012L;
+		public const int SS_TYPEMASK         = 0x0000001FL;
+		
+		public const int SS_NOPREFIX         = 0x00000080L;
+		public const int SS_NOTIFY           = 0x00000100L;
+		public const int SS_CENTERIMAGE      = 0x00000200L;
+		public const int SS_RIGHTJUST        = 0x00000400L;
+		public const int SS_REALSIZEIMAGE    = 0x00000800L;
+		public const int SS_SUNKEN           = 0x00001000L;
 	}
 }

+ 5 - 0
mcs/class/System.Windows.Forms/WINELib/makefile

@@ -83,10 +83,15 @@ SOURCES = \
 	../System.Windows.Forms/MessageBoxIcon.cs \
 	../System.Windows.Forms/MessageBoxDefaultButton.cs \
 	../System.Windows.Forms/MessageBoxOptions.cs \
+	../System.Windows.Forms/FlatStyle.cs \
+	../System.Windows.Forms/ImageListStreamer.cs \
+	../System.Windows.Forms/ImageList.cs \
+	../System.Windows.Forms/ColorDepth.cs \
 	IContainerControl.cs \
 	Control.cs \
 	ScrollableControl.cs \
 	ContainerControl.cs \
+	Label.cs \
 	Form.cs \
 	Application.cs \
 	NativeWindow.cs \

+ 5 - 1
mcs/class/System.Windows.Forms/WINELib/monostub.c

@@ -55,6 +55,8 @@ ATOM WINAPI RegisterClassA (const WNDCLASSA *);
 HMODULE WINAPI GetModuleHandleA (LPCSTR);
 INT WINAPI MessageBoxExA (HWND, LPCSTR, LPCSTR, UINT, WORD);
 
+HINSTANCE applicationInstance = NULL;
+
 // register WNDCLASS for use in embeded application, this is a work around
 // for Bugzilla item #29548
 int PASCAL MonoRegisterClass (UINT style, WNDPROC lpfnWndProc, INT cbClsExtra,
@@ -68,7 +70,7 @@ int PASCAL MonoRegisterClass (UINT style, WNDPROC lpfnWndProc, INT cbClsExtra,
 	wc.lpszClassName = lpszClassName;
 	wc.lpfnWndProc = lpfnWndProc;
 	wc.style = style;
-	wc.hInstance = hInstance;
+	wc.hInstance = applicationInstance;
 	wc.hIcon = hIcon;
 	wc.hCursor = hCursor;
 	wc.hbrBackground = hbrBackground;
@@ -88,6 +90,8 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
 	MonoAssembly *assembly = NULL;
 	int retval = 0;
 
+	applicationInstance = hInstance;
+
 	printf ("initializing JIT engine\n");	
 	domain = mono_jit_init (lpszCmdLine);
 	

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor