437 def OnRightUp(self, event, dc, scaling): |
437 def OnRightUp(self, event, dc, scaling): |
438 # Popup the menu with special items for a step |
438 # Popup the menu with special items for a step |
439 self.Parent.PopupDefaultMenu() |
439 self.Parent.PopupDefaultMenu() |
440 |
440 |
441 # Refreshes the step state according to move defined and handle selected |
441 # Refreshes the step state according to move defined and handle selected |
442 def ProcessDragging(self, movex, movey, centered, scaling): |
442 def ProcessDragging(self, movex, movey, event, scaling): |
443 handle_type, handle = self.Handle |
443 handle_type, handle = self.Handle |
444 if handle_type == HANDLE_MOVE: |
444 if handle_type == HANDLE_MOVE: |
445 movex = max(-self.BoundingBox.x, movex) |
445 movex = max(-self.BoundingBox.x, movex) |
446 movey = max(-self.BoundingBox.y, movey) |
446 movey = max(-self.BoundingBox.y, movey) |
447 if scaling is not None: |
447 if scaling is not None: |
462 self.Move(movex, 0) |
462 self.Move(movex, 0) |
463 self.RefreshInputPosition() |
463 self.RefreshInputPosition() |
464 self.RefreshOutputPosition() |
464 self.RefreshOutputPosition() |
465 return movex, 0 |
465 return movex, 0 |
466 else: |
466 else: |
467 return Graphic_Element.ProcessDragging(self, movex, movey, centered, scaling) |
467 return Graphic_Element.ProcessDragging(self, movex, movey, event, scaling) |
468 |
468 |
469 # Refresh input element model |
469 # Refresh input element model |
470 def RefreshInputModel(self): |
470 def RefreshInputModel(self): |
471 if self.Input: |
471 if self.Input: |
472 input = self.GetPreviousConnector() |
472 input = self.GetPreviousConnector() |
863 def OnRightUp(self, event, dc, scaling): |
863 def OnRightUp(self, event, dc, scaling): |
864 # Popup the menu with special items for a step |
864 # Popup the menu with special items for a step |
865 self.Parent.PopupDefaultMenu() |
865 self.Parent.PopupDefaultMenu() |
866 |
866 |
867 # Refreshes the transition state according to move defined and handle selected |
867 # Refreshes the transition state according to move defined and handle selected |
868 def ProcessDragging(self, movex, movey, centered, scaling): |
868 def ProcessDragging(self, movex, movey, event, scaling): |
869 if self.Parent.GetDrawingMode() != FREEDRAWING_MODE: |
869 if self.Parent.GetDrawingMode() != FREEDRAWING_MODE: |
870 movex = max(-self.BoundingBox.x, movex) |
870 movex = max(-self.BoundingBox.x, movex) |
871 if scaling is not None: |
871 if scaling is not None: |
872 movex = round(float(self.Pos.x + movex) / float(scaling[0])) * scaling[0] - self.Pos.x |
872 movex = round(float(self.Pos.x + movex) / float(scaling[0])) * scaling[0] - self.Pos.x |
873 self.Move(movex, 0) |
873 self.Move(movex, 0) |
874 self.RefreshInputPosition() |
874 self.RefreshInputPosition() |
875 self.RefreshOutputPosition() |
875 self.RefreshOutputPosition() |
876 return movex, 0 |
876 return movex, 0 |
877 else: |
877 else: |
878 return Graphic_Element.ProcessDragging(self, movex, movey, centered, scaling, width_fac = 2, height_fac = 2) |
878 return Graphic_Element.ProcessDragging(self, movex, movey, event, scaling, width_fac = 2, height_fac = 2) |
879 |
879 |
880 # Refresh input element model |
880 # Refresh input element model |
881 def RefreshInputModel(self): |
881 def RefreshInputModel(self): |
882 if self.Parent.GetDrawingMode() != FREEDRAWING_MODE: |
882 if self.Parent.GetDrawingMode() != FREEDRAWING_MODE: |
883 input = self.GetPreviousConnector() |
883 input = self.GetPreviousConnector() |
1359 else: |
1359 else: |
1360 # Popup the divergence menu without delete branch |
1360 # Popup the divergence menu without delete branch |
1361 self.Parent.PopupDivergenceMenu(False) |
1361 self.Parent.PopupDivergenceMenu(False) |
1362 |
1362 |
1363 # Refreshes the divergence state according to move defined and handle selected |
1363 # Refreshes the divergence state according to move defined and handle selected |
1364 def ProcessDragging(self, movex, movey, centered, scaling): |
1364 def ProcessDragging(self, movex, movey, event, scaling): |
1365 handle_type, handle = self.Handle |
1365 handle_type, handle = self.Handle |
1366 # A connector has been handled |
1366 # A connector has been handled |
1367 if handle_type == HANDLE_CONNECTOR: |
1367 if handle_type == HANDLE_CONNECTOR: |
1368 movex = max(-self.BoundingBox.x, movex) |
1368 movex = max(-self.BoundingBox.x, movex) |
1369 if scaling is not None: |
1369 if scaling is not None: |
1371 self.MoveConnector(handle, movex) |
1371 self.MoveConnector(handle, movex) |
1372 if self.Parent.GetDrawingMode() != FREEDRAWING_MODE: |
1372 if self.Parent.GetDrawingMode() != FREEDRAWING_MODE: |
1373 self.RefreshConnectedPosition(handle) |
1373 self.RefreshConnectedPosition(handle) |
1374 return movex, 0 |
1374 return movex, 0 |
1375 elif self.Parent.GetDrawingMode() == FREEDRAWING_MODE: |
1375 elif self.Parent.GetDrawingMode() == FREEDRAWING_MODE: |
1376 return Graphic_Element.ProcessDragging(self, movex, movey, centered, scaling) |
1376 return Graphic_Element.ProcessDragging(self, movex, movey, event, scaling) |
1377 return 0, 0 |
1377 return 0, 0 |
1378 |
1378 |
1379 # Refresh output element model |
1379 # Refresh output element model |
1380 def RefreshOutputModel(self, move=False): |
1380 def RefreshOutputModel(self, move=False): |
1381 if move and self.Parent.GetDrawingMode() != FREEDRAWING_MODE: |
1381 if move and self.Parent.GetDrawingMode() != FREEDRAWING_MODE: |
1600 def OnRightUp(self, event, dc, scaling): |
1600 def OnRightUp(self, event, dc, scaling): |
1601 # Popup the default menu |
1601 # Popup the default menu |
1602 self.Parent.PopupDefaultMenu() |
1602 self.Parent.PopupDefaultMenu() |
1603 |
1603 |
1604 # Refreshes the jump state according to move defined and handle selected |
1604 # Refreshes the jump state according to move defined and handle selected |
1605 def ProcessDragging(self, movex, movey, centered, scaling): |
1605 def ProcessDragging(self, movex, movey, event, scaling): |
1606 if self.Parent.GetDrawingMode() != FREEDRAWING_MODE: |
1606 if self.Parent.GetDrawingMode() != FREEDRAWING_MODE: |
1607 movex = max(-self.BoundingBox.x, movex) |
1607 movex = max(-self.BoundingBox.x, movex) |
1608 if scaling is not None: |
1608 if scaling is not None: |
1609 movex = round(float(self.Pos.x + movex) / float(scaling[0])) * scaling[0] - self.Pos.x |
1609 movex = round(float(self.Pos.x + movex) / float(scaling[0])) * scaling[0] - self.Pos.x |
1610 self.Move(movex, 0) |
1610 self.Move(movex, 0) |
1611 self.RefreshInputPosition() |
1611 self.RefreshInputPosition() |
1612 return movex, 0 |
1612 return movex, 0 |
1613 else: |
1613 else: |
1614 return Graphic_Element.ProcessDragging(self, movex, movey, centered, scaling, width_fac = 2) |
1614 return Graphic_Element.ProcessDragging(self, movex, movey, event, scaling, width_fac = 2) |
1615 |
1615 |
1616 # Refresh input element model |
1616 # Refresh input element model |
1617 def RefreshInputModel(self): |
1617 def RefreshInputModel(self): |
1618 if self.Parent.GetDrawingMode() != FREEDRAWING_MODE: |
1618 if self.Parent.GetDrawingMode() != FREEDRAWING_MODE: |
1619 input = self.GetPreviousConnector() |
1619 input = self.GetPreviousConnector() |
1850 def OnRightUp(self, event, dc, scaling): |
1850 def OnRightUp(self, event, dc, scaling): |
1851 # Popup the default menu |
1851 # Popup the default menu |
1852 self.Parent.PopupDefaultMenu() |
1852 self.Parent.PopupDefaultMenu() |
1853 |
1853 |
1854 # Refreshes the action block state according to move defined and handle selected |
1854 # Refreshes the action block state according to move defined and handle selected |
1855 def ProcessDragging(self, movex, movey, centered, scaling): |
1855 def ProcessDragging(self, movex, movey, event, scaling): |
1856 if self.Parent.GetDrawingMode() != FREEDRAWING_MODE: |
1856 if self.Parent.GetDrawingMode() != FREEDRAWING_MODE: |
1857 handle_type, handle = self.Handle |
1857 handle_type, handle = self.Handle |
1858 if handle_type == HANDLE_MOVE: |
1858 if handle_type == HANDLE_MOVE: |
1859 movex = max(-self.BoundingBox.x, movex) |
1859 movex = max(-self.BoundingBox.x, movex) |
1860 if scaling is not None: |
1860 if scaling is not None: |
1865 if self.Pos.x - input_pos.x + movex >= SFC_WIRE_MIN_SIZE: |
1865 if self.Pos.x - input_pos.x + movex >= SFC_WIRE_MIN_SIZE: |
1866 self.Move(movex, 0) |
1866 self.Move(movex, 0) |
1867 return movex, 0 |
1867 return movex, 0 |
1868 return 0, 0 |
1868 return 0, 0 |
1869 else: |
1869 else: |
1870 return Graphic_Element.ProcessDragging(self, movex, movey, centered, scaling) |
1870 return Graphic_Element.ProcessDragging(self, movex, movey, event, scaling) |
1871 else: |
1871 else: |
1872 return Graphic_Element.ProcessDragging(self, movex, movey, centered, scaling) |
1872 return Graphic_Element.ProcessDragging(self, movex, movey, event, scaling) |
1873 |
1873 |
1874 |
1874 |
1875 # Refreshes the action block model |
1875 # Refreshes the action block model |
1876 def RefreshModel(self, move=True): |
1876 def RefreshModel(self, move=True): |
1877 self.Parent.RefreshActionBlockModel(self) |
1877 self.Parent.RefreshActionBlockModel(self) |