]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/grid.cpp
UMADrawControl is not to be used anymore
[wxWidgets.git] / src / generic / grid.cpp
index 1ca6596040d4f483603d5e593e6d660f23d7ee98..ee086a77c8aa5361a5e22e4e0c967216db8baa8c 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)[0]
+            || 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)[0] || 
-                      keycode == '+' || keycode == '-') )
+                      is_decimal_point || keycode == '+' || keycode == '-') )
                     return TRUE;
+            }
         }
     }
 
@@ -3466,7 +3479,7 @@ END_EVENT_TABLE()
 wxGridRowLabelWindow::wxGridRowLabelWindow( wxGrid *parent,
                                             wxWindowID id,
                                             const wxPoint &pos, const wxSize &size )
-  : wxWindow( parent, id, pos, size, wxWANTS_CHARS|wxBORDER_NONE )
+  : wxWindow( parent, id, pos, size, wxWANTS_CHARS|wxBORDER_NONE|wxFULL_REPAINT_ON_RESIZE )
 {
     m_owner = parent;
 }
@@ -3532,7 +3545,7 @@ END_EVENT_TABLE()
 wxGridColLabelWindow::wxGridColLabelWindow( wxGrid *parent,
                                             wxWindowID id,
                                             const wxPoint &pos, const wxSize &size )
-  : wxWindow( parent, id, pos, size, wxWANTS_CHARS|wxBORDER_NONE )
+  : wxWindow( parent, id, pos, size, wxWANTS_CHARS|wxBORDER_NONE|wxFULL_REPAINT_ON_RESIZE )
 {
     m_owner = parent;
 }
@@ -3597,7 +3610,7 @@ END_EVENT_TABLE()
 wxGridCornerLabelWindow::wxGridCornerLabelWindow( wxGrid *parent,
                                                   wxWindowID id,
                                                   const wxPoint &pos, const wxSize &size )
-  : wxWindow( parent, id, pos, size, wxWANTS_CHARS|wxBORDER_NONE )
+  : wxWindow( parent, id, pos, size, wxWANTS_CHARS|wxBORDER_NONE|wxFULL_REPAINT_ON_RESIZE )
 {
     m_owner = parent;
 }
@@ -3669,7 +3682,7 @@ wxGridWindow::wxGridWindow( wxGrid *parent,
                             wxWindowID id,
                             const wxPoint &pos,
                             const wxSize &size )
-            : wxWindow( parent, id, pos, size, wxWANTS_CHARS | wxBORDER_NONE | wxCLIP_CHILDREN,
+            : wxWindow( parent, id, pos, size, wxWANTS_CHARS | wxBORDER_NONE | wxCLIP_CHILDREN|wxFULL_REPAINT_ON_RESIZE,
                         wxT("grid window") )
 
 {