From 295388c894544ba76c5f2b3b1cacc90b88928f73 Mon Sep 17 00:00:00 2001 From: Alexander Olk Date: Fri, 14 Apr 2006 14:44:47 +0000 Subject: [PATCH] 2006-04-14 Alexander Olk * ThemeWin32Classic.cs: Fixed size grip drawing and updated StatusBar drawing code to reflect the size grip changes svn path=/trunk/mcs/; revision=59482 --- .../System.Windows.Forms/ChangeLog | 5 +++ .../System.Windows.Forms/ThemeWin32Classic.cs | 35 +++++++------------ 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index bdf083ee39596..b539cea0eedf3 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,8 @@ +2006-04-14 Alexander Olk + + * ThemeWin32Classic.cs: Fixed size grip drawing and updated StatusBar + drawing code to reflect the size grip changes + 2006-04-13 Gonzalo Paniagua Javier * ImageListStreamer.cs: fix handling of the mask that follows the main diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs index b04a8b258b6b4..2bcda5f20ee32 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs @@ -3060,8 +3060,11 @@ protected virtual void ScrollBar_Horizontal_Draw_ThumbMoving_Backwards( int scro } } - if (sb.SizingGrip) + if (sb.SizingGrip) { + int sg_height = (area.Height / 3) * 2; + area = new Rectangle (area.Right - sg_height - 4, area.Bottom - sg_height - 1, sg_height, sg_height); CPDrawSizeGrip (dc, ColorControl, area); + } } @@ -4962,28 +4965,16 @@ public override void CPDrawRadioButton (Graphics dc, Rectangle rectangle, Button } - public override void CPDrawSizeGrip (Graphics dc, Color backColor, Rectangle bounds) { - - Point pt = new Point (bounds.Right - 2, bounds.Bottom - 1); - - Pen pen = SystemPens.ControlDark; - - dc.DrawLine (pen, pt.X - 11, pt.Y, pt.X, pt.Y - 11); - dc.DrawLine (pen, pt.X - 10, pt.Y, pt.X, pt.Y - 10); - - dc.DrawLine (pen, pt.X - 7, pt.Y, pt.X, pt.Y - 7); - dc.DrawLine (pen, pt.X - 6, pt.Y, pt.X, pt.Y - 6); - - dc.DrawLine (pen, pt.X - 3, pt.Y, pt.X, pt.Y - 3); - dc.DrawLine (pen, pt.X - 2, pt.Y, pt.X, pt.Y - 2); - - pen = SystemPens.ControlLightLight; - - dc.DrawLine (pen, pt.X - 12, pt.Y, pt.X, pt.Y - 12); - dc.DrawLine (pen, pt.X - 8, pt.Y, pt.X, pt.Y - 8); - dc.DrawLine (pen, pt.X - 4, pt.Y, pt.X, pt.Y - 4); + public override void CPDrawSizeGrip (Graphics dc, Color backColor, Rectangle bounds) + { + Pen pen_dark = ResPool.GetPen(ControlPaint.Dark(backColor)); + Pen pen_light_light = ResPool.GetPen(ControlPaint.LightLight(backColor)); - dc.DrawLine (SystemPens.Control, pt.X - 12, pt.Y, pt.X, pt.Y); + for (int i = 2; i < bounds.Width - 2; i += 4) { + dc.DrawLine (pen_light_light, bounds.X + i, bounds.Bottom - 2, bounds.Right - 1, bounds.Y + i - 1); + dc.DrawLine (pen_dark, bounds.X + i + 1, bounds.Bottom - 2, bounds.Right - 1, bounds.Y + i); + dc.DrawLine (pen_dark, bounds.X + i + 2, bounds.Bottom - 2, bounds.Right - 1, bounds.Y + i + 1); + } } public override void CPDrawStringDisabled (Graphics dc, string s, Font font, Color color, RectangleF layoutRectangle, StringFormat format)