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)
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,
}
}
-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;
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());
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();
}
}
-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();
}
-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();