]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/grideditors.cpp
declaration of sendevent should be equal in grid.cpp and grid.h
[wxWidgets.git] / src / generic / grideditors.cpp
index 997626c10e5863c90f7299edaac8b11b9d901278..abd9a3bb59bb3c189bfde1027a121b12417b684a 100644 (file)
 void wxGridCellEditorEvtHandler::OnKillFocus(wxFocusEvent& event)
 {
     // Don't disable the cell if we're just starting to edit it
-    if (m_inSetFocus)
+    if ( m_inSetFocus )
+    {
+        event.Skip();
         return;
+    }
 
     // accept changes
     m_grid->DisableCellEditControl();
 
-    event.Skip();
+    // notice that we must not skip the event here because the call above may
+    // delete the control which received the kill focus event in the first
+    // place and if we pretend not having processed the event, the search for a
+    // handler for it will continue using the now deleted object resulting in a
+    // crash
 }
 
 void wxGridCellEditorEvtHandler::OnKeyDown(wxKeyEvent& event)
@@ -478,7 +485,10 @@ void wxGridCellTextEditor::DoBeginEdit(const wxString& startValue)
     Text()->SetFocus();
 }
 
-bool wxGridCellTextEditor::EndEdit(const wxString& WXUNUSED(oldval),
+bool wxGridCellTextEditor::EndEdit(int WXUNUSED(row),
+                                   int WXUNUSED(col),
+                                   const wxGrid* WXUNUSED(grid),
+                                   const wxString& WXUNUSED(oldval),
                                    wxString *newval)
 {
     wxCHECK_MSG( m_control, false,
@@ -674,7 +684,10 @@ void wxGridCellNumberEditor::BeginEdit(int row, int col, wxGrid* grid)
     }
 }
 
-bool wxGridCellNumberEditor::EndEdit(const wxString& oldval, wxString *newval)
+bool wxGridCellNumberEditor::EndEdit(int WXUNUSED(row),
+                                     int WXUNUSED(col),
+                                     const wxGrid* WXUNUSED(grid),
+                                     const wxString& oldval, wxString *newval)
 {
     long value = 0;
     wxString text;
@@ -879,7 +892,10 @@ void wxGridCellFloatEditor::BeginEdit(int row, int col, wxGrid* grid)
     DoBeginEdit(GetString());
 }
 
-bool wxGridCellFloatEditor::EndEdit(const wxString& oldval, wxString *newval)
+bool wxGridCellFloatEditor::EndEdit(int WXUNUSED(row),
+                                    int WXUNUSED(col),
+                                    const wxGrid* WXUNUSED(grid),
+                                    const wxString& oldval, wxString *newval)
 {
     const wxString text(Text()->GetValue());
 
@@ -1175,7 +1191,10 @@ void wxGridCellBoolEditor::BeginEdit(int row, int col, wxGrid* grid)
     CBox()->SetFocus();
 }
 
-bool wxGridCellBoolEditor::EndEdit(const wxString& WXUNUSED(oldval),
+bool wxGridCellBoolEditor::EndEdit(int WXUNUSED(row),
+                                   int WXUNUSED(col),
+                                   const wxGrid* WXUNUSED(grid),
+                                   const wxString& WXUNUSED(oldval),
                                    wxString *newval)
 {
     bool value = CBox()->GetValue();
@@ -1363,7 +1382,10 @@ void wxGridCellChoiceEditor::BeginEdit(int row, int col, wxGrid* grid)
     }
 }
 
-bool wxGridCellChoiceEditor::EndEdit(const wxString& WXUNUSED(oldval),
+bool wxGridCellChoiceEditor::EndEdit(int WXUNUSED(row),
+                                     int WXUNUSED(col),
+                                     const wxGrid* WXUNUSED(grid),
+                                     const wxString& WXUNUSED(oldval),
                                      wxString *newval)
 {
     const wxString value = Combo()->GetValue();
@@ -1481,7 +1503,10 @@ void wxGridCellEnumEditor::BeginEdit(int row, int col, wxGrid* grid)
 
 }
 
-bool wxGridCellEnumEditor::EndEdit(const wxString& WXUNUSED(oldval),
+bool wxGridCellEnumEditor::EndEdit(int WXUNUSED(row),
+                                   int WXUNUSED(col),
+                                   const wxGrid* WXUNUSED(grid),
+                                   const wxString& WXUNUSED(oldval),
                                    wxString *newval)
 {
     long idx = Combo()->GetSelection();