--- a/Dialogs.py Mon Jan 19 08:21:41 2009 +0100
+++ b/Dialogs.py Mon Jan 19 17:07:03 2009 +0100
@@ -206,8 +206,13 @@
def FindTreeItem(self, root, name, inputs = None):
if root.IsOk():
pydata = self.TypeTree.GetPyData(root)
- if inputs and "inputs" in pydata:
- same_inputs = pydata["inputs"] == inputs
+ type_inputs = pydata.get("inputs", None)
+ type_extension = pydata.get("extension", None)
+ if inputs is not None and type_inputs is not None:
+ if type_extension is not None:
+ same_inputs = type_inputs == inputs[:type_extension]
+ else:
+ same_inputs = type_inputs == inputs
else:
same_inputs = True
if self.TypeTree.GetItemText(root) == name and same_inputs:
@@ -267,7 +272,12 @@
self.TypeTree.SetPyData(category_item, {"type" : CATEGORY})
for blocktype in category["list"]:
blocktype_item = self.TypeTree.AppendItem(category_item, blocktype["name"])
- self.TypeTree.SetPyData(blocktype_item, {"type" : BLOCK, "inputs" : tuple([type for name, type, modifier in blocktype["inputs"]])})
+ block_data = {"type" : BLOCK,
+ "inputs" : tuple([type for name, type, modifier in blocktype["inputs"]]),
+ "extension" : None}
+ if blocktype["extensible"]:
+ block_data["extension"] = len(blocktype["inputs"])
+ self.TypeTree.SetPyData(blocktype_item, block_data)
if wx.Platform == '__WXMSW__':
self.TypeTree.Expand(root)