--- a/graphics/SFC_Objects.py Wed Jan 25 01:26:29 2012 +0100
+++ b/graphics/SFC_Objects.py Mon Jan 30 16:12:19 2012 +0100
@@ -253,10 +253,10 @@
# Returns the step connector that starts with the point given if it exists
def GetConnector(self, position, name = None):
# if a name is given
- if name:
+ if name is not None:
# Test input, output and action connector if they exists
- if self.Input and name == self.Input.GetName():
- return self.Input
+ #if self.Input and name == self.Input.GetName():
+ # return self.Input
if self.Output and name == self.Output.GetName():
return self.Output
if self.Action and name == self.Action.GetName():
@@ -757,10 +757,10 @@
# Returns the transition connector that starts with the point given if it exists
def GetConnector(self, position, name = None):
# if a name is given
- if name:
+ if name is not None:
# Test input and output connector
- if name == self.Input.GetName():
- return self.Input
+ #if name == self.Input.GetName():
+ # return self.Input
if name == self.Output.GetName():
return self.Output
if self.Type == "connection" and name == self.Condition.GetName():
@@ -1178,8 +1178,11 @@
return len(self.Inputs)
# Returns if the point given is in the bounding box
- def HitTest(self, pt):
- rect = self.BoundingBox
+ def HitTest(self, pt, connectors=True):
+ if connectors:
+ rect = self.BoundingBox
+ else:
+ rect = wx.Rect(self.Pos.x, self.Pos.y, self.Size[0], self.Size[1])
return rect.InsideXY(pt.x, pt.y) or self.TestConnector(pt, exclude=False) != None
# Refresh the divergence bounding box
@@ -1229,11 +1232,11 @@
# Returns the divergence connector that starts with the point given if it exists
def GetConnector(self, position, name = None):
# if a name is given
- if name:
+ if name is not None:
# Test each input and output connector
- for input in self.Inputs:
- if name == input.GetName():
- return input
+ #for input in self.Inputs:
+ # if name == input.GetName():
+ # return input
for output in self.Outputs:
if name == output.GetName():
return output