Fixing bug when spinctrl new value is changed by ConfTreeNode
authorlaurent
Mon, 01 Oct 2012 19:10:51 +0200
changeset 844 ec9e6ef49878
parent 843 7e6fb43804a8
child 845 412a9f05070f
Fixing bug when spinctrl new value is changed by ConfTreeNode
editors/ConfTreeNodeEditor.py
--- a/editors/ConfTreeNodeEditor.py	Mon Oct 01 19:09:40 2012 +0200
+++ b/editors/ConfTreeNodeEditor.py	Mon Oct 01 19:10:51 2012 +0200
@@ -530,7 +530,10 @@
         def OnTextCtrlChanged(event):
             res = self.SetConfNodeParamsAttribute(path, textctrl.GetValue())
             if res != textctrl.GetValue():
-                textctrl.ChangeValue(res)
+                if isinstance(textctrl, wx.SpinCtrl):
+                    textctrl.SetValue(res)
+                else:
+                    textctrl.ChangeValue(res)
             if refresh:
                 wx.CallAfter(self.ParentWindow._Refresh, TITLE, FILEMENU, PROJECTTREE, PAGETITLES)
                 wx.CallAfter(self.ParentWindow.SelectProjectTreeItem, self.GetTagName())