X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b33b72819002e038a2a0cb2b3aa9b2cde880c7a..df16a53ef9ae506c51023178e4fe45ce45e69447:/src/os2/menuitem.cpp diff --git a/src/os2/menuitem.cpp b/src/os2/menuitem.cpp index af97aab35a..6b4c37c65a 100644 --- a/src/os2/menuitem.cpp +++ b/src/os2/menuitem.cpp @@ -62,7 +62,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('&') ) { @@ -71,13 +71,9 @@ static wxString TextToLabel(const wxString& rTitle) pc++; Title << wxT('&'); } - else + else Title << wxT('~'); } -// else if (*pc == wxT('/')) -// { -// Title << wxT('\\'); -// } else { if ( *pc == wxT('~') ) @@ -155,6 +151,8 @@ wxMenuItem::wxMenuItem( m_text = TextToLabel(rText); m_isCheckable = bCheckable; m_help = rStrHelp; + memset(&m_vMenuData, '\0', sizeof(m_vMenuData)); + m_vMenuData.id= nId; } // end of wxMenuItem::wxMenuItem wxMenuItem::~wxMenuItem() @@ -206,18 +204,6 @@ wxString wxMenuItemBase::GetLabelFromText( return label; } -// accelerators -// ------------ - -#if wxUSE_ACCEL - -wxAcceleratorEntry *wxMenuItem::GetAccel() const -{ - return wxGetAccelFromString(GetText()); -} - -#endif // wxUSE_ACCEL - // change item state // ----------------- @@ -233,13 +219,13 @@ void wxMenuItem::Enable( bOk = (bool)::WinSendMsg( GetHMenuOf(m_parentMenu) ,MM_SETITEMATTR ,MPFROM2SHORT(GetRealId(), TRUE) - ,MPFROM2SHORT(MIA_DISABLED, MIA_DISABLED) + ,MPFROM2SHORT(MIA_DISABLED, FALSE) ); else bOk = (bool)::WinSendMsg( GetHMenuOf(m_parentMenu) ,MM_SETITEMATTR ,MPFROM2SHORT(GetRealId(), TRUE) - ,MPFROM2SHORT(MIA_DISABLED, FALSE) + ,MPFROM2SHORT(MIA_DISABLED, MIA_DISABLED) ); if (!bOk) { @@ -271,7 +257,7 @@ void wxMenuItem::Check( ); if (!bOk) { - wxLogLastError("EnableMenuItem"); + wxLogLastError("CheckMenuItem"); } wxMenuItemBase::Check(bCheck); } // end of wxMenuItem::Check