git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67273 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2011-03-22 07:10:41 +00:00
parent 8ceae028c1
commit 32f701b096

View File

@@ -41,13 +41,14 @@ wxMenuItem::wxMenuItem(wxMenu *pParentMenu,
// In other languages there is no difference in naming the Exit/Quit menu item between MacOS and Windows guidelines // In other languages there is no difference in naming the Exit/Quit menu item between MacOS and Windows guidelines
// therefore these item must not be translated // therefore these item must not be translated
if ( wxStripMenuCodes(m_text).Upper() == wxT("EXIT") ) if (pParentMenu != NULL && !pParentMenu->GetNoEventsMode())
m_text = wxT("Quit\tCtrl+Q") ; if ( wxStripMenuCodes(m_text).Upper() == wxT("EXIT") )
m_text = wxT("Quit\tCtrl+Q") ;
m_radioGroup.start = -1; m_radioGroup.start = -1;
m_isRadioGroupStart = false; m_isRadioGroupStart = false;
wxString text = wxStripMenuCodes(m_text); wxString text = wxStripMenuCodes(m_text, (pParentMenu != NULL && pParentMenu->GetNoEventsMode()) ? wxStrip_Accel : wxStrip_All);
if (text.IsEmpty() && !IsSeparator()) if (text.IsEmpty() && !IsSeparator())
{ {
wxASSERT_MSG(wxIsStockID(GetId()), wxT("A non-stock menu item with an empty label?")); wxASSERT_MSG(wxIsStockID(GetId()), wxT("A non-stock menu item with an empty label?"));
@@ -202,7 +203,7 @@ void wxMenuItem::UpdateItemText()
if ( !m_parentMenu ) if ( !m_parentMenu )
return ; return ;
wxString text = wxStripMenuCodes(m_text); wxString text = wxStripMenuCodes(m_text, m_parentMenu != NULL && m_parentMenu->GetNoEventsMode() ? wxStrip_Accel : wxStrip_All);
if (text.IsEmpty() && !IsSeparator()) if (text.IsEmpty() && !IsSeparator())
{ {
wxASSERT_MSG(wxIsStockID(GetId()), wxT("A non-stock menu item with an empty label?")); wxASSERT_MSG(wxIsStockID(GetId()), wxT("A non-stock menu item with an empty label?"));