Commited FRM's stockitem patch (empty stock items).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40978 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2006-09-03 12:23:04 +00:00
parent eae0338fcb
commit ee0a94cfc2
24 changed files with 534 additions and 207 deletions

View File

@@ -26,6 +26,7 @@
#if wxUSE_MENUS
#include "wx/menu.h"
#include "wx/stockitem.h"
#ifndef WX_PRECOMP
#include "wx/dynarray.h"
@@ -1537,10 +1538,17 @@ void wxMenuItem::UpdateAccelInfo()
m_strAccel = m_text.AfterFirst(_T('\t'));
}
void wxMenuItem::SetText(const wxString& text)
void wxMenuItem::SetText(const wxString& txt)
{
if ( text != m_text )
if ( txt != 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
wxMenuItemBase::SetText(text);