fixes to menu stock items support (patch 1547639)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41021 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-09-05 21:00:55 +00:00
parent d3c7fc996a
commit 345319d60c
10 changed files with 147 additions and 50 deletions

View File

@@ -1538,18 +1538,12 @@ void wxMenuItem::UpdateAccelInfo()
m_strAccel = m_text.AfterFirst(_T('\t'));
}
void wxMenuItem::SetText(const wxString& txt)
void wxMenuItem::SetText(const wxString& text)
{
if ( txt != m_text )
if ( text != m_text )
{
wxString text = txt;
if (text.IsEmpty())
{
wxASSERT_MSG(wxIsStockID(GetId()), wxT("A non-stock menu item with an empty label?"));
text = wxGetStockLabel(GetId(), wxSTOCK_WITH_ACCELERATOR|wxSTOCK_WITH_MNEMONIC);
}
// first call the base class version to change m_text
// (and also check if we don't have a stock menu item)
wxMenuItemBase::SetText(text);
UpdateAccelInfo();