Fixed misuse of GridCellEditor in DurationCellEditor, potentially leading to crash on windows.
--- a/controls/DurationCellEditor.py Tue Mar 23 05:08:51 2021 +0100
+++ b/controls/DurationCellEditor.py Mon Mar 29 15:46:02 2021 +0200
@@ -122,21 +122,18 @@
self.CellControl.SetValue(self.Table.GetValueByName(row, self.Colname))
self.CellControl.SetFocus()
- def EndEditInternal(self, row, col, grid, old_duration):
- duration = self.CellControl.GetValue()
- changed = duration != old_duration
+ def EndEdit(self, row, col, grid, oldval):
+ value = self.CellControl.GetValue()
+ changed = value != oldval
if changed:
- self.Table.SetValueByName(row, self.Colname, duration)
+ return value
+ else:
+ return None
+
+ def ApplyEdit(self, row, col, grid):
+ value = self.CellControl.GetValue()
+ self.Table.SetValueByName(row, self.Colname, value)
self.CellControl.Disable()
- return changed
-
- if wx.VERSION >= (3, 0, 0):
- def EndEdit(self, row, col, grid, oldval):
- return self.EndEditInternal(row, col, grid, oldval)
- else:
- def EndEdit(self, row, col, grid):
- oldval = self.Table.GetValueByName(row, self.Colname)
- return self.EndEditInternal(row, col, grid, oldval)
def SetSize(self, rect):
self.CellControl.SetDimensions(rect.x + 1, rect.y,