Modify search algorithm in LibraryPanel to search match in whole block name, not only at beginning
authorLaurent Bessard
Thu, 25 Apr 2013 09:37:56 +0200
changeset 1068 ef088254ba4b
parent 1067 4f460c1dffb5
child 1069 880ec628d490
Modify search algorithm in LibraryPanel to search match in whole block name, not only at beginning
controls/LibraryPanel.py
--- a/controls/LibraryPanel.py	Thu Apr 25 11:54:07 2013 +0900
+++ b/controls/LibraryPanel.py	Thu Apr 25 09:37:56 2013 +0200
@@ -224,7 +224,7 @@
                     item = self.Tree.GetNextSibling(item)
             else:
                 name = self.Tree.GetItemText(item)
-                if name.upper().startswith(value.upper()) and item != selected:
+                if name.upper().find(value.upper()) != -1 and item != selected:
                     child, child_cookie = self.Tree.GetFirstChild(root)
                     while child.IsOk():
                         self.Tree.CollapseAllChildren(child)