--- a/controls/VariablePanel.py Mon Mar 27 18:03:26 2017 +0300
+++ b/controls/VariablePanel.py Tue Mar 28 11:31:05 2017 +0300
@@ -781,7 +781,8 @@
- wx.CallAfter(self.ParentWindow.RefreshView, False)
+ self.ClearLocation(row, col, value) + wx.CallAfter(self.ParentWindow.RefreshView) elif colname == "Location":
wx.CallAfter(self.ParentWindow.RefreshView)
@@ -791,6 +792,13 @@
+ def ClearLocation(self, row, col, value): + if self.Values[row].Location != '': + if self.Table.GetColLabelValue(col, False) == 'Class' and value not in ["Local", "Global"] or \ + self.Table.GetColLabelValue(col, False) == 'Type' and not self.Parent.Controler.IsLocatableType(value): + self.Values[row].Location = '' def BuildStdIECTypesMenu(self,type_menu):
# build a submenu containing standard IEC types
base_menu = wx.Menu(title='')
@@ -849,6 +857,7 @@
label_value = self.Table.GetColLabelValue(col, False)
if label_value == "Type":
+ old_value = self.Values[row].Type classtype = self.Table.GetValueByName(row, "Class")
type_menu = wx.Menu(title='') # the root menu
@@ -870,6 +879,9 @@
self.VariablesGrid.PopupMenuXY(type_menu, corner_x, corner_y)
+ value = self.Values[row].Type + self.ClearLocation(row, col, value)