added support for non alphanumeric simple character accelerators

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14514 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-03-09 12:23:11 +00:00
parent f9bd2c1bdf
commit a070d8ce24
4 changed files with 46 additions and 17 deletions

View File

@@ -82,11 +82,25 @@ wxAcceleratorEntry *wxGetAccelFromString(const wxString& label)
else if ( current == _("shift") )
accelFlags |= wxACCEL_SHIFT;
else {
wxLogDebug(wxT("Unknown accel modifier: '%s'"),
current.c_str());
// we may have "Ctrl-+", for example, but we still want to
// catch typos like "Crtl-A" so only give the warning if we
// have something before the current '+' or '-', else take
// it as a literal symbol
if ( current.empty() )
{
current += label[n];
// skip clearing it below
continue;
}
else
{
wxLogDebug(wxT("Unknown accel modifier: '%s'"),
current.c_str());
}
}
current.Empty();
current.clear();
}
else {
current += wxTolower(label[n]);