Fixed bug when adding block into Viewer and added wire validity after adding block with wire drop support
authorLaurent Bessard
Fri, 14 Jun 2013 11:07:59 +0200
changeset 1260 11903e79ce66
parent 1259 8350222a81c3
child 1261 46425f3248b7
Fixed bug when adding block into Viewer and added wire validity after adding block with wire drop support
editors/Viewer.py
--- a/editors/Viewer.py	Fri Jun 14 10:54:21 2013 +0200
+++ b/editors/Viewer.py	Fri Jun 14 11:07:59 2013 +0200
@@ -1923,6 +1923,8 @@
                         self.RefreshRect(self.GetScrolledRect(rect), False)
                     else:
                         self.SelectedElement.SetSelected(True)
+                        if not self.SelectedElement.IsConnectedCompatible():
+                            self.SelectedElement.SetValid(False)
             else:
                 if self.Debug:
                     Graphic_Element.OnLeftUp(self.SelectedElement, event, dc, self.Scaling)
@@ -2305,6 +2307,7 @@
                     values["extension"], values["inputs"], 
                     executionControl = values["executionControl"],
                     executionOrder = values["executionOrder"])
+            self.Controler.AddEditedElementBlock(self.TagName, id, values["type"], values.get("name", None))
             connector = None
             for input_connector in block.GetConnectors()["inputs"]:
                 if input_connector.IsCompatible(