2007-05-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / ThemeWin32Classic.cs
index f6225db911d93396f1ed52adf5a6d8bd84a3d874..be62bc6f707b27af3395c2baf0e9c0f28a2116de 100644 (file)
@@ -845,9 +845,12 @@ namespace System.Windows.Forms
                        checkbox_rectangle = new Rectangle(text_rectangle.X, text_rectangle.Y, checkmark_size, checkmark_size);
 
                        text_format = new StringFormat();
-                       text_format.Alignment=StringAlignment.Near;
-                       text_format.LineAlignment=StringAlignment.Center;
-                       text_format.HotkeyPrefix = HotkeyPrefix.Show;
+                       text_format.Alignment = StringAlignment.Near;
+                       text_format.LineAlignment = StringAlignment.Center;
+                       if (checkbox.ShowKeyboardCuesInternal)
+                               text_format.HotkeyPrefix = HotkeyPrefix.Show;
+                       else
+                               text_format.HotkeyPrefix = HotkeyPrefix.Hide;
 
                        /* Calculate the position of text and checkbox rectangle */
                        if (checkbox.appearance!=Appearance.Button) {
@@ -2359,16 +2362,18 @@ namespace System.Windows.Forms
                                                // adjustments to get the check-mark at the right place
                                                rect.X ++; rect.Y ++;
                                                // following logic is taken from DrawFrameControl method
+                                               int x_offset = rect.Width / 5;
+                                               int y_offset = rect.Height / 3;
                                                for (int i = 0; i < check_wd; i++) {
-                                                       dc.DrawLine (check_pen, rect.Left + check_wd / 2,
-                                                                    rect.Top + check_wd + i,
-                                                                    rect.Left + check_wd / 2 + 2 * scale,
-                                                                    rect.Top + check_wd + 2 * scale + i);
+                                                       dc.DrawLine (check_pen, rect.Left + x_offset,
+                                                                    rect.Top + y_offset + i,
+                                                                    rect.Left + x_offset + 2 * scale,
+                                                                    rect.Top + y_offset + 2 * scale + i);
                                                        dc.DrawLine (check_pen,
-                                                                    rect.Left + check_wd / 2 + 2 * scale,
-                                                                    rect.Top + check_wd + 2 * scale + i,
-                                                                    rect.Left + check_wd / 2 + 6 * scale,
-                                                                    rect.Top + check_wd - 2 * scale + i);
+                                                                    rect.Left + x_offset + 2 * scale,
+                                                                    rect.Top + y_offset + 2 * scale + i,
+                                                                    rect.Left + x_offset + 6 * scale,
+                                                                    rect.Top + y_offset - 2 * scale + i);
                                                }
                                        }
                                }
@@ -4381,7 +4386,11 @@ namespace System.Windows.Forms
                        StringFormat format = new StringFormat ();
                        format.Trimming = StringTrimming.EllipsisCharacter;
                        format.LineAlignment = StringAlignment.Center;
-                       format.HotkeyPrefix = MenuAccessKeysUnderlined ? HotkeyPrefix.Show : HotkeyPrefix.Hide;
+                       if (control.ShowKeyboardCuesInternal)
+                               format.HotkeyPrefix = HotkeyPrefix.Show;
+                       else
+                               format.HotkeyPrefix = HotkeyPrefix.Hide;
+
                        if (control.TextAlign == ToolBarTextAlign.Underneath)
                                format.Alignment = StringAlignment.Center;
                        else