]> git.saurik.com Git - wxWidgets.git/commitdiff
Tried to fix bug 603906 by modifying GetModelValues to disable editor.
authorStefan Neis <Stefan.Neis@t-online.de>
Sat, 7 Sep 2002 16:22:56 +0000 (16:22 +0000)
committerStefan Neis <Stefan.Neis@t-online.de>
Sat, 7 Sep 2002 16:22:56 +0000 (16:22 +0000)
        Also save and disable editor in SetModelValues. However, I don't have
        a test case ...

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

src/generic/grid.cpp

index 96448743d07321b8738f9bcbb52b878edb960e2d..64932052596cd28323cfc87227501d01ba0c88d7 100644 (file)
@@ -1125,7 +1125,7 @@ bool wxGridCellFloatEditor::IsAcceptedKey(wxKeyEvent& event)
             default:
                 // additionally accept 'e' as in '1e+6'
                 if ( (keycode < 128) &&
-                     (isdigit(keycode) || tolower(keycode) == wxT('e')) )
+                     (isdigit(keycode) || tolower(keycode) == 'e') )
                     return TRUE;
         }
     }
@@ -6264,6 +6264,9 @@ void wxGrid::HighlightBlock( int topRow, int leftCol, int bottomRow, int rightCo
 
 bool wxGrid::GetModelValues()
 {
+    // Disable the editor, so it won't hide a changed value.
+    DisableCellEditControl();
+
     if ( m_table )
     {
         // all we need to do is repaint the grid
@@ -6280,6 +6283,12 @@ bool wxGrid::SetModelValues()
 {
     int row, col;
 
+    // Disable the editor, so it won't hide a changed value.
+    // Do we also want to save the current value of the editor first?
+    // I think so ...
+    SaveEditControlValue();
+    DisableCellEditControl();
+
     if ( m_table )
     {
         for ( row = 0;  row < m_numRows;  row++ )