]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't use mnemonics for OK, Cancel and Close under Windows, to follow
authorJulian Smart <julian@anthemion.co.uk>
Fri, 11 Feb 2005 09:19:34 +0000 (09:19 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 11 Feb 2005 09:19:34 +0000 (09:19 +0000)
style guidelines

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

src/msw/button.cpp

index ba86e1650b8589256e0e891ca9d3962c3fdd2431..0c07934f056f5acf6c67f4b1da73e0442da3fafe 100644 (file)
@@ -132,7 +132,18 @@ bool wxButton::Create(wxWindow *parent,
 {
     wxString label(lbl);
     if (label.empty() && wxIsStockID(id))
 {
     wxString label(lbl);
     if (label.empty() && wxIsStockID(id))
-        label = wxGetStockLabel(id);
+    {
+        // On Windows, some buttons aren't supposed to have
+        // mnemonics, so strip them out.
+        
+        label = wxGetStockLabel(id 
+#if defined(__WXMSW__) || defined(__WXWINCE__)
+                                        , ( id != wxID_OK &&
+                                            id != wxID_CANCEL &&
+                                            id != wxID_CLOSE )
+#endif
+                                );
+     }
     
     if ( !CreateControl(parent, id, pos, size, style, validator, name) )
         return false;
     
     if ( !CreateControl(parent, id, pos, size, style, validator, name) )
         return false;