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