fix issue, that was impossible to change variable location IEC-address, when wx 3.0 is used
--- a/controls/LocationCellEditor.py Tue Oct 04 17:43:30 2016 +0300
+++ b/controls/LocationCellEditor.py Tue Oct 04 18:01:08 2016 +0300
@@ -161,15 +161,22 @@
self.CellControl.SetVarType(self.Table.GetValueByName(row, 'Type'))
self.CellControl.SetFocus()
- def EndEdit(self, row, col, grid):
+ def EndEditInternal(self, row, col, grid, old_loc):
loc = self.CellControl.GetValue()
- old_loc = self.Table.GetValueByName(row, 'Location')
changed = loc != old_loc
if changed:
self.Table.SetValueByName(row, 'Location', loc)
self.Table.SetValueByName(row, 'Type', self.CellControl.GetVarType())
self.CellControl.Disable()
return changed
+
+ if wx.VERSION >= (3, 0, 0):
+ def EndEdit(self, row, col, grid, oldval):
+ self.EndEditInternal(row, col, grid, oldval)
+ else:
+ def EndEdit(self, row, col, grid):
+ old_loc = self.Table.GetValueByName(row, 'Location')
+ self.EndEditInternal(row, col, grid, oldval)
def SetSize(self, rect):
self.CellControl.SetDimensions(rect.x + 1, rect.y,