[Mono-bugs] [Bug 52674][Wis] New - SystemColors values are hardcoded

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 7 Jan 2004 23:56:57 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by rkumar@novell.com.

http://bugzilla.ximian.com/show_bug.cgi?id=52674

--- shadow/52674	2004-01-07 23:56:57.000000000 -0500
+++ shadow/52674.tmp.18121	2004-01-07 23:56:57.000000000 -0500
@@ -0,0 +1,103 @@
+Bug#: 52674
+Product: Mono/Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: System.Drawing.
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: rkumar@novell.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: SystemColors values are hardcoded
+
+Description of Problem:
+SystemColors values change with themes on Windows. But, SystemColors has
+hardcoded values.
+
+Steps to reproduce the problem:
+1. Compile and run the below code on windows under different themes,
+
+using System;
+
+using System.Drawing;
+
+
+
+namespace MonoTests.System.Drawing {
+
+	
+
+public class TestSystemColors {
+
+		
+
+	public static void Main ()
+
+	{
+
+	// SystemColors change with theme
+	Color controlColor = SystemColors.Control;
+
+	Console.WriteLine("Controlcolor: A={0},R={1},B={2},G={3}",
+	controlColor.A,controlColor.R,controlColor.G,controlColor.B);
+
+
+
+	// a non-system color
+
+	Color redColor = Color.Red;
+
+	Console.WriteLine("Redcolor: A={0},R={1},B={2},G={3}",
+
+		 redColor.A,redColor.R,redColor.G,redColor.B);
+
+	}
+
+}
+
+}
+
+Actual Results:
+Values are always same.
+
+[ravi@ravi System.Drawing]$ mono TestSystemColors.exe
+Controlcolor: A=255,R=192,B=192,G=192
+Redcolor: A=255,R=255,B=0,G=0
+
+Expected Results:
+SystemColor values should change as they do on windows.
+
+How often does this happen? 
+Always.
+
+Additional Information:
+Color values are hardcoded in SystemColors.cs, their values must be taken
+from the desktop theme instead.
+
+/////////////// RESULTS WITH CLASSIC THEME /////////////////
+
+//
+
+// E:\>TestSystemColors.exe
+
+// Controlcolor: A=255,R=212,B=208,G=200
+
+// Redcolor: A=255,R=255,B=0,G=0
+
+
+
+/////////////// RESULTS WITH XP THEME /////////////////
+
+
+
+// E:\>TestSystemColors.exe
+
+// Controlcolor: A=255,R=236,B=233,G=216
+
+// Redcolor: A=255,R=255,B=0,G=0