parameters: (self, event)
docstring: Handles the ``wx.EVT_MOUSE_EVENTS`` event for :class:`UltimateListHeaderWindow`.
  
          :param `event`: a :class:`MouseEvent` event to be processed.
docstring_summary: Handles the ``wx.EVT_MOUSE_EVENTS`` event for :class:`UltimateListHeaderWindow`.
docstring_tokens: Handles the wx . EVT_MOUSE_EVENTS event for : class : UltimateListHeaderWindow .
function: def OnMouse(self, event):
          """
          Handles the ``wx.EVT_MOUSE_EVENTS`` event for :class:`UltimateListHeaderWindow`.
  
          :param `event`: a :class:`MouseEvent` event to be processed.
          """
  
          # we want to work with logical coords
          x, dummy = self._owner.CalcUnscrolledPosition(event.GetX(), 0)
          y = event.GetY()
  
          columnX, columnY = x, y        
  
          if self._isDragging:
  
              self.SendListEvent(wxEVT_COMMAND_LIST_COL_DRAGGING, event.GetPosition())
  
              # we don't draw the line beyond our window, but we allow dragging it
              # there
  
              w, dummy = self.GetClientSize()
              w, dummy = self._owner.CalcUnscrolledPosition(w, 0)            
              w -= 6
  
              # erase the line if it was drawn
              if self._currentX < w:
                  self.DrawCurrent()
  
              if event.ButtonUp():
  
                  self.ReleaseMouse()
                  self._isDragging = False
                  self._dirty = True
                  self._owner.SetColumnWidth(self._column, self._currentX - self._minX)
                  self.SendListEvent(wxEVT_COMMAND_LIST_COL_END_DRAG, event.GetPosition())
  
              else:
  
                  if x > self._minX + 7:
                      self._currentX = x
                  else:
                      self._currentX = self._minX + 7
  
                  # draw in the new location
                  if self._currentX < w:
                      self.DrawCurrent()
  
          else: # not dragging
  
              self._minX = 0
              hit_border = False
  
              # end of the current column
              xpos = 0
  
              # find the column where this event occurred
              countCol = self._owner.GetColumnCount()
              broken = False
              tipCol = -1
  
              for col in xrange(countCol):
  
                  if not self.IsColumnShown(col):
                      continue
                  
                  xpos += self._owner.GetColumnWidth(col)
                  self._column = col
  
                  if abs(x-xpos) < 3 and y < 22:
                      # near the column border
                      hit_border = True
                      broken = True
                      tipCol = col
                      break
  
                  if x < xpos:
                      # inside the column
                      broken = True
                      tipCol = col
                      break
  
                  self._minX = xpos
  
              if not broken:
                  self._column = -1
  
              if tipCol >= 0:
                  # First check to see if we have a tooltip to display    
                  colItem = self._owner.GetColumn(col)
                  if colItem.GetToolTip() != "":
                      self.SetToolTipString(colItem.GetToolTip())
                  else:
                      self.SetToolTipString("")
                  
              if event.LeftUp():
                  self._leftDown = False
                  self.Refresh()
                  
              if event.LeftDown() or event.RightUp():
  
                  if hit_border and event.LeftDown():
  
                      if not self._isFooter:
  
                          if self.SendListEvent(wxEVT_COMMAND_LIST_COL_BEGIN_DRAG,
                                                event.GetPosition()):
  
                              self._isDragging = True
                              self._currentX = x
                              self.CaptureMouse()
                              self.DrawCurrent()
  
                      #else: column resizing was vetoed by the user code
  
                  else: # click on a column
  
                       # record the selected state of the columns
                      if event.LeftDown():
                          
                          for i in xrange(self._owner.GetColumnCount()):
  
                              if not self.IsColumnShown(col):
                                  continue
                              
                              colItem = self._owner.GetColumn(i)
                              state = colItem.GetState()
  
                              if i == self._column:
                                  colItem.SetState(state | ULC_STATE_SELECTED)
                                  theX = x
                              else:
                                  colItem.SetState(state & ~ULC_STATE_SELECTED)
  
                              self._leftDown = True
                              self._owner.SetColumn(i, colItem)
                              x += self._owner.GetColumnWidth(i)
  
                          if self.HandleColumnCheck(self._column, event.GetPosition()):
                              return
  
                      if not self._isFooter:
                          self.SendListEvent((event.LeftDown() and [wxEVT_COMMAND_LIST_COL_CLICK] or \
                                              [wxEVT_COMMAND_LIST_COL_RIGHT_CLICK])[0], event.GetPosition())
                      else:
                          self.SendListEvent((event.LeftDown() and [wxEVT_COMMAND_LIST_FOOTER_CLICK] or \
                                              [wxEVT_COMMAND_LIST_FOOTER_RIGHT_CLICK])[0], event.GetPosition())
                          
                      self._leftDown = True
                      self._currentColumn = self._column
  
              elif event.Moving():
  
                  setCursor = False
  
                  if not self._isFooter:
                      if hit_border:
  
                          setCursor = self._currentCursor == wx.STANDARD_CURSOR
                          self._currentCursor = self._resizeCursor
  
                      else:
  
                          setCursor = self._currentCursor != wx.STANDARD_CURSOR
                          self._currentCursor = wx.STANDARD_CURSOR
  
                  if setCursor:
                      self.SetCursor(self._currentCursor)
                  else:
                      column = self.HitTestColumn(columnX, columnY)
                      self._enter = True
                      self._currentColumn = column
  
                      if _VERSION_STRING < "2.9":
                          leftDown = wx.GetMouseState().LeftDown()
                      else:
                          leftDown = wx.GetMouseState().LeftIsDown()
  
                      self._leftDown = leftDown
  
                      self.Refresh()                                            
  
              elif event.ButtonDClick():                
  
                  self.HandleColumnCheck(self._column, event.GetPosition())
