#include "wx/frame.h"
#include "wx/menu.h"
#include "wx/utils.h"
+ #include "wx/intl.h"
#endif
#if wxUSE_OWNER_DRAWN
else {
if ( current.Len() == 1 ) {
// it's a letter
- keyCode = wxToupper(current[0]);
+ keyCode = wxToupper(current[0U]);
}
else {
// it should be a function key
- if ( current[0] == 'f' && isdigit(current[1]) &&
+ if ( current[0U] == 'f' && isdigit(current[1U]) &&
(current.Len() == 2 ||
- (current.Len() == 3 && isdigit(current[2]))) ) {
+ (current.Len() == 3 && isdigit(current[2U]))) ) {
int n;
sscanf(current.c_str() + 1, "%d", &n);
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;
+ }
}
// ---------------------------------------------------------------------------