::WinSetAccelTable( vHabmain
,hAccel
- ,(HWND)pFrame->GetHWND()
+ ,(HWND)pFrame->GetFrame()
);
}
M_ACCELDATA->m_hAccel = hAccel;
// Create from an array
wxAcceleratorTable::wxAcceleratorTable(
int n
-, wxAcceleratorEntry vaEntries[]
+, const wxAcceleratorEntry vaEntries[]
)
{
int nAccelLength = ((sizeof(ACCEL) * n) + sizeof(ACCELTABLE));
USHORT uVirt = AF_CHAR;
if (vaEntries[i].GetFlags() & wxACCEL_ALT)
+ {
uVirt |= AF_ALT;
+ uVirt |= AF_VIRTUALKEY;
+ }
if (vaEntries[i].GetFlags() & wxACCEL_SHIFT)
+ {
uVirt |= AF_SHIFT;
+ uVirt |= AF_VIRTUALKEY;
+ }
if (vaEntries[i].GetFlags() & wxACCEL_CTRL)
+ {
uVirt |= AF_CONTROL;
+ uVirt |= AF_VIRTUALKEY;
+ }
bool bIsVirtual;
USHORT uKey = wxCharCodeWXToOS2( vaEntries[i].GetKeyCode()
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
::WinSetAccelTable( vHabmain
,M_ACCELDATA->m_hAccel
- ,(HWND)pFrame->GetHWND()
+ ,(HWND)pFrame->GetFrame()
);
}
) const
{
PQMSG pMsg = (PQMSG)pWxmsg;
-
- return Ok() && ::WinTranslateAccel( vHabmain
- ,(HWND)hWnd
- ,GetHaccel()
- ,pMsg
- );
+ BOOL rc = FALSE;
+
+ rc = ::WinTranslateAccel( vHabmain
+ ,(HWND)hWnd
+ ,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
+