]> git.saurik.com Git - wxWidgets.git/commitdiff
Mention wxLocale in wxNumValidator documentation.
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 23 Aug 2011 11:04:44 +0000 (11:04 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 23 Aug 2011 11:04:44 +0000 (11:04 +0000)
Using setlocale() can thoroughly confuse wxNumValidator because it results in
a mismatch between the decimal and/or thousands separators it uses, returned
by wxLocale, and the actual separators in the strings, formatted by the CRT.

So mention in the documentation that using setlocale() is a bad idea.

Closes #12970.

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

interface/wx/valnum.h

index 105384615be28a5ab477b54995662c891e36f752..0ca772304cd87ca6415877b7c46c702b7e492676 100644 (file)
@@ -156,6 +156,12 @@ public:
     be restricted further by calling SetMin() and SetMax() or SetRange()
     methods inherited from the base class.
 
+    When the validator displays integers with thousands separators, the
+    character used for the separators (usually "." or ",") depends on the locale
+    set with wxLocale (note that you shouldn't change locale with setlocale()
+    as this can result in a mismatch between the thousands separator used by
+    wxLocale and the one used by the run-time library).
+
     A simple example of using this class:
     @code
         class MyDialog : public wxDialog
@@ -252,6 +258,12 @@ wxMakeIntegerValidator(T *value, int style = wxNUM_VAL_DEFAULT);
     implementation. As with the range, the precision can be restricted after
     the validator creation if necessary.
 
+    When the validator displays numbers with decimal or thousands separators,
+    the characters used for the separators (usually "." or ",") depend on the
+    locale set with wxLocale (note that you shouldn't change locale with
+    setlocale() as this can result in a mismatch between the separators used by
+    wxLocale and the one used by the run-time library).
+
     A simple example of using this class:
     @code
         class MyDialog : public wxDialog