X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/893758d507abf66a429666b9f0b2c1baa195b398..8b3fddc49326c0b6019cd7082218726aa17a5727:/src/os2/menu.cpp diff --git a/src/os2/menu.cpp b/src/os2/menu.cpp index 186744bf97..6b82bb84fd 100644 --- a/src/os2/menu.cpp +++ b/src/os2/menu.cpp @@ -73,7 +73,7 @@ static wxString TextToLabel(const wxString& rTitle) { wxString Title; const wxChar *pc; - for (pc = rTitle; *pc != wxT('\0'); pc++ ) + for (pc = rTitle.c_str(); *pc != wxT('\0'); pc++ ) { if (*pc == wxT('&') ) { @@ -85,10 +85,6 @@ static wxString TextToLabel(const wxString& rTitle) else Title << wxT('~'); } -// else if (*pc == wxT('/')) -// { -// Title << wxT('\\'); -// } else { if ( *pc == wxT('~') ) @@ -609,7 +605,12 @@ wxMenuItem* wxMenu::FindItem( } else if ( pItem->IsSubMenu() ) { - pItem = pItem->GetSubMenu()->FindItem(nItemId, hItem, ppItemMenu); + pItem = pItem->GetSubMenu()->FindItem( nItemId + ,hItem + ,ppItemMenu + ); + if (pItem) + break; } else { @@ -627,7 +628,7 @@ wxMenuItem* wxMenu::FindItem( void wxMenuBar::Init() { m_eventHandler = this; - m_pMenuBarFrame = NULL; + m_menuBarFrame = NULL; m_hMenu = 0; } // end of wxMenuBar::Init @@ -672,7 +673,7 @@ void wxMenuBar::Refresh() { wxCHECK_RET( IsAttached(), wxT("can't refresh unatteched menubar") ); - WinSendMsg(GetWinHwnd(m_pMenuBarFrame), WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0); + WinSendMsg(GetWinHwnd(m_menuBarFrame), WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0); } // end of wxMenuBar::Refresh WXHMENU wxMenuBar::Create() @@ -688,8 +689,8 @@ WXHMENU wxMenuBar::Create() // // Menubars should be associated with a frame otherwise they are popups // - if (m_pMenuBarFrame != NULL) - hFrame = GetWinHwnd(m_pMenuBarFrame); + if (m_menuBarFrame != NULL) + hFrame = GetWinHwnd(m_menuBarFrame); else hFrame = HWND_DESKTOP; // @@ -899,8 +900,6 @@ bool wxMenuBar::Insert( ,nPos ); - pMenu->Attach(this); - if (IsAttached()) { ::WinSendMsg((HWND)m_hMenu, MM_INSERTITEM, (MPARAM)&pMenu->m_vMenuData, (MPARAM)Title.c_str()); @@ -929,7 +928,6 @@ bool wxMenuBar::Append( if (!wxMenuBarBase::Append(pMenu, Title)) return FALSE; - pMenu->Attach(this); m_titles.Add(Title); if ( IsAttached() ) @@ -969,7 +967,6 @@ wxMenu* wxMenuBar::Remove( if (IsAttached()) { ::WinSendMsg((HWND)GetHmenu(), MM_REMOVEITEM, MPFROM2SHORT(nId, TRUE), (MPARAM)0); - pMenu->Detach(); #if wxUSE_ACCEL if (pMenu->HasAccels()) @@ -1025,7 +1022,7 @@ void wxMenuBar::Attach( ) { wxASSERT_MSG( !IsAttached(), wxT("menubar already attached!") ); - m_pMenuBarFrame = pFrame; + m_menuBarFrame = pFrame; #if wxUSE_ACCEL RebuildAccelTable(); @@ -1044,7 +1041,7 @@ void wxMenuBar::Detach() { ::WinDestroyWindow((HWND)m_hMenu); m_hMenu = (WXHMENU)NULL; - m_pMenuBarFrame = NULL; + m_menuBarFrame = NULL; } // end of wxMenuBar::Detach // ---------------------------------------------------------------------------