equal
deleted
inserted
replaced
120 self.ExecutionOrderSize = self.Parent.GetTextExtent(str(self.ExecutionOrder)) |
120 self.ExecutionOrderSize = self.Parent.GetTextExtent(str(self.ExecutionOrder)) |
121 |
121 |
122 # Returns if the point given is in the bounding box |
122 # Returns if the point given is in the bounding box |
123 def HitTest(self, pt, connectors=True): |
123 def HitTest(self, pt, connectors=True): |
124 if self.Name != "": |
124 if self.Name != "": |
125 test_text = self.GetTextBoundingBox().InsideXY(pt.x, pt.y) |
125 test_text = self.GetTextBoundingBox().Contains(pt.x, pt.y) |
126 else: |
126 else: |
127 test_text = False |
127 test_text = False |
128 test_block = self.GetBlockBoundingBox(connectors).InsideXY(pt.x, pt.y) |
128 test_block = self.GetBlockBoundingBox(connectors).Contains(pt.x, pt.y) |
129 return test_text or test_block |
129 return test_text or test_block |
130 |
130 |
131 # Returns the bounding box of the name outside the block |
131 # Returns the bounding box of the name outside the block |
132 def GetTextBoundingBox(self): |
132 def GetTextBoundingBox(self): |
133 # Calculate the size of the name outside the block |
133 # Calculate the size of the name outside the block |
390 # def OnMotion(self, event, dc, scaling): |
390 # def OnMotion(self, event, dc, scaling): |
391 # if not event.Dragging(): |
391 # if not event.Dragging(): |
392 # pos = event.GetLogicalPosition(dc) |
392 # pos = event.GetLogicalPosition(dc) |
393 # for input in self.Inputs: |
393 # for input in self.Inputs: |
394 # rect = input.GetRedrawRect() |
394 # rect = input.GetRedrawRect() |
395 # if rect.InsideXY(pos.x, pos.y): |
395 # if rect.Contains(pos.x, pos.y): |
396 # print "Find input" |
396 # print "Find input" |
397 # tip = wx.TipWindow(self.Parent, "Test") |
397 # tip = wx.TipWindow(self.Parent, "Test") |
398 # tip.SetBoundingRect(rect) |
398 # tip.SetBoundingRect(rect) |
399 # return Graphic_Element.OnMotion(self, event, dc, scaling) |
399 # return Graphic_Element.OnMotion(self, event, dc, scaling) |
400 |
400 |