# HG changeset patch # User b.taylor@willowglen.ca # Date 1253123488 21600 # Node ID dbc4a66190a63544755d9fc4ca37971a1d60ca2a # Parent d19c4a6460ab9263d75cfd5b1cdd0785ee1604b3 set variable documentation when a location is selected from the VariableLocationBrowser diff -r d19c4a6460ab -r dbc4a66190a6 VariablePanel.py --- a/VariablePanel.py Tue Sep 15 14:06:59 2009 -0600 +++ b/VariablePanel.py Wed Sep 16 11:51:28 2009 -0600 @@ -903,17 +903,18 @@ dia.ShowModal() if dia.Selection: - loc, iec_type = dia.Selection + loc, iec_type, doc = dia.Selection # set the location self.SetText(loc) - # set the variable type + # set the variable type and documentation # NOTE: this update won't be displayed until editing is complete # (when EndEdit is called). # we can't call VarPanel.RefreshValues() here because it causes # an exception. self.VarPanel.Table.SetValueByName(self.Row, 'Type', iec_type) + self.VarPanel.Table.SetValueByName(self.Row, 'Documentation', doc) self.txt.SetFocus() @@ -1167,5 +1168,14 @@ dir = self.GetSelectedDirection() location = '%' + dir + location - self.Selection = (location, data.type) + # walk up the tree, building documentation for the variable + documentation = self.tree.GetItemText(item) + parent = self.tree.GetItemParent(item) + root = self.tree.GetRootItem() + while parent != root: + text = self.tree.GetItemText(parent) + documentation = text + ":" + documentation + parent = self.tree.GetItemParent(parent) + + self.Selection = (location, data.type, documentation) self.Destroy()