]> git.saurik.com Git - wxWidgets.git/commitdiff
Do not use wxIsprint() in EVT_CHAR example in the documentation.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 9 Sep 2012 10:46:14 +0000 (10:46 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 9 Sep 2012 10:46:14 +0000 (10:46 +0000)
This is incorrect as wxIsprint() is locale-dependent and only really works as
expected in UTF-8 locales (which are never used under Windows). Instead, just
test for control characters directly.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72448 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

interface/wx/event.h

index 9f75e9a785403beca3663529e1e0938d76b8e0c1..a7f20d1b738e9cb1ea8f64086d0a706668e5fc98 100644 (file)
@@ -1411,8 +1411,8 @@ public:
                 {
                     // It's a "normal" character. Notice that this includes
                     // control characters in 1..31 range, e.g. WXK_RETURN or
-                    // WXK_BACK.
-                    if ( wxIsprint(uc) )
+                    // WXK_BACK, so check for them explicitly.
+                    if ( uc >= 32 )
                     {
                         wxLogMessage("You pressed '%c'", uc);
                     }