Author: jpobst
Date: 2007-08-08 13:52:14 -0400 (Wed, 08 Aug 2007)
New Revision: 83684

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuStrip.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs
Log:
2007-08-08  Jonathan Pobst  <[EMAIL PROTECTED]>

        * Control.cs: If no one accepts a mnemonic, let the MenuStrip have a 
        shot at having it because Alt was pressed.
        * MenuStrip.cs: When handling Alt, don't select a SystemMenuItem, select
        the first real menu item.
        * ToolStrip.cs: Don't crash when looking for a ToolStripItem to handle
        a mnemonic if Text is null.
        [Fixes bug #82374]

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-08-08 17:35:36 UTC (rev 83683)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-08-08 17:52:14 UTC (rev 83684)
@@ -1,3 +1,13 @@
+2007-08-08  Jonathan Pobst  <[EMAIL PROTECTED]>
+
+       * Control.cs: If no one accepts a mnemonic, let the MenuStrip have a 
+       shot at having it because Alt was pressed.
+       * MenuStrip.cs: When handling Alt, don't select a SystemMenuItem, select
+       the first real menu item.
+       * ToolStrip.cs: Don't crash when looking for a ToolStripItem to handle
+       a mnemonic if Text is null.
+       [Fixes bug #82374]
+
 2007-08-08  Carlos Alberto Cortez <[EMAIL PROTECTED]>
 
        * ListView.cs: In ListViewItemCollection.AddItem, don't do a linear

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs       
2007-08-08 17:35:36 UTC (rev 83683)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs       
2007-08-08 17:52:14 UTC (rev 83684)
@@ -5439,6 +5439,11 @@
                                                return;
 #endif
                        }
+#if NET_2_0
+                       else
+                               if (ToolStripManager.ProcessMenuKey (ref m))
+                                       return;
+#endif
 
                        DefWndProc (ref m);
                }

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuStrip.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuStrip.cs     
2007-08-08 17:35:36 UTC (rev 83683)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuStrip.cs     
2007-08-08 17:52:14 UTC (rev 83684)
@@ -198,7 +198,11 @@
                {
                        // Set ourselves active and select our first item
                        ToolStripManager.SetActiveToolStrip (this);
-                       this.SelectNextToolStripItem (null, true);
+                       ToolStripItem tsi = this.SelectNextToolStripItem (null, 
true);
+                       
+                       if (tsi is MdiControlStrip.SystemMenuItem)
+                               this.SelectNextToolStripItem (tsi, true);
+                               
                        return true;
                }
                

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs     
2007-08-08 17:35:36 UTC (rev 83683)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs     
2007-08-08 17:52:14 UTC (rev 83684)
@@ -1116,7 +1116,7 @@
                        // If any item's text starts with our letter, it gets 
the message
                        if (this is MenuStrip)
                                foreach (ToolStripItem tsi in this.Items)
-                                       if (tsi.Enabled && tsi.Visible && 
tsi.Text.Length > 0 && tsi.Text.ToUpper ().StartsWith (code))
+                                       if (tsi.Enabled && tsi.Visible && 
!string.IsNullOrEmpty (tsi.Text) && tsi.Text.ToUpper ().StartsWith (code))
                                                return tsi.ProcessMnemonic 
(charCode);
 
                        return base.ProcessMnemonic (charCode);

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to