# HG changeset patch # User lbessard # Date 1220874994 -7200 # Node ID 3b92f0b96d31ac632e809233a9588716d85fbb16 # Parent 6fe3ee00f9a0967b9889d1acd23bc0e08bbddfcf Bug with item selection on InstancesTree fixed diff -r 6fe3ee00f9a0 -r 3b92f0b96d31 PLCOpenEditor.py --- a/PLCOpenEditor.py Mon Sep 08 10:32:41 2008 +0200 +++ b/PLCOpenEditor.py Mon Sep 08 13:56:34 2008 +0200 @@ -1790,20 +1790,20 @@ def SelectInstancesTreeItem(self, root, instancepath): found = False if self.InstancesTree is not None: - paths = instancepath.split(".") + paths = instancepath.split(".", 1) if wx.VERSION >= (2, 6, 0): item, root_cookie = self.InstancesTree.GetFirstChild(root) else: item, root_cookie = self.InstancesTree.GetFirstChild(root, 0) while item.IsOk() and not found: - if self.InstancesTree.GetItemText(item) == paths[0]: + name = self.InstancesTree.GetItemText(item).split(" (")[0] + if name == paths[0]: if len(paths) == 1: self.InstancesTree.SelectItem(item) return True else: - found = self.SelectInstancesTreeItem(item, paths[1:]) - else: - item, root_cookie = self.InstancesTree.GetNextChild(root, root_cookie) + found = self.SelectInstancesTreeItem(item, paths[1]) + item, root_cookie = self.InstancesTree.GetNextChild(root, root_cookie) return found #-------------------------------------------------------------------------------