Prechádzať zdrojové kódy

change from wndproc to events

svn path=/trunk/mcs/; revision=32329
Jordi Mas i Hernandez 21 rokov pred
rodič
commit
4eec8ab1bc

+ 14 - 26
mcs/class/Managed.Windows.Forms/System.Windows.Forms/TrackBar.cs

@@ -30,9 +30,12 @@
 // Copyright (C) Novell Inc., 2004
 // Copyright (C) Novell Inc., 2004
 //
 //
 //
 //
-// $Revision: 1.9 $
+// $Revision: 1.10 $
 // $Modtime: $
 // $Modtime: $
 // $Log: TrackBar.cs,v $
 // $Log: TrackBar.cs,v $
+// Revision 1.10  2004/08/13 20:55:20  jordi
+// change from wndproc to events
+//
 // Revision 1.9  2004/08/13 18:46:26  jordi
 // Revision 1.9  2004/08/13 18:46:26  jordi
 // adds timer and grap window
 // adds timer and grap window
 //
 //
@@ -110,6 +113,9 @@ namespace System.Windows.Forms
 			Scroll = null;
 			Scroll = null;
 			ValueChanged  = null;		
 			ValueChanged  = null;		
 			mouse_clickmove = false;
 			mouse_clickmove = false;
+			SizeChanged += new System.EventHandler (OnResizeTB);
+			MouseDown += new MouseEventHandler (OnMouseDownTB); 
+			MouseUp += new MouseEventHandler (OnMouseUpTB); 
 
 
 			SetStyle (ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
 			SetStyle (ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
 			SetStyle (ControlStyles.ResizeRedraw | ControlStyles.Opaque, true);			
 			SetStyle (ControlStyles.ResizeRedraw | ControlStyles.Opaque, true);			
@@ -368,19 +374,6 @@ namespace System.Windows.Forms
 
 
 			switch ((Msg) m.Msg) {
 			switch ((Msg) m.Msg) {
 				
 				
-			case Msg.WM_LBUTTONDOWN:
-				OnMouseDownTB (new MouseEventArgs (FromParamToMouseButtons ((int) m.WParam.ToInt32()), 
-						clicks, LowOrder ((int) m.LParam.ToInt32 ()), HighOrder ((int) m.LParam.ToInt32 ()), 
-						0));
-					
-				break;
-
-			case Msg.WM_LBUTTONUP:
-				OnMouseUpTB (new MouseEventArgs (FromParamToMouseButtons ((int) m.WParam.ToInt32()), 
-					clicks, LowOrder ((int) m.LParam.ToInt32 ()), HighOrder ((int) m.LParam.ToInt32 ()), 
-					0));
-					
-				break;
 				
 				
 			case Msg.WM_MOUSEMOVE: 
 			case Msg.WM_MOUSEMOVE: 
 				OnMouseMoveTB  (new MouseEventArgs (FromParamToMouseButtons ((int) m.WParam.ToInt32()), 
 				OnMouseMoveTB  (new MouseEventArgs (FromParamToMouseButtons ((int) m.WParam.ToInt32()), 
@@ -388,11 +381,7 @@ namespace System.Windows.Forms
 						LowOrder ((int) m.LParam.ToInt32 ()), HighOrder ((int) m.LParam.ToInt32 ()), 
 						LowOrder ((int) m.LParam.ToInt32 ()), HighOrder ((int) m.LParam.ToInt32 ()), 
 						0));
 						0));
 				break;
 				break;
-
-			case Msg.WM_SIZE:
-				OnResizeTB ();
-				break;
-
+			
 			case Msg.WM_PAINT: {				
 			case Msg.WM_PAINT: {				
 				PaintEventArgs	paint_event;
 				PaintEventArgs	paint_event;
 
 
@@ -482,7 +471,7 @@ namespace System.Windows.Forms
 
 
 		}		
 		}		
 
 
-		private void OnMouseUpTB (MouseEventArgs e)
+		private void OnMouseUpTB (object sender, MouseEventArgs e)
 		{	
 		{	
 			if (!Enabled) return;			
 			if (!Enabled) return;			
 
 
@@ -494,7 +483,7 @@ namespace System.Windows.Forms
 			}
 			}
 		}
 		}
 
 
-		private void OnMouseDownTB (MouseEventArgs e)
+		private void OnMouseDownTB (object sender, MouseEventArgs e)
     		{
     		{
     			if (!Enabled) return;			    			
     			if (!Enabled) return;			    			
 
 
@@ -575,8 +564,8 @@ namespace System.Windows.Forms
 			}
 			}
     		}
     		}
 
 
-		private void OnResizeTB ()
-    		{
+		private void OnResizeTB (object sender, System.EventArgs e)
+    		{			
     			if (Width <= 0 || Height <= 0)
     			if (Width <= 0 || Height <= 0)
     				return;
     				return;
 
 
@@ -637,9 +626,8 @@ namespace System.Windows.Forms
 				Refresh ();
 				Refresh ();
 
 
 			}			
 			}			
-		}			
-
-
+		}					
+		
     		#endregion // Private Methods
     		#endregion // Private Methods
 	}
 	}
 }
 }