X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/06442f70998e485df47a6524081bd4aa77d0959d..81f90336020eab200e8f09a6b726c7ec49439b68:/src/common/stockitem.cpp diff --git a/src/common/stockitem.cpp b/src/common/stockitem.cpp index 1a75aed568..1946b288ae 100644 --- a/src/common/stockitem.cpp +++ b/src/common/stockitem.cpp @@ -30,7 +30,7 @@ #include "wx/stockitem.h" #include "wx/intl.h" - +#include "wx/utils.h" // for wxStripMenuCodes() bool wxIsStockID(wxWindowID id) { @@ -93,17 +93,14 @@ bool wxIsStockID(wxWindowID id) }; } -wxString wxGetStockLabel(wxWindowID id) +wxString wxGetStockLabel(wxWindowID id, bool withCodes, wxString accelerator) { -#ifdef __SMARTPHONE__ - #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)