// 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"
#include "wx/stockitem.h"
#include "wx/intl.h"
-
+#include "wx/utils.h" // for wxStripMenuCodes()
bool wxIsStockID(wxWindowID id)
{
default:
return false;
- };
+ }
}
-wxString wxGetStockLabel(wxWindowID id)
+wxString wxGetStockLabel(wxWindowID id, bool withCodes, const wxString& accelerator)
{
+ wxString stockLabel;
+
#define STOCKITEM(stockid, label) \
case stockid: \
- return label;
+ stockLabel = label; \
+ break;
switch (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)
if (label == stock)
return true;
-
+
stock.Replace(_T("&"), wxEmptyString);
if (label == stock)
return true;
-
+
return false;
}
#define STOCKITEM(wx,gtk) \
case wx: \
return gtk;
-
+
#define STOCKITEM_MISSING(wx) \
case wx: \
return NULL;
};
#undef STOCKITEM
-
+
return NULL;
}