[Mono-bugs] [Bug 82151][Nor] New - ToolStripSystemRenderer doesn't draw checked buttons as pressed.

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Jul 20 09:58:13 EDT 2007


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 rolfkvinge at ya.com.

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

--- shadow/82151	2007-07-20 09:58:13.000000000 -0400
+++ shadow/82151.tmp.1704	2007-07-20 09:58:13.000000000 -0400
@@ -0,0 +1,61 @@
+Bug#: 82151
+Product: Mono: Class Libraries
+Version: 1.2
+OS: other
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Windows.Forms
+AssignedTo: toshok at ximian.com                            
+ReportedBy: rolfkvinge at ya.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: ToolStripSystemRenderer doesn't draw checked buttons as pressed.
+
+Repro:
+
+using System.Windows.Forms;
+
+class a : Form
+{
+        static void Main ()
+        {
+                Application.Run (new a ());
+        }
+
+        public a ()
+        {
+                ToolStrip ts = new ToolStrip ();
+                ToolStripButton tb = new ToolStripButton ();
+                tb.Checked = true;
+                tb.Text = "I'm checked";
+                ts.Renderer = new ToolStripSystemRenderer ();
+                ts.Items.Add (tb);
+
+                Controls.Add (ts);
+        }
+}
+
+Patch?:
+Index: Default/ToolStripPainter.cs
+===================================================================
+--- Default/ToolStripPainter.cs (revision 82346)
++++ Default/ToolStripPainter.cs (working copy)
+@@ -44,7 +44,8 @@
+
+                        Rectangle paint_here = new Rectangle (0, 0, 
+e.Item.Width, e.Item.Height);
+
+-                       if (e.Item.Pressed)
++                       ToolStripButton button = e.Item as ToolStripButton;
++                       if (e.Item.Pressed || (button != null && 
+button.Checked))
+                                ControlPaint.DrawBorder3D (e.Graphics, 
+paint_here, Border3DStyle.SunkenOuter);
+                        else if (e.Item.Selected)
+                                ControlPaint.DrawBorder3D (e.Graphics, 
+paint_here, Border3DStyle.RaisedInner);


More information about the mono-bugs mailing list