Viewer.py
changeset 98 ec5d7af033d8
parent 97 28337cd092fd
child 102 85875dcb7754
equal deleted inserted replaced
97:28337cd092fd 98:ec5d7af033d8
   270         self.Blocks = {}
   270         self.Blocks = {}
   271         self.Wires = {}
   271         self.Wires = {}
   272         self.Comments = {}
   272         self.Comments = {}
   273         self.SelectedElement = None
   273         self.SelectedElement = None
   274     
   274     
       
   275     # Verify wires type compatibility
       
   276     def VerifyVariableTypeCompatibility(self):
       
   277         to_delete = []
       
   278         for wire in self.Wires:
       
   279             if not wire.IsConnectedCompatible():
       
   280                 to_delete.append(wire)
       
   281         for wire in to_delete:
       
   282             wire.Delete()
       
   283     
   275     # Remove all elements
   284     # Remove all elements
   276     def CleanView(self):
   285     def CleanView(self):
   277         for block in self.Blocks.keys():
   286         for block in self.Blocks.keys():
   278             block.Clean()
   287             block.Clean()
   279         self.ResetView()
   288         self.ResetView()
   321             instance = self.Controler.GetCurrentElementEditingInstanceInfos(exclude=ids)
   330             instance = self.Controler.GetCurrentElementEditingInstanceInfos(exclude=ids)
   322             if instance:
   331             if instance:
   323                 self.loadInstance(instance, ids)
   332                 self.loadInstance(instance, ids)
   324         self.RefreshScrollBars()
   333         self.RefreshScrollBars()
   325         self.Refresh(False)
   334         self.Refresh(False)
   326     
       
   327     def Scroll(self, x, y):
       
   328         print "Scroll to (%d, %d)"%(x, y)
       
   329         wx.ScrolledWindow.Scroll(self, x, y)
       
   330     
   335     
   331     def RefreshScrollBars(self):
   336     def RefreshScrollBars(self):
   332         xstart, ystart = self.GetViewStart()
   337         xstart, ystart = self.GetViewStart()
   333         window_size = self.GetClientSize()
   338         window_size = self.GetClientSize()
   334         maxx = maxy = 0
   339         maxx = maxy = 0