lpcmanager

db004cb7d60e
Parents ff65542a06ac
Children ec77b7c1dae2
Fixed misuse of GridCellEditor that was leading to crash on windows.
--- a/WampOptionsEditor.py Mon Dec 07 11:21:19 2020 +0100
+++ b/WampOptionsEditor.py Mon Mar 29 15:34:50 2021 +0200
@@ -345,21 +345,19 @@
self.CellControl.SetValue(self.table.GetValueByName(self.row, self.colname))
self.CellControl.SetFocus()
- def EndEditInternal(self, row, col, grid, old_duration):
- duration = self.CellControl.GetValue()
- changed = duration != old_duration
- if changed:
- self.table.SetValueByName(row, self.colname, duration)
- 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 EndEdit(self, row, col, grid, oldval):
+ value = self.CellControl.GetValue()
+ changed = value != oldval
+ if changed:
+ 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()
def SetSize(self, rect):
self.CellControl.SetDimensions(rect.x + 1, rect.y,