2009-01-19 Ivan N. Zlatev <contact@i-nz.net>
authorIvan Zlatev <ivan@ivanz.com>
Mon, 19 Jan 2009 15:13:28 +0000 (15:13 -0000)
committerIvan Zlatev <ivan@ivanz.com>
Mon, 19 Jan 2009 15:13:28 +0000 (15:13 -0000)
* ThemeWin32Classic.cs: Draw the menu item shortcut even if the menu
item is disabled.

svn path=/trunk/mcs/; revision=123801

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs

index 52f18814af89b4c726cac86a2f2c56fdc4fad692..5e490c46bbbd164cc5106ee089642694477416d4 100644 (file)
@@ -1,3 +1,8 @@
+2009-01-19  Ivan N. Zlatev  <contact@i-nz.net>
+
+       * ThemeWin32Classic.cs: Draw the menu item shortcut even if the menu 
+       item is disabled.
+
 2009-01-19  Ivan N. Zlatev  <contact@i-nz.net>
 
        * MenuAPI.cs: Do not handle shortcuts if the menu item is disabled.
index 19dbba217aa21fc992597354fd293db3ed4c0414..bb9b9502d3e2ff4b496f575edc5778f52c8ebcfb 100644 (file)
@@ -3499,16 +3499,6 @@ namespace System.Windows.Forms
                                        brush_text,
                                        rect_text, string_format);
                                
-                               if (!item.MenuBar && item.Shortcut != Shortcut.None && item.ShowShortcut) {
-                                       string str = item.GetShortCutText ();
-                                       Rectangle rect = rect_text;
-                                       rect.X = item.XTab;
-                                       rect.Width -= item.XTab;
-
-                                       e.Graphics.DrawString (str, e.Font, brush_text,
-                                               rect, string_format_menu_shortcut);
-                               }
-                               
                                if (item.MenuBar) {
                                        Border3DStyle border_style = Border3DStyle.Adjust;
                                        if ((item.Status & DrawItemState.HotLight) != 0)
@@ -3524,11 +3514,31 @@ namespace System.Windows.Forms
                                        e.Graphics.DrawString (item.Text, e.Font, Brushes.White, 
                                                               new RectangleF(rect_text.X + 1, rect_text.Y + 1, rect_text.Width, rect_text.Height),
                                                               string_format);
+
                                }
                                
                                e.Graphics.DrawString (item.Text, e.Font, ResPool.GetSolidBrush(ColorGrayText), rect_text, string_format);
                        }
 
+                       if (!item.MenuBar && item.Shortcut != Shortcut.None && item.ShowShortcut) {
+                               string str = item.GetShortCutText ();
+                               Rectangle rect = rect_text;
+                               rect.X = item.XTab;
+                               rect.Width -= item.XTab;
+
+                               if (item.Enabled) {
+                                       e.Graphics.DrawString (str, e.Font, brush_text, rect, string_format_menu_shortcut);
+                               } else {
+                                       if ((item.Status & DrawItemState.Selected) != DrawItemState.Selected) {
+                                               e.Graphics.DrawString (str, e.Font, Brushes.White, 
+                                                                      new RectangleF(rect.X + 1, rect.Y + 1, rect.Width, rect_text.Height),
+                                                                      string_format_menu_shortcut);
+
+                                       }
+                                       e.Graphics.DrawString (str, e.Font, ResPool.GetSolidBrush(ColorGrayText), rect, string_format_menu_shortcut);
+                               }
+                       }
+
                        /* Draw arrow */
                        if (item.MenuBar == false && (item.IsPopup || item.MdiList)) {