Przeglądaj źródła

scrollbar enhancements and standarize on win colors defaults

svn path=/trunk/mcs/; revision=32173
Jordi Mas i Hernandez 21 lat temu
rodzic
commit
ae9abbbc8a

+ 5 - 10
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ITheme.cs

@@ -24,9 +24,12 @@
 //
 //
 //
-// $Revision: 1.7 $
+// $Revision: 1.8 $
 // $Modtime: $
 // $Log: ITheme.cs,v $
+// Revision 1.8  2004/08/10 19:21:27  jordi
+// scrollbar enhancements and standarize on win colors defaults
+//
 // Revision 1.7  2004/08/10 18:52:30  jackson
 // Implement DrawItem functionality
 //
@@ -55,15 +58,6 @@ namespace System.Windows.Forms
 {
 	internal interface ITheme
 	{
-		/* Internal colors to paint controls */
-		Color ColorLight {get;}
-		Color ColorDisabled {get;}
-		Color ColorDark {get;}
-		Color ColorMain {get;}
-		Color ColorFocus {get;}		
-		Color ColorShadow {get;}	
-		Color ColorLightTop {get;}
-
 		/* Default properties */
 		Color DefaultControlBackColor {get;}
 		Color DefaultControlForeColor {get;}
@@ -108,6 +102,7 @@ namespace System.Windows.Forms
 
 		int SizeGripWidth {get;}
 		int StatusBarHorzGapWidth {get;}
+		int ScrollBarButtonSize {get;}
 
 		/*
 			Methods that mimic ControlPaint signature and draw basic objects

+ 73 - 72
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollBar.cs

@@ -26,9 +26,12 @@
 //	Jordi Mas i Hernandez	[email protected]
 //
 //
-// $Revision: 1.4 $
+// $Revision: 1.5 $
 // $Modtime: $
 // $Log: ScrollBar.cs,v $
+// Revision 1.5  2004/08/10 19:21:27  jordi
+// scrollbar enhancements and standarize on win colors defaults
+//
 // Revision 1.4  2004/08/10 15:41:50  jackson
 // Allow control to handle buffering
 //
@@ -75,6 +78,7 @@ namespace System.Windows.Forms
 		private System.Timers.Timer holdclick_timer = new System.Timers.Timer ();
 		private int thumb_pixel_click_move;			
 		private int thumb_size = 0;		
+		private const int thumb_min_size = 8;
 		protected bool vert;
 				
 		public event ScrollEventHandler Scroll;
@@ -128,8 +132,7 @@ namespace System.Windows.Forms
 		[MonoTODO]
 		public new ImeMode ImeMode 
 		{
-			get { return ImeMode.Disable;
-throw new NotImplementedException(); }
+			get { return ImeMode.Disable;}
 			set { throw new NotImplementedException(); }
 		}
 
@@ -142,7 +145,7 @@ throw new NotImplementedException(); }
 
 				if (largeChange != value) {
 					largeChange = value;	
-					Invalidate ();
+					Refresh ();
 				}
 			}
 		}
@@ -154,6 +157,8 @@ throw new NotImplementedException(); }
 
 				if (maximum < minimum)
 					minimum = maximum;
+
+				Refresh ();
 			}
 		}
 		
@@ -164,6 +169,8 @@ throw new NotImplementedException(); }
 
 				if (minimum > maximum)
 					maximum = minimum;		
+
+				Refresh ();
 			}
 		}
 		
@@ -175,7 +182,7 @@ throw new NotImplementedException(); }
 				 
 				if (smallChange != value) {
 					smallChange = value;	
-					Invalidate ();
+					Refresh ();
 				}
 			}
 		}
@@ -199,6 +206,8 @@ throw new NotImplementedException(); }
 					
 					if (ValueChanged != null)
 						ValueChanged (this, EventArgs.Empty);
+
+					Refresh ();
 				}
 			}
 		}
@@ -238,14 +247,12 @@ throw new NotImplementedException(); }
 		
 		protected virtual void OnValueChanged (EventArgs e)
 		{					
-			if (ValueChanged != null) {
-				Console.Write ("OnValueChanged");
-				ValueChanged (this, e);
-			}
+			if (ValueChanged != null) 
+				ValueChanged (this, e);			
 		}
 
 		
-		private void draw()
+		private void Draw ()
 		{					
 			ThemeEngine.Current.DrawScrollBar (DeviceContext, paint_area, thumb_pos,
 				ref first_arrow_area, ref second_arrow_area,
@@ -257,22 +264,26 @@ throw new NotImplementedException(); }
 				
 		private void CalcThumbArea ()
 		{	
-			// Thumb area
-			
+			// Thumb area			
 			if (vert) {
 				
+				thumb_area.Height = Height - scrollbutton_height -  scrollbutton_height;
+				thumb_area.X = 0;
+				thumb_area.Y = scrollbutton_height;
+				thumb_area.Width = Width;	
+
 				if (Height < scrollbutton_height * 2)
 					thumb_size = 0;
-				else
-					if (Height < 70)
-						thumb_size = 8;
-					else
-						thumb_size = Height /10;
+				else {
+					double per =  ((double)LargeChange / (double)((1 + Maximum - Minimum)));
+					thumb_size = 1 + (int) (thumb_area.Height * per);
+					//Console.WriteLine ("size: {0} {1} {2}", thumb_size, thumb_area.Height, per);
 					
-				thumb_area.X = 0;
-				thumb_area.Y = scrollbutton_height;
-				thumb_area.Width = Width;
-				thumb_area.Height = Height - scrollbutton_height -  scrollbutton_height;			
+					if (thumb_size < thumb_min_size)
+						thumb_size = thumb_min_size; 					
+				}
+					
+							
 				pixel_per_pos = ((float)(thumb_area.Height - thumb_size) / (float) ((Maximum - Minimum - LargeChange) + 1));									
 				
 			} else	{
@@ -290,10 +301,7 @@ throw new NotImplementedException(); }
 				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) 
@@ -318,31 +326,27 @@ throw new NotImplementedException(); }
 			Called when the control is created
 		*/		
 		protected override void CreateHandle()
-		{	
-			//Console.WriteLine ("CreateHandle()");			
-			
+		{				
 			base.CreateHandle();	// Let control.cs create the underlying Window							
 			
-			scrollbutton_height = 17;
-			scrollbutton_width = 17;
-
-			CreateBuffers (Width, Height);
-
-			//Console.WriteLine ("OnCreate: Width " + Width + " Height " +  Height);
-			CalcThumbArea ();
-			UpdatePos (Value, true);
-			draw();					
+			scrollbutton_height = ThemeEngine.Current.ScrollBarButtonSize;
+			scrollbutton_width = ThemeEngine.Current.ScrollBarButtonSize;
+
+			CreateBuffers (Width, Height);			
 			
+			CalcThumbArea ();
+			UpdatePos (Value, true);					
 		}
 		
 		protected override void OnPaint (PaintEventArgs pevent)
-		{	
+		{				
 			if (Width <= 0 || Height <=  0 || Visible == false)
     				return;
 										
 			/* Copies memory drawing buffer to screen*/		
-			draw();
+			Draw ();
 			pevent.Graphics.DrawImage (ImageBuffer, 0, 0);			
+
 		}	
 		
 		/* Disable background painting to avoid flickering, since we do our painting*/
@@ -366,13 +370,11 @@ throw new NotImplementedException(); }
     				if (newPos > maximum)
     					position = maximum;    			
     					else
-    						position = newPos;  						    			    			    						
-    						
-    			//Console.WriteLine ("event : {0} {1} {2}", Scroll != null, position, old);    			
-    			
+    						position = newPos;
+    			    			
 			if (update_trumbpos) 
 				if (vert)
-					UpdateThumbPos (thumb_area.Y + (int)(((float)(position - Minimum)) * pixel_per_pos), false);							    			
+					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);							    			
 					
@@ -394,7 +396,7 @@ throw new NotImplementedException(); }
 	    				else
 	    					thumb_pos.Y = pixel;		 
 				
-				thumb_pos = new Rectangle (0, thumb_pos.Y, Width, thumb_size);								
+				thumb_pos = new Rectangle (0, thumb_pos.Y, ThemeEngine.Current.ScrollBarButtonSize, thumb_size);
 				new_pos = (float) (thumb_pos.Y - thumb_area.Y);
 				new_pos = new_pos / pixel_per_pos;
 			} else	{
@@ -407,7 +409,7 @@ throw new NotImplementedException(); }
 	    				else
 	    					thumb_pos.X = pixel;		 
 				
