parameters: (self, event)
docstring: React according to the new event.  This is the main
          entry point into the class.  This method contains the
          logic for the class's behavior.
docstring_summary: React according to the new event.  This is the main
          entry point into the class.  This method contains the
          logic for the class's behavior.
docstring_tokens: React according to the new event . This is the main entry point into the class . This method contains the logic for the class s behavior .
function: def __handleMouseEvents(self, event):
          """
          React according to the new event.  This is the main
          entry point into the class.  This method contains the
          logic for the class's behavior.
          """
          if not self.enabled:
              return
  
          x, y = event.GetPosition()
  
          # First make sure we have started a box.
          if self.currentBox == None and not event.LeftDown():
              # No box started yet.  Set cursor to the initial kind.
              self.__setCursor(wx.CURSOR_CROSS)
              return
  
          if event.LeftDown():
              if self.currentBox == None:
                  # No RB Box, so start a new one.
                  self.currentBox = (x, y, 0, 0)
                  self.hasLetUp   = 0
              elif self.__isSizingCursor():
                  # Starting a sizing operation.  Change the origin.
                  position = getCursorPosition(x, y, self.currentBox, thickness=self.__THICKNESS)
                  self.currentBox = self.__denormalizeBox(position, self.currentBox)
  
          elif event.Dragging() and event.LeftIsDown():
              # Use the cursor type to determine operation
              if self.__isMovingCursor():
                  if self.currentlyMoving or pointInBox(x, y, self.currentBox):
                      if not self.currentlyMoving:
                          self.currentlyMoving = (x - self.currentBox[0], y - self.currentBox[1])
                      self.__moveTo(x - self.currentlyMoving[0], y - self.currentlyMoving[1])
              elif self.__isSizingCursor():
                  self.__resizeBox(x, y)
  
          elif event.LeftUp():
              self.hasLetUp = 1
              self.currentlyMoving = None
              self.__normalizeBox()
  
          elif event.Moving() and not event.Dragging():
              # Simple mouse movement event
              self.__mouseMoved(x,y)
function_tokens: def __handleMouseEvents ( self , event ) : if not self . enabled : return x , y = event . GetPosition ( ) # First make sure we have started a box. if self . currentBox == None and not event . LeftDown ( ) : # No box started yet.  Set cursor to the initial kind. self . __setCursor ( wx . CURSOR_CROSS ) return if event . LeftDown ( ) : if self . currentBox == None : # No RB Box, so start a new one. self . currentBox = ( x , y , 0 , 0 ) self . hasLetUp = 0 elif self . __isSizingCursor ( ) : # Starting a sizing operation.  Change the origin. position = getCursorPosition ( x , y , self . currentBox , thickness = self . __THICKNESS ) self . currentBox = self . __denormalizeBox ( position , self . currentBox ) elif event . Dragging ( ) and event . LeftIsDown ( ) : # Use the cursor type to determine operation if self . __isMovingCursor ( ) : if self . currentlyMoving or pointInBox ( x , y , self . currentBox ) : if not self . currentlyMoving : self . currentlyMoving = ( x - self . currentBox [ 0 ] , y - self . currentBox [ 1 ] ) self . __moveTo ( x - self . currentlyMoving [ 0 ] , y - self . currentlyMoving [ 1 ] ) elif self . __isSizingCursor ( ) : self . __resizeBox ( x , y ) elif event . LeftUp ( ) : self . hasLetUp = 1 self . currentlyMoving = None self . __normalizeBox ( ) elif event . Moving ( ) and not event . Dragging ( ) : # Simple mouse movement event self . __mouseMoved ( x , y )