parameters: (self, event, HitEvent)
docstring: Does a hit test on objects that are "hit-able"
  
          If an object is hit, its event handler is called,
          and this method returns True
  
          If no object is hit, this method returns False.
  
          If the event is outside the Window, no object will be considered hit
docstring_summary: Does a hit test on objects that are "hit-able"
docstring_tokens: Does a hit test on objects that are hit - able
function: def HitTest(self, event, HitEvent):
          """
          Does a hit test on objects that are "hit-able"
  
          If an object is hit, its event handler is called,
          and this method returns True
  
          If no object is hit, this method returns False.
  
          If the event is outside the Window, no object will be considered hit
          """
          if self.HitDict:
              # check if there are any objects in the dict for this event
              if self.HitDict[ HitEvent ]:
                  xy = event.GetPosition()
                  winsize = self.Size
                  if not (xy[0] < 0 or xy[1] < 0 or xy[0] > winsize[0] or xy[1] > winsize[1]):
                      # The mouse event is in the Window
                      color = self.GetHitTestColor( xy )
                      if color in self.HitDict[ HitEvent ]:
                          Object = self.HitDict[ HitEvent ][color]
                          self._CallHitCallback(Object, xy, HitEvent)
                          return True
              return False
function_tokens: def HitTest ( self , event , HitEvent ) : if self . HitDict : # check if there are any objects in the dict for this event if self . HitDict [ HitEvent ] : xy = event . GetPosition ( ) winsize = self . Size if not ( xy [ 0 ] < 0 or xy [ 1 ] < 0 or xy [ 0 ] > winsize [ 0 ] or xy [ 1 ] > winsize [ 1 ] ) : # The mouse event is in the Window color = self . GetHitTestColor ( xy ) if color in self . HitDict [ HitEvent ] : Object = self . HitDict [ HitEvent ] [ color ] self . _CallHitCallback ( Object , xy , HitEvent ) return True return False