-				thumb_pos = new Rectangle (thumb_pos.X, 0, thumb_size, Height);								
+				thumb_pos = new Rectangle (thumb_pos.X, 0, thumb_size, ThemeEngine.Current.ScrollBarButtonSize);								
 				new_pos = (float) (thumb_pos.X - thumb_area.X);
 				new_pos = new_pos / pixel_per_pos;
 			}
@@ -425,14 +427,12 @@ throw new NotImplementedException(); }
 				SmallDecrement();
 				
 			if ((secondbutton_state & ButtonState.Pushed) == ButtonState.Pushed)				
-				SmallIncrement();
-				
-			Invalidate ();
+				SmallIncrement();				
+			
 		}
     		
     		private void OnFirstClickTimer (Object source, ElapsedEventArgs e)
 		{
-			//Console.WriteLine ("OnFirstClickTimer");
 			firstclick_timer.Enabled = false;			
 			holdclick_timer.Elapsed += new ElapsedEventHandler (OnHoldClickTimer);
 		        holdclick_timer.Interval = 50;
@@ -444,13 +444,13 @@ throw new NotImplementedException(); }
     			if (!first_arrow_area.Contains (new Point (e.X, e.Y)) && 
     				((firstbutton_state & ButtonState.Pushed) == ButtonState.Pushed)) {				    				
 				firstbutton_state = ButtonState.Normal;				
-				Invalidate ();
+				Refresh ();
 			}			
 			
 			if (!second_arrow_area.Contains (new Point (e.X, e.Y)) && 
     				((secondbutton_state & ButtonState.Pushed) == ButtonState.Pushed)) {				    				
 				secondbutton_state = ButtonState.Normal;				
-				Invalidate ();
+				Refresh ();
 			}			
 			
 			if (thumb_pos.Contains (new Point (e.X, e.Y)) && thumb_pressed) {				    				
@@ -472,12 +472,12 @@ throw new NotImplementedException(); }
 				//System.Console.WriteLine ("OnMouseMove thumb "+ e.Y 
 				//	+ " clickpos " + thumb_pixel_click_move   + " pos:" + thumb_pos.Y);    								
 					
