]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/grid.cpp
use the window default colours, not hardcoded ones, in OnSysColourChanged()
[wxWidgets.git] / src / generic / grid.cpp
index 60146166eb1d37227a8663b1f9cd92ba0ea1f30e..ee086a77c8aa5361a5e22e4e0c967216db8baa8c 100644 (file)
@@ -41,6 +41,7 @@
     #include "wx/checkbox.h"
     #include "wx/combobox.h"
     #include "wx/valtext.h"
     #include "wx/checkbox.h"
     #include "wx/combobox.h"
     #include "wx/valtext.h"
+    #include "wx/intl.h"
 #endif
 
 #include "wx/textfile.h"
 #endif
 
 #include "wx/textfile.h"
@@ -1067,7 +1068,13 @@ void wxGridCellFloatEditor::Reset()
 void wxGridCellFloatEditor::StartingKey(wxKeyEvent& event)
 {
     int keycode = event.GetKeyCode();
 void wxGridCellFloatEditor::StartingKey(wxKeyEvent& event)
 {
     int keycode = event.GetKeyCode();
-        if ( wxIsdigit(keycode) || keycode == '+' || keycode == '-' || keycode == '.'
+    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 == '-'
+            || is_decimal_point
             || keycode ==  WXK_NUMPAD0
             || keycode ==  WXK_NUMPAD1
             || keycode ==  WXK_NUMPAD2
             || keycode ==  WXK_NUMPAD0
             || keycode ==  WXK_NUMPAD1
             || keycode ==  WXK_NUMPAD2
@@ -1166,11 +1173,21 @@ bool wxGridCellFloatEditor::IsAcceptedKey(wxKeyEvent& event)
             case WXK_NUMPAD_DECIMAL:
                 return TRUE;
 
             case WXK_NUMPAD_DECIMAL:
                 return TRUE;
 
-            default:
-                // additionally accept 'e' as in '1e+6'
+            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) &&
                 if ( (keycode < 128) &&
-                     (wxIsdigit(keycode) || tolower(keycode) == 'e') )
+                     (wxIsdigit(keycode) || tolower(keycode) == 'e' ||
+                      is_decimal_point || keycode == '+' || keycode == '-') )
                     return TRUE;
                     return TRUE;
+            }
         }
     }
 
         }
     }
 
@@ -3462,7 +3479,7 @@ END_EVENT_TABLE()
 wxGridRowLabelWindow::wxGridRowLabelWindow( wxGrid *parent,
                                             wxWindowID id,
                                             const wxPoint &pos, const wxSize &size )
 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;
 }
 {
     m_owner = parent;
 }
@@ -3528,7 +3545,7 @@ END_EVENT_TABLE()
 wxGridColLabelWindow::wxGridColLabelWindow( wxGrid *parent,
                                             wxWindowID id,
                                             const wxPoint &pos, const wxSize &size )
 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;
 }
 {
     m_owner = parent;
 }
@@ -3593,7 +3610,7 @@ END_EVENT_TABLE()
 wxGridCornerLabelWindow::wxGridCornerLabelWindow( wxGrid *parent,
                                                   wxWindowID id,
                                                   const wxPoint &pos, const wxSize &size )
 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;
 }
 {
     m_owner = parent;
 }
@@ -3665,7 +3682,7 @@ wxGridWindow::wxGridWindow( wxGrid *parent,
                             wxWindowID id,
                             const wxPoint &pos,
                             const wxSize &size )
                             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") )
 
 {
                         wxT("grid window") )
 
 {