]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't use mnemonic for Cancel button under MSW.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 25 Jul 2009 16:41:33 +0000 (16:41 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 25 Jul 2009 16:41:33 +0000 (16:41 +0000)
Native dialogs don't, so we shouldn't neither.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61529 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/stockitem.cpp

index bf218c5fced004ca8d595cdf0c5e94192e101f25..28d720a0471c8d46ddb8b8784ab1b5611a74638b 100644 (file)
@@ -217,6 +217,14 @@ wxString wxGetStockLabel(wxWindowID id, long flags)
                         "button labels never use accelerators" );
     }
 
+#ifdef __WXMSW__
+    // special case: the "Cancel" button shouldn't have a mnemonic under MSW
+    // for consistency with the native dialogs (which don't use any mnemonic
+    // for it because it is already bound to Esc implicitly)
+    if ( id == wxID_CANCEL )
+        flags &= ~wxSTOCK_WITH_MNEMONIC;
+#endif // __WXMSW__
+
     if ( !(flags & wxSTOCK_WITH_MNEMONIC) )
     {
         stockLabel = wxStripMenuCodes(stockLabel);