-				Invalidate ();
+				Refresh ();
 			}						
 			
 			if (!thumb_pos.Contains (new Point (e.X, e.Y)) && thumb_pressed) {				
     				thumb_pressed = false;				
-				Invalidate ();
+				Refresh ();
 			}
 			
     		}	    		
@@ -490,17 +490,17 @@ throw new NotImplementedException(); }
     			
     			if (first_arrow_area.Contains (point)) {				
 				firstbutton_state = ButtonState.Pushed;
-				Invalidate ();
+				Refresh ();
 			}
 			
 			if (second_arrow_area.Contains (point)) {
 				secondbutton_state = ButtonState.Pushed;				
-				Invalidate ();
+				Refresh ();
 			}
 			
 			if (thumb_pos.Contains (point)) {								
 				thumb_pressed = true;				
-				Invalidate ();
+				Refresh ();
 				if (vert)
 					thumb_pixel_click_move = e.Y;
 				else
@@ -519,9 +519,8 @@ throw new NotImplementedException(); }
 							LargeIncrement();
 						else
 							LargeDecrement();
-					}				
-						
-					Invalidate ();
+					}							
+					
 				}			
 			
 			
@@ -543,7 +542,8 @@ throw new NotImplementedException(); }
 				UpdateThumbPos (thumb_pos.Y + SmallChange, true);
 			else
 				UpdateThumbPos (thumb_pos.X + SmallChange, true);
-				
+
+			Refresh ();				
 			fire_Scroll (new ScrollEventArgs (ScrollEventType.SmallIncrement, position));
 			fire_Scroll (new ScrollEventArgs (ScrollEventType.EndScroll, position));
     		}
@@ -554,7 +554,8 @@ throw new NotImplementedException(); }
 				UpdateThumbPos (thumb_pos.Y - SmallChange, true);
 			else
 				UpdateThumbPos (thumb_pos.X - SmallChange, true);		
