Kaynağa Gözat

- Removed Redraw (), we get it from ButtonBase.
- Implemented Paint (), to do class specific painting.

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

Ravindra 21 yıl önce
ebeveyn
işleme
ea2da33088

+ 11 - 4
mcs/class/Managed.Windows.Forms/System.Windows.Forms/CheckBox.cs

@@ -25,6 +25,10 @@
 //
 //
 // $Log: CheckBox.cs,v $
+// Revision 1.9  2004/10/15 13:25:50  ravindra
+// 	- Removed Redraw (), we get it from ButtonBase.
+// 	- Implemented Paint (), to do class specific painting.
+//
 // Revision 1.8  2004/10/13 02:46:22  pbartok
 // - Fix from John BouAntoun: Now properly sets the Appearance property
 //
@@ -282,10 +286,13 @@ namespace System.Windows.Forms {
 		#endregion	// Events
 
 		#region	Internal drawing code
-		internal override void Redraw() {
-			ThemeEngine.Current.DrawCheckBox(this.DeviceContext, this.ClientRectangle, this);
-			Refresh();
-		}
+		internal override void Paint (PaintEventArgs pe) {
+			if (redraw) {
+				ThemeEngine.Current.DrawCheckBox (this.DeviceContext, this.ClientRectangle, this);
+				redraw = false;
+			}
+			pe.Graphics.DrawImage (this.ImageBuffer, pe.ClipRectangle, pe.ClipRectangle, GraphicsUnit.Pixel);
+		}
 		#endregion	// Internal drawing code
 	}
 }

+ 11 - 3
mcs/class/Managed.Windows.Forms/System.Windows.Forms/RadioButton.cs

@@ -23,6 +23,10 @@
 //	Peter Bartok	[email protected]
 //
 // $Log: RadioButton.cs,v $
+// Revision 1.7  2004/10/15 13:25:50  ravindra
+// 	- Removed Redraw (), we get it from ButtonBase.
+// 	- Implemented Paint (), to do class specific painting.
+//
 // Revision 1.6  2004/10/05 18:23:54  jackson
 // Fix ctor
 //
@@ -287,9 +291,13 @@ namespace System.Windows.Forms {
 		#endregion	// Events
 
 		#region Internal Drawing Code
-		internal override void Redraw() {
-			ThemeEngine.Current.DrawRadioButton(this.DeviceContext, this.ClientRectangle, this);
-			Refresh();
+		internal override void Paint (PaintEventArgs pe) {
+			if (redraw) {
+				ThemeEngine.Current.DrawRadioButton(this.DeviceContext, this.ClientRectangle, this);
+				redraw = false;
+			}
+
+			pe.Graphics.DrawImage (this.ImageBuffer, pe.ClipRectangle, pe.ClipRectangle, GraphicsUnit.Pixel);
 		}
 		#endregion	// Internal Drawing Code
 	}