X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5ce61d9fd2a225e5579c07a60a71bd481a282d99..c5fc899bf29ca7d9c4e2a070e28228b430a68dd3:/src/common/menucmn.cpp diff --git a/src/common/menucmn.cpp b/src/common/menucmn.cpp index 62118b53b5..b272d1483d 100644 --- a/src/common/menucmn.cpp +++ b/src/common/menucmn.cpp @@ -98,6 +98,8 @@ static inline bool CompareAccelString(const wxString& str, const wxChar *accel) // specified wxAcceleratorEntry *wxGetAccelFromString(const wxString& label) { + // wxPrintf( wxT("label %s\n"), label.c_str() ); + // check for accelerators: they are given after '\t' int posTab = label.Find(wxT('\t')); if ( posTab != wxNOT_FOUND ) { @@ -276,6 +278,8 @@ void wxMenuItemBase::SetAccel(wxAcceleratorEntry *accel) #endif // wxUSE_ACCEL +bool wxMenuBase::ms_locked = true; + // ---------------------------------------------------------------------------- // wxMenu ctor and dtor // ---------------------------------------------------------------------------- @@ -306,11 +310,6 @@ void wxMenuBase::AddSubMenu(wxMenu *submenu) { wxCHECK_RET( submenu, _T("can't add a NULL submenu") ); - if ( m_menuBar ) - { - submenu->Attach(m_menuBar); - } - submenu->SetParent((wxMenu *)this); } @@ -625,6 +624,13 @@ bool wxMenuBase::SendEvent(int id, int checked) // wxMenu attaching/detaching to/from menu bar // ---------------------------------------------------------------------------- +wxMenuBar* wxMenuBase::GetMenuBar() const +{ + if(GetParent()) + return GetParent()->GetMenuBar(); + return m_menuBar; +} + void wxMenuBase::Attach(wxMenuBarBase *menubar) { // use Detach() instead!