-				
+
+			Refresh ();				
 			fire_Scroll (new ScrollEventArgs (ScrollEventType.SmallDecrement, position));
 			fire_Scroll (new ScrollEventArgs (ScrollEventType.EndScroll, position));
     		}
@@ -566,6 +567,7 @@ throw new NotImplementedException(); }
 			else
 				UpdateThumbPos (thumb_pos.X + LargeChange, true);
 				
+			Refresh ();
 			fire_Scroll (new ScrollEventArgs (ScrollEventType.LargeIncrement, position));
 			fire_Scroll (new ScrollEventArgs (ScrollEventType.EndScroll, position));
     		}
@@ -577,6 +579,7 @@ throw new NotImplementedException(); }
 			else
 				UpdateThumbPos (thumb_pos.X - LargeChange, true);		
 				
+			Refresh ();
 			fire_Scroll (new ScrollEventArgs (ScrollEventType.LargeDecrement, position));
 			fire_Scroll (new ScrollEventArgs (ScrollEventType.EndScroll, position));
     		}
@@ -587,16 +590,14 @@ throw new NotImplementedException(); }
     			if (first_arrow_area.Contains (new Point (e.X, e.Y))) {				
     				
 				firstbutton_state = ButtonState.Normal;												
-				SmallDecrement ();				
-				Invalidate ();
+				SmallDecrement ();								
 				holdclick_timer.Enabled = false;
 			}
 			
 			if (second_arrow_area.Contains (new Point (e.X, e.Y))) {				
 				
 				secondbutton_state = ButtonState.Normal;						
-				SmallIncrement ();	
-				Invalidate ();
+				SmallIncrement ();					
 				holdclick_timer.Enabled = false;
 			}
 			
@@ -606,7 +607,7 @@ throw new NotImplementedException(); }
 				fire_Scroll (new ScrollEventArgs (ScrollEventType.EndScroll, position));
 				
 				thumb_pressed = false;				
-				Invalidate ();
+				Refresh ();
 			}
     		}
     		
@@ -616,22 +617,22 @@ throw new NotImplementedException(); }
 			switch (key.KeyCode){
 			case Keys.Up:
 			{
-				SmallDecrement();					
+				SmallDecrement ();
 				break;	
 			}
 			case Keys.Down:
 			{
-				SmallIncrement();					
+				SmallIncrement ();
 				break;	
 			}
 			case Keys.PageUp:
 			{
-				LargeDecrement();					
+				LargeDecrement ();
 				break;	
 			}
 			case Keys.PageDown:
 			{
-				LargeIncrement();					
+				LargeIncrement ();
 				break;	
 			}
 			default:
@@ -642,7 +643,7 @@ throw new NotImplementedException(); }
 		
 		protected void UpdateScrollInfo ()
 		{
-			Invalidate ();
+			Refresh ();
 		}
 	 }
 }

+ 71 - 106
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs

@@ -25,9 +25,12 @@
 //
 //
 //
-// $Revision: 1.15 $
+// $Revision: 1.16 $
 // $Modtime: $
 // $Log: ThemeWin32Classic.cs,v $
+// Revision 1.16  2004/08/10 19:21:27  jordi
+// scrollbar enhancements and standarize on win colors defaults
+//
 // Revision 1.15  2004/08/10 18:52:30  jackson
 // Implement DrawItem functionality
 //
