#include "wx/frame.h"
#include "wx/menu.h"
#include "wx/utils.h"
+ #include "wx/intl.h"
#endif
#if wxUSE_OWNER_DRAWN
keyCode = VK_F1 + n - 1;
}
else {
- wxLogDebug(_T("Unreckognized accel key '%s', accel "
+ wxLogDebug(_T("Unrecognized accel key '%s', accel "
"string ignored."), current.c_str());
}
}
m_menuBarFrame = frame;
- // create the accel table - we consider that the toolbar construction is
+ // create the accel table - we consider that the menubar construction is
// finished
size_t nAccelCount = 0;
int i;
nAccelCount += m_menus[i]->GetAccelCount();
}
- wxAcceleratorEntry *accelEntries = new wxAcceleratorEntry[nAccelCount];
-
- nAccelCount = 0;
- for ( i = 0; i < m_menuCount; i++ )
+ if ( nAccelCount )
{
- nAccelCount += m_menus[i]->CopyAccels(&accelEntries[nAccelCount]);
- }
+ wxAcceleratorEntry *accelEntries = new wxAcceleratorEntry[nAccelCount];
- m_accelTable = wxAcceleratorTable(nAccelCount, accelEntries);
+ nAccelCount = 0;
+ for ( i = 0; i < m_menuCount; i++ )
+ {
+ nAccelCount += m_menus[i]->CopyAccels(&accelEntries[nAccelCount]);
+ }
+
+ m_accelTable = wxAcceleratorTable(nAccelCount, accelEntries);
- delete [] accelEntries;
+ delete [] accelEntries;
+ }
}
// ---------------------------------------------------------------------------