--- a/controls/CustomGrid.py Tue Mar 27 23:59:35 2012 +0200
+++ b/controls/CustomGrid.py Sat Mar 31 13:14:53 2012 +0200
@@ -84,7 +84,9 @@
self.DownButton.Enable(self.Editable and 0 <= row < rows - 1)
def CloseEditControl(self):
- self.SetGridCursor(self.GetGridCursorRow(), self.GetGridCursorCol())
+ row, col = self.GetGridCursorRow(), self.GetGridCursorCol()
+ if row != -1 and col != -1:
+ self.SetGridCursor(row, col)
def AddRow(self):
self.CloseEditControl()
--- a/controls/CustomTable.py Tue Mar 27 23:59:35 2012 +0200
+++ b/controls/CustomTable.py Sat Mar 31 13:14:53 2012 +0200
@@ -69,6 +69,7 @@
(wx.grid.Grid) -> Reset the grid view. Call this to
update the grid if rows and columns have been added or deleted
"""
+ grid.CloseEditControl()
grid.BeginBatch()
for current, new, delmsg, addmsg in [
(self._rows, self.GetNumberRows(), wx.grid.GRIDTABLE_NOTIFY_ROWS_DELETED, wx.grid.GRIDTABLE_NOTIFY_ROWS_APPENDED),