X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/808e3bce622d9ec7ae8c43581472ae699ed47221..6270539bcf24f2ec32150a09f8aad383f5de0671:/src/common/stockitem.cpp diff --git a/src/common/stockitem.cpp b/src/common/stockitem.cpp index 5f4bc508ba..c1b7d71ad8 100644 --- a/src/common/stockitem.cpp +++ b/src/common/stockitem.cpp @@ -17,10 +17,6 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "stockitem.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -90,20 +86,17 @@ bool wxIsStockID(wxWindowID id) default: return false; - }; + } } -wxString wxGetStockLabel(wxWindowID id) +wxString wxGetStockLabel(wxWindowID id, bool withCodes, const 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 +158,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)