editors/Viewer.py
changeset 1567 a4bf874e4949
parent 1556 32e9d0ef30dc
child 1571 486f94a8032c
--- a/editors/Viewer.py	Thu Nov 17 13:48:36 2016 +0300
+++ b/editors/Viewer.py	Thu Nov 17 14:04:44 2016 +0300
@@ -1467,12 +1467,16 @@
 
     def FindBlockConnectorWithError(self, pos, direction = None, exclude = None):
         error = False        
+        startblock = None
         for block in self.Blocks.itervalues():
             connector = block.TestConnector(pos, direction, exclude)
             if connector:
+                if self.IsWire(self.SelectedElement):
+                    startblock = self.SelectedElement.StartConnected.GetParentBlock()
                 avail, error = connector.ConnectionAvailable(direction, exclude)
-                if not avail:
+                if not avail or not self.BlockCompatibility(startblock, block, direction):
                     connector = None
+                    error = True
                 return connector, error
         return None, error
     
@@ -2349,6 +2353,9 @@
                 self.Scroll(xstart + move_window.x, ystart + move_window.y)
                 self.RefreshScrollBars(move_window.x, move_window.y)
 
+    def BlockCompatibility(self, startblock=None, endblock=None, direction = None):
+        return True
+
 #-------------------------------------------------------------------------------
 #                          Keyboard event functions
 #-------------------------------------------------------------------------------