]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/stockitem.cpp
warning about standard controls
[wxWidgets.git] / src / common / stockitem.cpp
index 5f4bc508ba557bc1b19a0bd5911fac109f8bf327..2838320cb864d9f25b0985b2de6e6bd130188263 100644 (file)
@@ -90,20 +90,17 @@ bool wxIsStockID(wxWindowID id)
 
         default:
             return false;
-    };
+    }
 }
 
-wxString wxGetStockLabel(wxWindowID id)
+wxString wxGetStockLabel(wxWindowID id, bool withCodes, wxString accelerator)
 {
-#if defined(__SMARTPHONE__) || defined(__WXPALMOS__)
-    #define STOCKITEM(stockid, label) \
-        case stockid:                 \
-            return wxStripMenuCodes(label);
-#else
+    wxString stockLabel;
+
     #define STOCKITEM(stockid, label) \
         case stockid:                 \
-            return label;
-#endif
+            stockLabel = label;       \
+            break;
 
     switch (id)
     {
@@ -165,7 +162,17 @@ wxString wxGetStockLabel(wxWindowID id)
 
     #undef STOCKITEM
 
-    return wxEmptyString;
+    if(!withCodes)
+    {
+        stockLabel = wxStripMenuCodes( stockLabel );
+    }
+    else if (!stockLabel.empty() && !accelerator.empty())
+    {
+        stockLabel += _T("\t");
+        stockLabel += accelerator;
+    }
+
+    return stockLabel;
 }
 
 bool wxIsStockLabel(wxWindowID id, const wxString& label)