]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/stockitem.cpp
Change the name of the smart pointer so that wxZipOutputStreamPtr is free
[wxWidgets.git] / src / common / stockitem.cpp
index 5f4bc508ba557bc1b19a0bd5911fac109f8bf327..1946b288aed0355ea5eea4d0cb049604c579fe36 100644 (file)
@@ -93,17 +93,14 @@ bool wxIsStockID(wxWindowID id)
     };
 }
 
-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)