graphics/LD_Objects.py
changeset 127 436268f31dae
parent 112 317148fc1225
child 138 9c74d00ce93e
equal deleted inserted replaced
126:4a76987f8a40 127:436268f31dae
   286         # Edit the powerrail properties
   286         # Edit the powerrail properties
   287         self.Parent.EditPowerRailContent(self)
   287         self.Parent.EditPowerRailContent(self)
   288     
   288     
   289     # Method called when a RightUp event have been generated
   289     # Method called when a RightUp event have been generated
   290     def OnRightUp(self, event, dc, scaling):
   290     def OnRightUp(self, event, dc, scaling):
   291         pos = GetScaledEventPosition(event, dc, scaling)
   291         self.Parent.PopupDefaultMenu()
   292         # Popup the menu with special items for a block and a connector if one is handled
       
   293         connector = self.TestConnector(pos, False)
       
   294         if connector:
       
   295             self.Handle = (HANDLE_CONNECTOR, connector)
       
   296         #    self.Parent.PopupDivergenceMenu(True)
       
   297         #else:
       
   298             # Popup the divergence menu without delete branch
       
   299         #    self.Parent.PopupDivergenceMenu(False)
       
   300     
   292     
   301     # Refreshes the powerrail state according to move defined and handle selected
   293     # Refreshes the powerrail state according to move defined and handle selected
   302     def ProcessDragging(self, movex, movey):
   294     def ProcessDragging(self, movex, movey):
   303         handle_type, handle = self.Handle
   295         handle_type, handle = self.Handle
   304         # A connector has been handled
   296         # A connector has been handled
   493     
   485     
   494     # Method called when a LeftDClick event have been generated
   486     # Method called when a LeftDClick event have been generated
   495     def OnLeftDClick(self, event, dc, scaling):
   487     def OnLeftDClick(self, event, dc, scaling):
   496         # Edit the contact properties
   488         # Edit the contact properties
   497         self.Parent.EditContactContent(self)
   489         self.Parent.EditContactContent(self)
       
   490     
       
   491     # Method called when a RightUp event have been generated
       
   492     def OnRightUp(self, event, dc, scaling):
       
   493         # Popup the default menu
       
   494         self.Parent.PopupDefaultMenu()
   498     
   495     
   499     # Refreshes the contact model
   496     # Refreshes the contact model
   500     def RefreshModel(self, move=True):
   497     def RefreshModel(self, move=True):
   501         self.Parent.RefreshContactModel(self)
   498         self.Parent.RefreshContactModel(self)
   502         # If contact has moved, refresh the model of wires connected to output
   499         # If contact has moved, refresh the model of wires connected to output
   692     
   689     
   693     # Method called when a LeftDClick event have been generated
   690     # Method called when a LeftDClick event have been generated
   694     def OnLeftDClick(self, event, dc, scaling):
   691     def OnLeftDClick(self, event, dc, scaling):
   695         # Edit the coil properties
   692         # Edit the coil properties
   696         self.Parent.EditCoilContent(self)
   693         self.Parent.EditCoilContent(self)
       
   694     
       
   695     # Method called when a RightUp event have been generated
       
   696     def OnRightUp(self, event, dc, scaling):
       
   697         # Popup the default menu
       
   698         self.Parent.PopupDefaultMenu()
   697     
   699     
   698     # Refreshes the coil model
   700     # Refreshes the coil model
   699     def RefreshModel(self, move=True):
   701     def RefreshModel(self, move=True):
   700         self.Parent.RefreshCoilModel(self)
   702         self.Parent.RefreshCoilModel(self)
   701         # If coil has moved, refresh the model of wires connected to output
   703         # If coil has moved, refresh the model of wires connected to output