]> git.saurik.com Git - wxWidgets.git/commitdiff
Unicode fixes.
authorStefan Neis <Stefan.Neis@t-online.de>
Tue, 10 Feb 2004 22:16:55 +0000 (22:16 +0000)
committerStefan Neis <Stefan.Neis@t-online.de>
Tue, 10 Feb 2004 22:16:55 +0000 (22:16 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25722 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/intl.cpp
src/generic/grid.cpp

index ecb0166cff09e58f6ddc9e500bf39985f9cb0c8c..e3f2208e59d48202c8b734fb5f66b88c43c1df33 100644 (file)
@@ -2510,7 +2510,7 @@ bool wxLocale::AddCatalog(const wxChar *szDomain)
 #ifdef __WXMSW__
 
 /* static */
-wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory cat)
+wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory WXUNUSED(cat))
 {
     wxString str;
     wxChar buffer[256];
@@ -2559,9 +2559,11 @@ wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory cat)
             switch (index)
             {
                 case wxLOCALE_THOUSANDS_SEP:
-                    return locale_info->thousands_sep;
+                    return wxString(locale_info->thousands_sep,
+                                    *wxConvCurrent);
                 case wxLOCALE_DECIMAL_POINT:
-                    return locale_info->decimal_point;
+                    return wxString(locale_info->decimal_point,
+                                    *wxConvCurrent);
                 default:
                     return wxEmptyString;
             }
@@ -2569,9 +2571,11 @@ wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory cat)
             switch (index)
             {
                 case wxLOCALE_THOUSANDS_SEP:
-                    return locale_info->mon_thousands_sep;
+                    return wxString(locale_info->mon_thousands_sep,
+                                    *wxConvCurrent);
                 case wxLOCALE_DECIMAL_POINT:
-                    return locale_info->mon_decimal_point;
+                    return wxString(locale_info->mon_decimal_point,
+                                    *wxConvCurrent);
                 default:
                     return wxEmptyString;
             }
index 554e61d4c4248090091e0df9cc74734201498255..74de24b9f7a24a16e21e8955aab49ef780ae27eb 100644 (file)
@@ -1068,8 +1068,13 @@ void wxGridCellFloatEditor::Reset()
 void wxGridCellFloatEditor::StartingKey(wxKeyEvent& event)
 {
     int keycode = event.GetKeyCode();
+    char tmpbuf[2];
+    tmpbuf[0] = (char) keycode;
+    tmpbuf[1] = '\0';
+    bool is_decimal_point = ( wxString(tmpbuf, *wxConvCurrent) == 
+      wxLocale::GetInfo(wxLOCALE_DECIMAL_POINT, wxLOCALE_CAT_NUMBER) );
         if ( wxIsdigit(keycode) || keycode == '+' || keycode == '-'
-            || keycode == wxLocale::GetInfo(wxLOCALE_DECIMAL_POINT, wxLOCALE_CAT_NUMBER)[0u]
+            || is_decimal_point
             || keycode ==  WXK_NUMPAD0
             || keycode ==  WXK_NUMPAD1
             || keycode ==  WXK_NUMPAD2
@@ -1168,13 +1173,21 @@ bool wxGridCellFloatEditor::IsAcceptedKey(wxKeyEvent& event)
             case WXK_NUMPAD_DECIMAL:
                 return TRUE;
 
-            default:
-                // additionally accept 'e' as in '1e+6', also '-', '+', and '.'
+            default: 
+            {
+               // additionally accept 'e' as in '1e+6', also '-', '+', and '.'
+                char tmpbuf[2];
+                tmpbuf[0] = (char) keycode;
+                tmpbuf[1] = '\0';
+                bool is_decimal_point =
+                  ( wxString(tmpbuf, *wxConvCurrent) == 
+                    wxLocale::GetInfo(wxLOCALE_DECIMAL_POINT,
+                                      wxLOCALE_CAT_NUMBER) );
                 if ( (keycode < 128) &&
                      (wxIsdigit(keycode) || tolower(keycode) == 'e' ||
-                      keycode == wxLocale::GetInfo(wxLOCALE_DECIMAL_POINT, wxLOCALE_CAT_NUMBER)[0u] || 
-                      keycode == '+' || keycode == '-') )
+                      is_decimal_point || keycode == '+' || keycode == '-') )
                     return TRUE;
+            }
         }
     }