X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8635b0dbb3342cb7de5d4c0f5775f83cfabfd74a..046d682f0f684977b7ba933a128f5c84e06ded0e:/src/os2/accel.cpp diff --git a/src/os2/accel.cpp b/src/os2/accel.cpp index 039439d25d..044c1b28d4 100644 --- a/src/os2/accel.cpp +++ b/src/os2/accel.cpp @@ -148,7 +148,7 @@ wxAcceleratorTable::wxAcceleratorTable( pArr->aaccel[i].key = uKey; pArr->aaccel[i].cmd = uCmd; } - pArr->codepage = 437; + pArr->codepage = ::WinQueryCp(wxTheApp->m_hMq); pArr->cAccel = (USHORT)n; M_ACCELDATA->m_hAccel = ::WinCreateAccelTable( vHabmain ,pArr @@ -203,10 +203,48 @@ bool wxAcceleratorTable::Translate( ,GetHaccel() ,pMsg ); - if (rc) - { - int x = 1; - } return (Ok() && rc); } // end of wxAcceleratorTable::Translate +// --------------------------------------------------------------------------- +// function for translating labels +// --------------------------------------------------------------------------- + +wxString wxPMTextToLabel( + 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 wxPMTextToLabel +