X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/57ff8a875bff6f8ba8a6616ed7095b74a835c622..acd3dca8bbcf856c29777b1cf58ffbe5923afe35:/src/os2/menuitem.cpp diff --git a/src/os2/menuitem.cpp b/src/os2/menuitem.cpp index 91c6e9d975..a3180a5ae8 100644 --- a/src/os2/menuitem.cpp +++ b/src/os2/menuitem.cpp @@ -54,48 +54,6 @@ #define OWNER_DRAWN_ONLY( code ) #endif // wxUSE_OWNER_DRAWN/!wxUSE_OWNER_DRAWN -// ---------------------------------------------------------------------------- -// static function for translating menu labels -// ---------------------------------------------------------------------------- - -static wxString TextToLabel( - const wxString& rsTitle -) -{ - wxString sTitle; - const wxChar* zPc; - - if (rsTitle.IsEmpty()) - return(sTitle); - - for (zPc = rsTitle.c_str(); *zPc != wxT('\0'); zPc++) - { - if (*zPc == wxT('&')) - { - if (*(zPc + 1) == wxT('&')) - { - zPc++; - sTitle << wxT('&'); - } - else - sTitle << wxT('~'); - } - else - { - if ( *zPc == wxT('~')) - { - // - // Tildes must be doubled to prevent them from being - // interpreted as accelerator character prefix by PM ??? - // - sTitle << *zPc; - } - sTitle << *zPc; - } - } - return(sTitle); -} // end of TextToLabel - // ============================================================================ // implementation // ============================================================================ @@ -123,13 +81,13 @@ wxMenuItem::wxMenuItem( ) : wxMenuItemBase( pParentMenu ,nId - ,TextToLabel(rsText) + ,wxPMTextToLabel(rsText) ,rsHelp ,eKind ,pSubMenu ) #if wxUSE_OWNER_DRAWN -, wxOwnerDrawn( TextToLabel(rsText) +, wxOwnerDrawn( wxPMTextToLabel(rsText) ,eKind == wxITEM_CHECK ) #endif // owner drawn @@ -151,13 +109,13 @@ wxMenuItem::wxMenuItem( ) : wxMenuItemBase( pParentMenu ,nId - ,TextToLabel(rsText) + ,wxPMTextToLabel(rsText) ,rsHelp ,bIsCheckable ? wxITEM_CHECK : wxITEM_NORMAL ,pSubMenu ) #if wxUSE_OWNER_DRAWN -, wxOwnerDrawn( TextToLabel(rsText) +, wxOwnerDrawn( wxPMTextToLabel(rsText) ,bIsCheckable ) #endif // owner drawn @@ -238,7 +196,7 @@ wxString wxMenuItemBase::GetLabelFromText( { // // '~' is the escape character for OS/2PM and '&' is the one for - // wxWindows - skip both of them + // wxWidgets - skip both of them // continue; } @@ -363,9 +321,9 @@ void wxMenuItem::Check( // // Also uncheck all the other items in this radio group // - wxMenuItemList::Node* pNode = rItems.Item(nStart); + wxMenuItemList::compatibility_iterator node = rItems.Item(nStart); - for (int n = nStart; n <= nEnd && pNode; n++) + for (int n = nStart; n <= nEnd && node; n++) { if (n == nPos) { @@ -377,14 +335,14 @@ void wxMenuItem::Check( } if (n != nPos) { - pNode->GetData()->m_isChecked = FALSE; + node->GetData()->m_isChecked = FALSE; ::WinSendMsg( hMenu ,MM_SETITEMATTR ,MPFROM2SHORT(n, TRUE) ,MPFROM2SHORT(MIA_CHECKED, FALSE) ); } - pNode = pNode->GetNext(); + node = node->GetNext(); } } else // check item @@ -417,7 +375,7 @@ void wxMenuItem::SetText( // Don't do anything if label didn't change // - wxString sText = TextToLabel(rText); + wxString sText = wxPMTextToLabel(rText); if (m_text == sText) return;