#include "wx/accel.h"
+#include <ctype.h>
+
//-----------------------------------------------------------------------------
// wxAcceleratorTable
//-----------------------------------------------------------------------------
wxAcceleratorTable::wxAcceleratorTable()
{
- m_refData = new wxAccelRefData();
}
wxAcceleratorTable::wxAcceleratorTable( int n, wxAcceleratorEntry entries[] )
m_refData = new wxAccelRefData();
for (int i = 0; i < n; i++)
{
- M_ACCELDATA->m_accels.Append( (wxObject*)
- new wxAcceleratorEntry( entries[n].GetFlags(), entries[n].GetKeyCode(), entries[n].GetCommand() ) );
+ int flag = entries[i].GetFlags();
+ int keycode = entries[i].GetKeyCode();
+ int command = entries[i].GetCommand();
+ if ((keycode >= (int)'A') && (keycode <= (int)'Z')) keycode = (int)tolower( (char)keycode );
+ M_ACCELDATA->m_accels.Append( new wxAcceleratorEntry( flag, keycode, command ) );
}
}
int wxAcceleratorTable::GetCommand( wxKeyEvent &event )
{
+ if (!Ok()) return -1;
+
wxNode *node = M_ACCELDATA->m_accels.First();
while (node)
{