@@ -82,26 +85,20 @@ using System.Drawing.Imaging;
 namespace System.Windows.Forms
 {
 	internal class ThemeWin32Classic : ITheme
-	{
-		static private SolidBrush br_light;
-		static private SolidBrush br_main;
-		static private SolidBrush br_dark;		
+	{		
 		static private Pen pen_ticks;
 		static private Pen pen_disabled;
 		static private SolidBrush br_arrow;
 		static private SolidBrush br_disabled;
-		static private HatchBrush br_focus;
-		static private SolidBrush br_shadow;
-		static private SolidBrush br_bar;
-		static private Pen pen_shadow;
-		static private HatchBrush br_backgr;
-		static private SolidBrush br_lighttop;
+		static private HatchBrush br_focus;		
+		static private SolidBrush br_progressbarblock;		
 		static private Pen pen_arrow;
 
 		static private SolidBrush br_buttonface;
 		static private SolidBrush br_buttonshadow;
 		static private SolidBrush br_buttondkshadow;
 		static private SolidBrush br_buttonhilight;		
+		static private SolidBrush br_buttonlight;
 		static private Pen pen_buttonshadow;
 		static private Pen pen_buttondkshadow;
 		static private Pen pen_buttonhilight;
@@ -113,32 +110,25 @@ namespace System.Windows.Forms
 		/* Cache */
 		static private SolidBrush label_br_fore_color;
 		static private SolidBrush label_br_back_color;		
+		static private HatchBrush br_scrollbar_backgr;
 
 		public ThemeWin32Classic ()
 		{
 			label_br_fore_color = null;
 			label_br_back_color = null;
+			br_scrollbar_backgr = null;
  
-			br_light = new SolidBrush (ColorLight);
-			br_main = new SolidBrush (ColorMain);
-			br_dark = new SolidBrush (ColorDark);
-			pen_ticks = new Pen (Color.Black);
-			pen_disabled = new Pen (ColorDisabled);
-			br_arrow = new SolidBrush (Color.Black);
-			br_disabled = new SolidBrush (ColorDisabled);
-			br_focus = new HatchBrush (HatchStyle.Percent50, ColorMain, ColorFocus);
-			br_shadow = new SolidBrush (ColorShadow);			
-			br_backgr = new HatchBrush (HatchStyle.Percent50, ColorLight, ColorMain);
-			pen_shadow = new Pen (ColorShadow);
-			br_lighttop = new SolidBrush (ColorLightTop);
+			pen_ticks = new Pen (Color.Black);			
+			br_arrow = new SolidBrush (Color.Black);			
+			br_focus = new HatchBrush (HatchStyle.Percent50, ColorButtonFace, Color.Black);
 			pen_arrow = new Pen (Color.Black);
-			br_bar = new  SolidBrush (Color.FromArgb (255, 49, 106, 197));
-			
+			br_progressbarblock = new  SolidBrush (Color.FromArgb (255, 49, 106, 197));			
 
 			br_buttonface = new SolidBrush (ColorButtonFace);
 			br_buttonshadow = new SolidBrush (ColorButtonShadow);
 			br_buttondkshadow = new SolidBrush (ColorButtonDkShadow);
 			br_buttonhilight = new SolidBrush (ColorButtonHilight);
+			br_buttonlight = new SolidBrush (ColorButtonLight);
 			pen_buttonshadow = new Pen (ColorButtonShadow);
 			pen_buttondkshadow = new Pen (ColorButtonDkShadow);
 			pen_buttonhilight = new Pen (ColorButtonHilight);
@@ -147,36 +137,6 @@ namespace System.Windows.Forms
 
 			default_font =	new Font (FontFamily.GenericSansSerif, 8.25f);
 		}
-
-		/* Internal colors to paint controls */
-		public Color ColorLight {
-			get {return Color.FromArgb (255, 255, 255, 255);}
-		}
-
-		public Color ColorDisabled {
-			get {return Color.FromArgb (255, 172, 168, 153);}
-		}
-
-		public Color ColorDark {
-			get {return Color.FromArgb (255, 113, 111, 100);}
-		}
-
-		public Color ColorMain {
-			get {return Color.FromArgb (255, 236, 233, 216);}
-		}
-
-		public Color ColorFocus {
-			get {return Color.Black;}
-		}
-
-		public Color ColorShadow {
-			get {return Color.FromArgb (255, 172, 168, 153);}
-		}
-
-		public Color ColorLightTop {
-			get {return Color.FromArgb (255, 241, 239, 226);}
-		}
-
 		/* Windows System Colors. Based on Wine */
 		public Color ColorScrollbar {
 			get {return Color.FromArgb (255, 192, 192, 192);}
@@ -322,6 +282,10 @@ namespace System.Windows.Forms
 			get { return 3; }
 		}
 
+		public int ScrollBarButtonSize {
+			get { return 16; }
+		}
+
 		private enum DrawFrameControlStates
 		{
 			ButtonCheck		= 0x0000,
@@ -542,12 +506,12 @@ namespace System.Windows.Forms
 					Pen	pen;
 
 					if ((state & ButtonState.Inactive)!=0) {
-						pen=new Pen(SystemColors.ControlLightLight, lineWidth);
-						DrawCaptionHelper(graphics, SystemColors.ControlLightLight, pen, lineWidth, 1, captionRect, button);
+						pen=new Pen(ColorButtonHilight, lineWidth);
+						DrawCaptionHelper(graphics, ColorButtonHilight, pen, lineWidth, 1, captionRect, button);
 						pen.Dispose();
 
-						pen=new Pen(SystemColors.ControlDark, lineWidth);
-						DrawCaptionHelper(graphics, SystemColors.ControlDark, pen, lineWidth, 0, captionRect, button);
+						pen=new Pen(ColorButtonShadow, lineWidth);
+						DrawCaptionHelper(graphics, ColorButtonShadow, pen, lineWidth, 0, captionRect, button);
 						pen.Dispose();
 						return;
 					} else {
@@ -563,9 +527,9 @@ namespace System.Windows.Forms
 				case CaptionButton.Minimize:
 				case CaptionButton.Restore: {
 					if ((state & ButtonState.Inactive)!=0) {
-						DrawCaptionHelper(graphics, SystemColors.ControlLightLight, SystemPens.ControlLightLight, lineWidth, 1, captionRect, button);
+						DrawCaptionHelper(graphics, ColorButtonHilight, SystemPens.ControlLightLight, lineWidth, 1, captionRect, button);
 
-						DrawCaptionHelper(graphics, SystemColors.ControlDark, SystemPens.ControlDark, lineWidth, 0, captionRect, button);
+						DrawCaptionHelper(graphics, ColorButtonShadow, SystemPens.ControlDark, lineWidth, 0, captionRect, button);
 						return;
 					} else {
 						DrawCaptionHelper(graphics, SystemColors.ControlText, SystemPens.ControlText, lineWidth, 0, captionRect, button);
@@ -613,13 +577,13 @@ namespace System.Windows.Forms
 			Rectangle		rect;
 
 			if ((state & ButtonState.Checked)!=0) {
-				HatchBrush	hatchBrush=new HatchBrush(HatchStyle.Percent50, SystemColors.ControlLight, SystemColors.ControlLightLight);
+				HatchBrush	hatchBrush=new HatchBrush(HatchStyle.Percent50, SystemColors.ControlLight, ColorButtonHilight);
 				graphics.FillRectangle(hatchBrush,rectangle);
 				hatchBrush.Dispose();
 			}
 
 			if ((state & ButtonState.Flat)!=0) {
-				ControlPaint.DrawBorder(graphics, rectangle, SystemColors.ControlDark, ButtonBorderStyle.Solid);
+				ControlPaint.DrawBorder(graphics, rectangle, ColorButtonShadow, ButtonBorderStyle.Solid);
 			} else {
 				if ((state & (ButtonState.Pushed | ButtonState.Checked))!=0) {
 					DrawBorder3D(graphics, rectangle, Border3DStyle.Sunken, Border3DSide.Left | Border3DSide.Top | Border3DSide.Right | Border3DSide.Bottom);
@@ -966,8 +930,9 @@ namespace System.Windows.Forms
 		/* Scroll button: regular button + direction arrow */
 		public void DrawScrollButton (Graphics dc, Rectangle area, ScrollButton type, ButtonState state)
 		{
-			bool enabled = (state == ButtonState.Inactive) ? false: true;
-			DrawScroolButtonPrimitive (dc, area, state);
+			bool enabled = (state == ButtonState.Inactive) ? false: true;			
+					
+			DrawScrollButtonPrimitive (dc, area, state);
 
 			/* Paint arrows */
 			switch (type) {
@@ -1106,8 +1071,10 @@ namespace System.Windows.Forms
 			bool enabled, bool vertical)
 		{
 
-			if (vertical) {
-				scrollbutton_width = area.Width;
+			if (br_scrollbar_backgr == null)
+				br_scrollbar_backgr = new HatchBrush (HatchStyle.Percent50, ColorButtonHilight, ColorButtonFace);
+
+			if (vertical) {		
 
 				first_arrow_area.X = first_arrow_area. Y = 0;
 				first_arrow_area.Width = scrollbutton_width;
@@ -1120,16 +1087,14 @@ namespace System.Windows.Forms
 
 				/* Buttons */
 				DrawScrollButton (dc, first_arrow_area, ScrollButton.Up, first_arrow);
-				DrawScrollButton (dc, second_arrow_area, ScrollButton.Down, second_arrow);
+				DrawScrollButton (dc, second_arrow_area, ScrollButton.Down, second_arrow);				
 
 				/* Background */
-				dc.FillRectangle (br_backgr, 0,  scrollbutton_height, area.Width,
+				dc.FillRectangle (br_scrollbar_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;
@@ -1139,20 +1104,18 @@ namespace System.Windows.Forms
 				second_arrow_area.Width = scrollbutton_width;
 				second_arrow_area.Height = scrollbutton_height;
 
-
 				/* Buttons */
 				DrawScrollButton (dc, first_arrow_area, ScrollButton.Left, first_arrow );
 				DrawScrollButton (dc, second_arrow_area, ScrollButton.Right, second_arrow);
 
 				/* Background */
-				dc.FillRectangle (br_backgr, scrollbutton_width, 0, area.Width - (scrollbutton_width * 2),
+				dc.FillRectangle (br_scrollbar_backgr, scrollbutton_width, 0, area.Width - (scrollbutton_width * 2),
 				 	area.Height);
 			}
 
 			/* Thumbail */
 			if (enabled)
-				DrawScroolButtonPrimitive (dc, thumb_pos, ButtonState.Normal);
-
+				DrawScrollButtonPrimitive (dc, thumb_pos, ButtonState.Normal);			
 		}
 
 		/*
@@ -1486,7 +1449,7 @@ namespace System.Windows.Forms
 			/* Draw background*/
 
 			while ((x - client_area.X) < barpos_pixels) {
-				dc.FillRectangle (br_bar, x, client_area.Y, block_width, client_area.Height);
+				dc.FillRectangle (br_progressbarblock, x, client_area.Y, block_width, client_area.Height);
 				x  = x + increment;
 			}
 
@@ -1499,8 +1462,7 @@ namespace System.Windows.Forms
 		public void DrawLabel (Graphics dc, Rectangle area, BorderStyle border_style, string text, 
 			Color fore_color, Color back_color, Font font, StringFormat string_format, bool Enabled)
 
-		{				
-
+		{
 			if (label_br_fore_color == null || label_br_fore_color.Color != fore_color) 
 				label_br_fore_color = new SolidBrush (fore_color);
 
@@ -1509,9 +1471,7 @@ namespace System.Windows.Forms
 
 			dc.FillRectangle (label_br_back_color, area);
 			
-			DrawBorderStyle (dc, area, border_style);
-
-			Console.WriteLine ("{0} - {1} - {2} - {3} - {4}",text, font, label_br_fore_color.Color, area, string_format);
+			DrawBorderStyle (dc, area, border_style);		
 
 			if (Enabled)
 				dc.DrawString (text, font, label_br_fore_color, area, string_format);
@@ -1551,7 +1511,7 @@ namespace System.Windows.Forms
 			}
 
 			if (sb.SizingGrip)
-				DrawSizeGrip (dc, ColorMain, area);
+				DrawSizeGrip (dc, ColorButtonFace, area);
 
 		}
 
@@ -1932,7 +1892,8 @@ namespace System.Windows.Forms
 		}
 
 		[MonoTODO("Finish drawing code for Caption, Menu and Scroll")]
-		private void DrawFrameControl(Graphics graphics, Rectangle rectangle, DrawFrameControlTypes Type, DrawFrameControlStates State) {
+		private void DrawFrameControl(Graphics graphics, Rectangle rectangle, DrawFrameControlTypes Type, DrawFrameControlStates State) 
+{
 			switch(Type) {
 				case DrawFrameControlTypes.Button: {
 					if ((State & DrawFrameControlStates.ButtonPush)!=0) {
@@ -1946,7 +1907,7 @@ namespace System.Windows.Forms
 						if ((State & DrawFrameControlStates.Pushed)!=0) {
 							DrawBorder3D(graphics, rectangle, Border3DStyle.Sunken, Border3DSide.Left | Border3DSide.Top | Border3DSide.Right | Border3DSide.Bottom);
 						} else if ((State & DrawFrameControlStates.Flat)!=0) {
-							ControlPaint.DrawBorder(graphics, rectangle, SystemColors.ControlDark, ButtonBorderStyle.Solid);
+							ControlPaint.DrawBorder(graphics, rectangle, ColorButtonShadow, 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);
@@ -1954,7 +1915,7 @@ namespace System.Windows.Forms
 							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			penFatDark	= new Pen(ColorButtonShadow, 2);
 						Pen			penFatLight	= new Pen(SystemColors.ControlLight, 2);
 						int			lineWidth;
 
@@ -1999,7 +1960,7 @@ namespace System.Windows.Forms
 
 						/* Draw the sunken frame */
 						if ((State & DrawFrameControlStates.Flat)!=0) {
-							ControlPaint.DrawBorder(graphics, rectangle, SystemColors.ControlDark, ButtonBorderStyle.Solid);
+							ControlPaint.DrawBorder(graphics, rectangle, ColorButtonShadow, ButtonBorderStyle.Solid);
 						} else {
 							DrawBorder3D(graphics, rectangle, Border3DStyle.Sunken, Border3DSide.Left | Border3DSide.Top | Border3DSide.Right | Border3DSide.Bottom);
 						}
@@ -2044,42 +2005,46 @@ namespace System.Windows.Forms
 			}
 		}
 
-		/* Generic button */
-		static public void DrawScroolButtonPrimitive (Graphics dc, Rectangle area, ButtonState state)
+		/* Generic scroll button */
+		static public void DrawScrollButtonPrimitive (Graphics dc, Rectangle area, ButtonState state)
 		{
 			if ((state & ButtonState.Pushed) == ButtonState.Pushed) {
-
-				dc.FillRectangle (br_main, area.X + 1,
+				dc.FillRectangle (br_buttonface, area.X + 1,
 					area.Y + 1, area.Width - 2 , area.Height - 2);
 
-				dc.DrawRectangle (pen_shadow, area.X,
+				dc.DrawRectangle (pen_buttonshadow, 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 (new SolidBrush (Color.Blue), area);
+				
+				dc.FillRectangle (br_buttonface, area.X, area.Y, area.Width, 1);
+				dc.FillRectangle (br_buttonface, area.X, area.Y, 1, area.Height);
 
-				dc.FillRectangle (br_shadow, area.X, area.Y + area.Height - 1,
-					area.Width - 1, 1);
+				dc.FillRectangle (br_buttonhilight, area.X + 1, area.Y + 1, area.Width - 1, 1);
+				dc.FillRectangle (br_buttonhilight, area.X + 1, area.Y + 2, 1,
+					area.Height - 4);
 
-				dc.FillRectangle (br_dark, area.X, area.Y + area.Height,
-					area.Width, 1);
+				dc.FillRectangle (br_buttonshadow, area.X + 1, area.Y + area.Height - 2,
+					area.Width - 2, 1);
 
-				dc.FillRectangle (br_shadow, area.X + area.Width - 1,
-					area.Y + 1, 1, area.Height);
+				dc.FillRectangle (br_buttondkshadow, area.X, area.Y + area.Height -1,
+					area.Width , 1);
 
-				dc.FillRectangle (br_dark, area.X + area.Width,
-					area.Y, 1, area.Height);
+				dc.FillRectangle (br_buttonshadow, area.X + area.Width - 2,
+					area.Y + 1, 1, area.Height -3);
 
-				dc.FillRectangle (br_main, area.X + 1,
-					area.Y + 2, area.Width - 2, area.Height - 3);
+				dc.FillRectangle (br_buttondkshadow, area.X + area.Width -1,
+					area.Y, 1, area.Height - 1);
+
+				dc.FillRectangle (br_buttonface, area.X + 2,
+					area.Y + 2, area.Width - 4, area.Height - 4);
 			}
 		}
 
+		
 		private void DrawBorderStyle (Graphics dc, Rectangle area, BorderStyle border_style)
 		{
 			switch (border_style){