# HG changeset patch # User lbessard # Date 1197216465 -3600 # Node ID 436268f31daea351f86dff0aae321ab8904b9e65 # Parent 4a76987f8a4097b40f4ee0479196494d88d7157e Adding contextual menu on LD_Contact, LD_Coil, LD_PowerRail and SFC_ActionBlock diff -r 4a76987f8a40 -r 436268f31dae graphics/LD_Objects.py --- a/graphics/LD_Objects.py Sun Dec 09 16:59:15 2007 +0100 +++ b/graphics/LD_Objects.py Sun Dec 09 17:07:45 2007 +0100 @@ -288,15 +288,7 @@ # Method called when a RightUp event have been generated def OnRightUp(self, event, dc, scaling): - pos = GetScaledEventPosition(event, dc, scaling) - # Popup the menu with special items for a block and a connector if one is handled - connector = self.TestConnector(pos, False) - if connector: - self.Handle = (HANDLE_CONNECTOR, connector) - # self.Parent.PopupDivergenceMenu(True) - #else: - # Popup the divergence menu without delete branch - # self.Parent.PopupDivergenceMenu(False) + self.Parent.PopupDefaultMenu() # Refreshes the powerrail state according to move defined and handle selected def ProcessDragging(self, movex, movey): @@ -496,6 +488,11 @@ # Edit the contact properties self.Parent.EditContactContent(self) + # Method called when a RightUp event have been generated + def OnRightUp(self, event, dc, scaling): + # Popup the default menu + self.Parent.PopupDefaultMenu() + # Refreshes the contact model def RefreshModel(self, move=True): self.Parent.RefreshContactModel(self) @@ -695,6 +692,11 @@ # Edit the coil properties self.Parent.EditCoilContent(self) + # Method called when a RightUp event have been generated + def OnRightUp(self, event, dc, scaling): + # Popup the default menu + self.Parent.PopupDefaultMenu() + # Refreshes the coil model def RefreshModel(self, move=True): self.Parent.RefreshCoilModel(self) diff -r 4a76987f8a40 -r 436268f31dae graphics/SFC_Objects.py --- a/graphics/SFC_Objects.py Sun Dec 09 16:59:15 2007 +0100 +++ b/graphics/SFC_Objects.py Sun Dec 09 17:07:45 2007 +0100 @@ -373,6 +373,7 @@ if self.Parent.GetDrawingMode() == FREEDRAWING_MODE: self.Move(movex, movey) self.RefreshConnected() + return True, True elif self.Initial: self.MoveActionBlock((movex, movey)) self.Move(movex, movey, self.Parent.Wires) @@ -1494,6 +1495,11 @@ # Edit the action block properties self.Parent.EditActionBlockContent(self) + # Method called when a RightUp event have been generated + def OnRightUp(self, event, dc, scaling): + # Popup the default menu + self.Parent.PopupDefaultMenu() + # Refreshes the action block state according to move defined and handle selected def ProcessDragging(self, movex, movey): if self.Parent.GetDrawingMode() != FREEDRAWING_MODE: