+ pArr = (PACCELTABLE) new BYTE[nAccelLength];
+
+ for (i = 0; i < n; i++)
+ {
+ 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()
+ ,&bIsVirtual
+ );
+ if (bIsVirtual)
+ uVirt = AF_CHAR | AF_VIRTUALKEY;
+
+ USHORT uCmd = vaEntries[i].GetCommand();
+
+ pArr->aaccel[i].fs = uVirt;
+ pArr->aaccel[i].key = uKey;
+ pArr->aaccel[i].cmd = uCmd;
+ }
+ pArr->codepage = ::WinQueryCp(wxTheApp->m_hMq);
+ pArr->cAccel = (USHORT)n;
+ M_ACCELDATA->m_hAccel = ::WinCreateAccelTable( vHabmain
+ ,pArr
+ );
+ if (wxTheApp->GetTopWindow() != NULL)
+ {
+ //
+ // If we have accelerators the top window is the frame
+ //
+ wxFrame* pFrame = (wxFrame*)wxTheApp->GetTopWindow();
+
+ ::WinSetAccelTable( vHabmain
+ ,M_ACCELDATA->m_hAccel
+ ,(HWND)pFrame->GetFrame()
+ );
+ }
+
+ delete[] pArr;
+ M_ACCELDATA->m_ok = (M_ACCELDATA->m_hAccel != 0);
+} // end of wxAcceleratorTable::wxAcceleratorTable
+
+bool wxAcceleratorTable::Ok() const
+{
+ return(M_ACCELDATA && (M_ACCELDATA->m_ok));
+} // end of wxAcceleratorTable::Ok