X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/808e3bce622d9ec7ae8c43581472ae699ed47221..4f0436e4655b628b32c4e9b27837c400e46c3746:/src/common/stockitem.cpp diff --git a/src/common/stockitem.cpp b/src/common/stockitem.cpp index 5f4bc508ba..1946b288ae 100644 --- a/src/common/stockitem.cpp +++ b/src/common/stockitem.cpp @@ -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)