X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c36d477458df6ffe02aef30fc31efb1ae2522a49..17d98558b35b75e3cad68d96841b4fa5a0c7e6ee:/src/common/accelcmn.cpp diff --git a/src/common/accelcmn.cpp b/src/common/accelcmn.cpp index a038c58d20..20c07edf32 100644 --- a/src/common/accelcmn.cpp +++ b/src/common/accelcmn.cpp @@ -27,7 +27,10 @@ #ifndef WX_PRECOMP #include "wx/string.h" + #include "wx/intl.h" + #include "wx/log.h" #include "wx/accel.h" + #include "wx/crt.h" #endif //WX_PRECOMP // ============================================================================ @@ -37,7 +40,7 @@ static const struct wxKeyName { wxKeyCode code; - const wxChar *name; + const char *name; } wxKeyNames[] = { { WXK_DELETE, wxTRANSLATE("DEL") }, @@ -111,7 +114,7 @@ static const struct wxKeyName // // as accels can be either translated or not, check for both possibilities and // also compare case-insensitively as the key names case doesn't count -static inline bool CompareAccelString(const wxString& str, const wxChar *accel) +static inline bool CompareAccelString(const wxString& str, const char *accel) { return str.CmpNoCase(accel) == 0 #if wxUSE_INTL @@ -125,7 +128,7 @@ static inline bool CompareAccelString(const wxString& str, const wxChar *accel) // // first and last parameter specify the valid domain for "number" part static int IsNumberedAccelKey(const wxString& str, - const wxChar *prefix, + const char *prefix, wxKeyCode prefixCode, unsigned first, unsigned last) @@ -142,7 +145,7 @@ static int IsNumberedAccelKey(const wxString& str, { // this must be a mistake, chances that this is a valid name of another // key are vanishingly small - wxLogDebug(_T("Invalid key string \"%s\""), str.c_str()); + wxLogDebug(wxT("Invalid key string \"%s\""), str.c_str()); return 0; } @@ -256,7 +259,7 @@ wxAcceleratorEntry::ParseAccel(const wxString& text, int *flagsOut, int *keyOut) } - wxASSERT_MSG( keyCode, _T("logic error: should have key code here") ); + wxASSERT_MSG( keyCode, wxT("logic error: should have key code here") ); if ( flagsOut ) *flagsOut = accelFlags; @@ -288,11 +291,11 @@ wxString wxAcceleratorEntry::ToString() const int flags = GetFlags(); if ( flags & wxACCEL_ALT ) - text += _("Alt-"); + text += _("Alt+"); if ( flags & wxACCEL_CTRL ) - text += _("Ctrl-"); + text += _("Ctrl+"); if ( flags & wxACCEL_SHIFT ) - text += _("Shift-"); + text += _("Shift+"); const int code = GetKeyCode(); @@ -320,7 +323,9 @@ wxString wxAcceleratorEntry::ToString() const // must be a simple key if ( #if !wxUSE_UNICODE - isascii(code) && + // we can't call wxIsalnum() for non-ASCII characters in ASCII + // build as they're only defined for the ASCII range (or EOF) + wxIsascii(code) && #endif // ANSI wxIsalnum(code) ) {