# HG changeset patch # User Edouard Tisserant # Date 1369793280 -32400 # Node ID 891b49d2752bf78d1bfa2bde5683ef14b265fe8c # Parent a0161880582113d4bee5db8ed5206d3c19af6c3a Fixed non-tested bad code in VariablePanel diff -r a01618805821 -r 891b49d2752b controls/VariablePanel.py --- a/controls/VariablePanel.py Wed May 29 00:11:27 2013 +0200 +++ b/controls/VariablePanel.py Wed May 29 11:08:00 2013 +0900 @@ -42,15 +42,15 @@ # Helpers #------------------------------------------------------------------------------- -def AppendMenu(parent, help, id, kind, text): - if wx.VERSION >= (2, 6, 0): - parent.Append(help=help, id=id, kind=kind, text=text) - else: - parent.Append(helpString=help, id=id, kind=kind, item=text) - +def AppendMenu(parent, help, id, kind, text): + if wx.VERSION >= (2, 6, 0): + parent.Append(help=help, id=id, kind=kind, text=text) + else: + parent.Append(helpString=help, id=id, kind=kind, item=text) + [TITLE, EDITORTOOLBAR, FILEMENU, EDITMENU, DISPLAYMENU, PROJECTTREE, POUINSTANCEVARIABLESPANEL, LIBRARYTREE, SCALING, PAGETITLES -] = range(10) +] = range(10) def GetVariableTableColnames(location): _ = lambda x : x @@ -536,7 +536,9 @@ name = row_content["Name"] start_idx = 0 else: - name = "" + row_content = None + start_idx = 0 + name = "LocalVar" if row_content is not None and row_content["Edit"]: row_content = self.Values[new_row - 1].copy() @@ -716,7 +718,7 @@ if old_value != "": self.Controler.UpdateEditedElementUsedVariable(self.TagName, old_value, value) self.Controler.BufferProject() - wx.CallAfter(self.ParentWindow.RefreshView, False) + wx.CallAfter(self.ParentWindow.RefreshView, False) self.ParentWindow._Refresh(TITLE, FILEMENU, EDITMENU, PAGETITLES, POUINSTANCEVARIABLESPANEL, LIBRARYTREE) else: self.SaveValues() @@ -860,7 +862,7 @@ self.Controler.SetPouInterfaceVars(words[1], self.Values) if buffer: self.Controler.BufferProject() - self.ParentWindow._Refresh(TITLE, FILEMENU, EDITMENU, PAGETITLES, POUINSTANCEVARIABLESPANEL, LIBRARYTREE) + self.ParentWindow._Refresh(TITLE, FILEMENU, EDITMENU, PAGETITLES, POUINSTANCEVARIABLESPANEL, LIBRARYTREE) #------------------------------------------------------------------------------- # Highlights showing functions