fix issue, that was impossible to change time interval for cyclic
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Fri, 22 Apr 2016 16:24:06 +0300
changeset 1499 8626bba4b2a8
parent 1498 b11045a2f17c
child 1500 007588fb6549
fix issue, that was impossible to change time interval for cyclic
tasks, when wx 3.0 is used
controls/DurationCellEditor.py
--- a/controls/DurationCellEditor.py	Thu Apr 21 20:42:37 2016 +0300
+++ b/controls/DurationCellEditor.py	Fri Apr 22 16:24:06 2016 +0300
@@ -118,15 +118,22 @@
         self.CellControl.SetValue(self.Table.GetValueByName(row, self.Colname))
         self.CellControl.SetFocus()
 
-    def EndEdit(self, row, col, grid):
+    def EndEditInternal(self, row, col, grid, old_duration):
         duration = self.CellControl.GetValue()
-        old_duration = self.Table.GetValueByName(row, self.Colname)
         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):
+            self.EndEditInternal(row, col, grid, oldval)
+    else:
+        def EndEdit(self, row, col, grid):
+            oldval = self.Table.GetValueByName(row, self.Colname)            
+            self.EndEditInternal(row, col, grid, oldval)    
+
     def SetSize(self, rect):
         self.CellControl.SetDimensions(rect.x + 1, rect.y,
                                         rect.width, rect.height,