Some more accelerator fixes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7462 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Webster
2000-05-22 21:23:58 +00:00
parent 04652a15c8
commit 3844b70dd8
2 changed files with 12 additions and 12 deletions

View File

@@ -99,11 +99,11 @@ wxAcceleratorTable::wxAcceleratorTable(
int i; int i;
m_refData = new wxAcceleratorRefData; m_refData = new wxAcceleratorRefData;
pArr = (PACCELTABLE) new int[nAccelLength]; pArr = (PACCELTABLE) new BYTE[nAccelLength];
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
{ {
USHORT uVirt = 0; USHORT uVirt = AF_CHAR;
if (vaEntries[i].GetFlags() & wxACCEL_ALT) if (vaEntries[i].GetFlags() & wxACCEL_ALT)
uVirt |= AF_ALT; uVirt |= AF_ALT;
@@ -116,7 +116,8 @@ wxAcceleratorTable::wxAcceleratorTable(
USHORT uKey = wxCharCodeWXToOS2( vaEntries[i].GetKeyCode() USHORT uKey = wxCharCodeWXToOS2( vaEntries[i].GetKeyCode()
,&bIsVirtual ,&bIsVirtual
); );
uVirt |= AF_VIRTUALKEY; if (bIsVirtual)
uVirt |= AF_VIRTUALKEY;
USHORT uCmd = vaEntries[i].GetCommand(); USHORT uCmd = vaEntries[i].GetCommand();

View File

@@ -267,15 +267,6 @@ bool wxMenu::DoInsertOrAppend(
wxString sError; wxString sError;
#if wxUSE_ACCEL #if wxUSE_ACCEL
UpdateAccel(pItem); UpdateAccel(pItem);
//
// Ensure the accelerator table is set to the frame (not the client!)
//
if (!::WinSetAccelTable( vHabmain
,(HWND)pFrame->GetFrame()
,m_vAccelTable.GetHACCEL()
))
wxLogLastError("WinSetAccelTable");
#endif // wxUSE_ACCEL #endif // wxUSE_ACCEL
// //
@@ -1017,6 +1008,14 @@ void wxMenuBar::Attach(
#if wxUSE_ACCEL #if wxUSE_ACCEL
RebuildAccelTable(); RebuildAccelTable();
//
// Ensure the accelerator table is set to the frame (not the client!)
//
if (!::WinSetAccelTable( vHabmain
,(HWND)pFrame->GetFrame()
,m_vAccelTable.GetHACCEL()
))
wxLogLastError("WinSetAccelTable");
#endif // wxUSE_ACCEL #endif // wxUSE_ACCEL
} // end of wxMenuBar::Attach } // end of wxMenuBar::Attach