X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f24b783af3785e748b775409d926361e87e8eb13..4dd2530846d0fcf214e3b288b04ce3aa932af048:/src/common/menucmn.cpp diff --git a/src/common/menucmn.cpp b/src/common/menucmn.cpp index 49f3a00d9e..87969e0411 100644 --- a/src/common/menucmn.cpp +++ b/src/common/menucmn.cpp @@ -319,9 +319,7 @@ wxString wxAcceleratorEntry::ToString() const const int code = GetKeyCode(); - if ( wxIsalnum(code) ) - text << (wxChar)code; - else if ( code >= WXK_F1 && code <= WXK_F12 ) + if ( code >= WXK_F1 && code <= WXK_F12 ) text << _("F") << code - WXK_F1 + 1; else if ( code >= WXK_NUMPAD0 && code <= WXK_NUMPAD9 ) text << _("KP_") << code - WXK_NUMPAD0; @@ -340,8 +338,22 @@ wxString wxAcceleratorEntry::ToString() const } } - wxASSERT_MSG( n != WXSIZEOF(wxKeyNames), - wxT("unknown keyboard accelerator code") ); + if ( n == WXSIZEOF(wxKeyNames) ) + { + // must be a simple key + if ( +#if !wxUSE_UNICODE + isascii(code) && +#endif // ANSI + wxIsalnum(code) ) + { + text << (wxChar)code; + } + else + { + wxFAIL_MSG( wxT("unknown keyboard accelerator code") ); + } + } } return text;