function_tokens: def OnMouse ( self , event ) : # we want to work with logical coords x , dummy = self . _owner . CalcUnscrolledPosition ( event . GetX ( ) , 0 ) y = event . GetY ( ) columnX , columnY = x , y if self . _isDragging : self . SendListEvent ( wxEVT_COMMAND_LIST_COL_DRAGGING , event . GetPosition ( ) ) # we don't draw the line beyond our window, but we allow dragging it # there w , dummy = self . GetClientSize ( ) w , dummy = self . _owner . CalcUnscrolledPosition ( w , 0 ) w -= 6 # erase the line if it was drawn if self . _currentX < w : self . DrawCurrent ( ) if event . ButtonUp ( ) : self . ReleaseMouse ( ) self . _isDragging = False self . _dirty = True self . _owner . SetColumnWidth ( self . _column , self . _currentX - self . _minX ) self . SendListEvent ( wxEVT_COMMAND_LIST_COL_END_DRAG , event . GetPosition ( ) ) else : if x > self . _minX + 7 : self . _currentX = x else : self . _currentX = self . _minX + 7 # draw in the new location if self . _currentX < w : self . DrawCurrent ( ) else : # not dragging self . _minX = 0 hit_border = False # end of the current column xpos = 0 # find the column where this event occurred countCol = self . _owner . GetColumnCount ( ) broken = False tipCol = - 1 for col in xrange ( countCol ) : if not self . IsColumnShown ( col ) : continue xpos += self . _owner . GetColumnWidth ( col ) self . _column = col if abs ( x - xpos ) < 3 and y < 22 : # near the column border hit_border = True broken = True tipCol = col break if x < xpos : # inside the column broken = True tipCol = col break self . _minX = xpos if not broken : self . _column = - 1 if tipCol >= 0 : # First check to see if we have a tooltip to display     colItem = self . _owner . GetColumn ( col ) if colItem . GetToolTip ( ) != "" : self . SetToolTipString ( colItem . GetToolTip ( ) ) else : self . SetToolTipString ( "" ) if event . LeftUp ( ) : self . _leftDown = False self . Refresh ( ) if event . LeftDown ( ) or event . RightUp ( ) : if hit_border and event . LeftDown ( ) : if not self . _isFooter : if self . SendListEvent ( wxEVT_COMMAND_LIST_COL_BEGIN_DRAG , event . GetPosition ( ) ) : self . _isDragging = True self . _currentX = x self . CaptureMouse ( ) self . DrawCurrent ( ) #else: column resizing was vetoed by the user code else : # click on a column # record the selected state of the columns if event . LeftDown ( ) : for i in xrange ( self . _owner . GetColumnCount ( ) ) : if not self . IsColumnShown ( col ) : continue colItem = self . _owner . GetColumn ( i ) state = colItem . GetState ( ) if i == self . _column : colItem . SetState ( state | ULC_STATE_SELECTED ) theX = x else : colItem . SetState ( state & ~ ULC_STATE_SELECTED ) self . _leftDown = True self . _owner . SetColumn ( i , colItem ) x += self . _owner . GetColumnWidth ( i ) if self . HandleColumnCheck ( self . _column , event . GetPosition ( ) ) : return if not self . _isFooter : self . SendListEvent ( ( event . LeftDown ( ) and [ wxEVT_COMMAND_LIST_COL_CLICK ] or [ wxEVT_COMMAND_LIST_COL_RIGHT_CLICK ] ) [ 0 ] , event . GetPosition ( ) ) else : self . SendListEvent ( ( event . LeftDown ( ) and [ wxEVT_COMMAND_LIST_FOOTER_CLICK ] or [ wxEVT_COMMAND_LIST_FOOTER_RIGHT_CLICK ] ) [ 0 ] , event . GetPosition ( ) ) self . _leftDown = True self . _currentColumn = self . _column elif event . Moving ( ) : setCursor = False if not self . _isFooter : if hit_border : setCursor = self . _currentCursor == wx . STANDARD_CURSOR self . _currentCursor = self . _resizeCursor else : setCursor = self . _currentCursor != wx . STANDARD_CURSOR self . _currentCursor = wx . STANDARD_CURSOR if setCursor : self . SetCursor ( self . _currentCursor ) else : column = self . HitTestColumn ( columnX , columnY ) self . _enter = True self . _currentColumn = column if _VERSION_STRING < "2.9" : leftDown = wx . GetMouseState ( ) . LeftDown ( ) else : leftDown = wx . GetMouseState ( ) . LeftIsDown ( ) self . _leftDown = leftDown self . Refresh ( ) elif event . ButtonDClick ( ) : self . HandleColumnCheck ( self . _column , event . GetPosition ( ) )