parameters: (self, event)
docstring: Handles the ``wx.EVT_MOTION`` event for :class:`RibbonButtonBar`.
  
          :param `event`: a :class:`MouseEvent` event to be processed.
docstring_summary: Handles the ``wx.EVT_MOTION`` event for :class:`RibbonButtonBar`.
docstring_tokens: Handles the wx . EVT_MOTION event for : class : RibbonButtonBar .
function: def OnMouseMove(self, event):
          """
          Handles the ``wx.EVT_MOTION`` event for :class:`RibbonButtonBar`.
  
          :param `event`: a :class:`MouseEvent` event to be processed.
          """
  
          cursor = event.GetPosition()
          new_hovered = None
          new_hovered_state = 0
  
          layout = self._layouts[self._current_layout]
  
          for instance in layout.buttons:
              size = instance.base.sizes[instance.size]
              btn_rect = wx.Rect()
              btn_rect.SetTopLeft(self._layout_offset + instance.position)
              btn_rect.SetSize(size.size)
  
              if btn_rect.Contains(cursor) and self.IsButtonEnabled(instance.base.id):
                  new_hovered = instance
                  new_hovered_state = instance.base.state
                  new_hovered_state &= ~RIBBON_BUTTONBAR_BUTTON_HOVER_MASK
                  offset = wx.Point(*cursor)
                  offset -= btn_rect.GetTopLeft()
                  if size.normal_region.Contains(offset):
                      new_hovered_state |= RIBBON_BUTTONBAR_BUTTON_NORMAL_HOVERED
                  
                  if size.dropdown_region.Contains(offset):
                      new_hovered_state |= RIBBON_BUTTONBAR_BUTTON_DROPDOWN_HOVERED
                  
                  break
  
          if new_hovered == None and self.GetToolTip():
              self.SetToolTipString("")
  
          if new_hovered != self._hovered_button or (self._hovered_button != None and \
                                                     new_hovered_state != self._hovered_button.base.state):
          
              if self._hovered_button != None:            
                  self._hovered_button.base.state &= ~RIBBON_BUTTONBAR_BUTTON_HOVER_MASK
              
              self._hovered_button = new_hovered
              if self._hovered_button != None:
                  self._hovered_button.base.state = new_hovered_state
                  self.SetToolTipString(self._hovered_button.base.help_string) 
              
              self.Refresh(False)
          
          if self._active_button and not self._lock_active_state:
          
              new_active_state = self._active_button.base.state
              new_active_state &= ~RIBBON_BUTTONBAR_BUTTON_ACTIVE_MASK
              size = self._active_button.base.sizes[self._active_button.size]
              btn_rect = wx.Rect()
              btn_rect.SetTopLeft(self._layout_offset + self._active_button.position)
              btn_rect.SetSize(size.size)
              
              if btn_rect.Contains(cursor):
              
                  offset = wx.Point(*cursor)
                  offset -= btn_rect.GetTopLeft()
                  
                  if size.normal_region.Contains(offset):                
                      new_active_state |= RIBBON_BUTTONBAR_BUTTON_NORMAL_ACTIVE
                  
                  if size.dropdown_region.Contains(offset):                
                      new_active_state |= RIBBON_BUTTONBAR_BUTTON_DROPDOWN_ACTIVE
                  
              if new_active_state != self._active_button.base.state:            
                  self._active_button.base.state = new_active_state
                  self.Refresh(False)
function_tokens: def OnMouseMove ( self , event ) : cursor = event . GetPosition ( ) new_hovered = None new_hovered_state = 0 layout = self . _layouts [ self . _current_layout ] for instance in layout . buttons : size = instance . base . sizes [ instance . size ] btn_rect = wx . Rect ( ) btn_rect . SetTopLeft ( self . _layout_offset + instance . position ) btn_rect . SetSize ( size . size ) if btn_rect . Contains ( cursor ) and self . IsButtonEnabled ( instance . base . id ) : new_hovered = instance new_hovered_state = instance . base . state new_hovered_state &= ~ RIBBON_BUTTONBAR_BUTTON_HOVER_MASK offset = wx . Point ( * cursor ) offset -= btn_rect . GetTopLeft ( ) if size . normal_region . Contains ( offset ) : new_hovered_state |= RIBBON_BUTTONBAR_BUTTON_NORMAL_HOVERED if size . dropdown_region . Contains ( offset ) : new_hovered_state |= RIBBON_BUTTONBAR_BUTTON_DROPDOWN_HOVERED break if new_hovered == None and self . GetToolTip ( ) : self . SetToolTipString ( "" ) if new_hovered != self . _hovered_button or ( self . _hovered_button != None and new_hovered_state != self . _hovered_button . base . state ) : if self . _hovered_button != None : self . _hovered_button . base . state &= ~ RIBBON_BUTTONBAR_BUTTON_HOVER_MASK self . _hovered_button = new_hovered if self . _hovered_button != None : self . _hovered_button . base . state = new_hovered_state self . SetToolTipString ( self . _hovered_button . base . help_string ) self . Refresh ( False ) if self . _active_button and not self . _lock_active_state : new_active_state = self . _active_button . base . state new_active_state &= ~ RIBBON_BUTTONBAR_BUTTON_ACTIVE_MASK size = self . _active_button . base . sizes [ self . _active_button . size ] btn_rect = wx . Rect ( ) btn_rect . SetTopLeft ( self . _layout_offset + self . _active_button . position ) btn_rect . SetSize ( size . size ) if btn_rect . Contains ( cursor ) : offset = wx . Point ( * cursor ) offset -= btn_rect . GetTopLeft ( ) if size . normal_region . Contains ( offset ) : new_active_state |= RIBBON_BUTTONBAR_BUTTON_NORMAL_ACTIVE if size . dropdown_region . Contains ( offset ) : new_active_state |= RIBBON_BUTTONBAR_BUTTON_DROPDOWN_ACTIVE if new_active_state != self . _active_button . base . state : self . _active_button . base . state = new_active_state self . Refresh ( False )