X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3febf6845ffa9f9004dc5000e01a0f01d8a6f57c..9e7efd538e888419f278d621f39c8776d28f3b18:/src/os2/accel.cpp diff --git a/src/os2/accel.cpp b/src/os2/accel.cpp index a93f7f1af6..044c1b28d4 100644 --- a/src/os2/accel.cpp +++ b/src/os2/accel.cpp @@ -90,7 +90,7 @@ wxAcceleratorTable::wxAcceleratorTable( ::WinSetAccelTable( vHabmain ,hAccel - ,(HWND)pFrame->GetHWND() + ,(HWND)pFrame->GetFrame() ); } M_ACCELDATA->m_hAccel = hAccel; @@ -105,7 +105,7 @@ extern int wxCharCodeWXToOS2( // Create from an array wxAcceleratorTable::wxAcceleratorTable( int n -, wxAcceleratorEntry vaEntries[] +, const wxAcceleratorEntry vaEntries[] ) { int nAccelLength = ((sizeof(ACCEL) * n) + sizeof(ACCELTABLE)); @@ -148,7 +148,7 @@ wxAcceleratorTable::wxAcceleratorTable( pArr->aaccel[i].key = uKey; pArr->aaccel[i].cmd = uCmd; } - pArr->codepage = 437; // default to english Fix??? + pArr->codepage = ::WinQueryCp(wxTheApp->m_hMq); pArr->cAccel = (USHORT)n; M_ACCELDATA->m_hAccel = ::WinCreateAccelTable( vHabmain ,pArr @@ -162,7 +162,7 @@ wxAcceleratorTable::wxAcceleratorTable( ::WinSetAccelTable( vHabmain ,M_ACCELDATA->m_hAccel - ,(HWND)pFrame->GetHWND() + ,(HWND)pFrame->GetFrame() ); } @@ -203,15 +203,48 @@ bool wxAcceleratorTable::Translate( ,GetHaccel() ,pMsg ); - if (rc) - { - int x = 1; - } return (Ok() && rc); -// ::WinTranslateAccel( vHabmain -// ,(HWND)hWnd -// ,GetHaccel() -// ,pMsg -// ); } // 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 +