697 self.Input.UnConnect(delete = self.Parent.GetDrawingMode() == FREEDRAWING_MODE) |
697 self.Input.UnConnect(delete = self.Parent.GetDrawingMode() == FREEDRAWING_MODE) |
698 self.Output.UnConnect(delete = self.Parent.GetDrawingMode() == FREEDRAWING_MODE) |
698 self.Output.UnConnect(delete = self.Parent.GetDrawingMode() == FREEDRAWING_MODE) |
699 if self.Type == "connection": |
699 if self.Type == "connection": |
700 self.Condition.UnConnect(delete = self.Parent.GetDrawingMode() == FREEDRAWING_MODE) |
700 self.Condition.UnConnect(delete = self.Parent.GetDrawingMode() == FREEDRAWING_MODE) |
701 |
701 |
|
702 # Returns if the point given is in the bounding box |
|
703 def HitTest(self, pt, connectors=True): |
|
704 if self.Type != "connection": |
|
705 # Calculate the bounding box of the condition outside the transition |
|
706 text_width, text_height = self.ConditionSize |
|
707 text_bbx = wx.Rect(self.Pos.x + self.Size[0] + 5, |
|
708 self.Pos.y + (self.Size[1] - text_height) / 2, |
|
709 text_width, |
|
710 text_height) |
|
711 test_text = text_bbx.InsideXY(pt.x, pt.y) |
|
712 else: |
|
713 test_text = False |
|
714 return test_text or Graphic_Element.HitTest(self, pt, connectors) |
|
715 |
702 # Refresh the transition bounding box |
716 # Refresh the transition bounding box |
703 def RefreshBoundingBox(self): |
717 def RefreshBoundingBox(self): |
704 bbx_x, bbx_y, bbx_width, bbx_height = self.Pos.x, self.Pos.y, self.Size[0], self.Size[1] |
718 bbx_x, bbx_y, bbx_width, bbx_height = self.Pos.x, self.Pos.y, self.Size[0], self.Size[1] |
705 if self.Priority != 0: |
719 if self.Priority != 0: |
706 bbx_y = self.Pos.y - self.PrioritySize[1] - 2 |
720 bbx_y = self.Pos.y - self.PrioritySize[1] - 2 |
1553 self.Input.UnConnect(delete = self.Parent.GetDrawingMode() == FREEDRAWING_MODE) |
1567 self.Input.UnConnect(delete = self.Parent.GetDrawingMode() == FREEDRAWING_MODE) |
1554 |
1568 |
1555 # Refresh the size of text for target |
1569 # Refresh the size of text for target |
1556 def RefreshTargetSize(self): |
1570 def RefreshTargetSize(self): |
1557 self.TargetSize = self.Parent.GetTextExtent(self.Target) |
1571 self.TargetSize = self.Parent.GetTextExtent(self.Target) |
|
1572 |
|
1573 # Returns if the point given is in the bounding box |
|
1574 def HitTest(self, pt, connectors=True): |
|
1575 # Calculate the bounding box of the condition outside the transition |
|
1576 text_width, text_height = self.TargetSize |
|
1577 text_bbx = wx.Rect(self.Pos.x + self.Size[0] + 2, |
|
1578 self.Pos.y + (self.Size[1] - text_height) / 2, |
|
1579 text_width, |
|
1580 text_height) |
|
1581 return text_bbx.InsideXY(pt.x, pt.y) or Graphic_Element.HitTest(self, pt, connectors) |
1558 |
1582 |
1559 # Refresh the jump bounding box |
1583 # Refresh the jump bounding box |
1560 def RefreshBoundingBox(self): |
1584 def RefreshBoundingBox(self): |
1561 text_width, text_height = self.Parent.GetTextExtent(self.Target) |
1585 text_width, text_height = self.Parent.GetTextExtent(self.Target) |
1562 # Calculate the bounding box size |
1586 # Calculate the bounding box size |