parameters: (self, event)
docstring: Handles the ``wx.EVT_LEFT_UP`` event for :class:`RibbonGallery`.
  
          :param `event`: a :class:`MouseEvent` event to be processed.
docstring_summary: Handles the ``wx.EVT_LEFT_UP`` event for :class:`RibbonGallery`.
docstring_tokens: Handles the wx . EVT_LEFT_UP event for : class : RibbonGallery .
function: def OnMouseUp(self, event):
          """
          Handles the ``wx.EVT_LEFT_UP`` event for :class:`RibbonGallery`.
  
          :param `event`: a :class:`MouseEvent` event to be processed.
          """
  
          if self._mouse_active_rect != None:
              pos = event.GetPosition()
              
              if self._active_item:            
                  if self._art and self._art.GetFlags() & RIBBON_BAR_FLOW_VERTICAL:
                      pos.x += self._scroll_amount
                  else:
                      pos.y += self._scroll_amount
              
              if self._mouse_active_rect.Contains(pos):
                  if self._mouse_active_rect == self._scroll_up_button_rect:
                      self._up_button_state = RIBBON_GALLERY_BUTTON_HOVERED
                      self.ScrollLines(-1)
                  
                  elif self._mouse_active_rect == self._scroll_down_button_rect:                
                      self._down_button_state = RIBBON_GALLERY_BUTTON_HOVERED
                      self.ScrollLines(1)
                  
                  elif self._mouse_active_rect == self._extension_button_rect:
                      self._extension_button_state = RIBBON_GALLERY_BUTTON_HOVERED
                      notification = wx.CommandEvent(wx.wxEVT_COMMAND_BUTTON_CLICKED, self.GetId())
                      notification.SetEventObject(self)
                      self.GetEventHandler().ProcessEvent(notification)
                  
                  elif self._active_item != None:                
                      if self._selected_item != self._active_item:                    
                          self._selected_item = self._active_item
                          notification = RibbonGalleryEvent(wxEVT_COMMAND_RIBBONGALLERY_SELECTED, self.GetId())
                          notification.SetEventObject(self)
                          notification.SetGallery(self)
                          notification.SetGalleryItem(self._selected_item)
                          self.GetEventHandler().ProcessEvent(notification)
  
                      notification = RibbonGalleryEvent(wxEVT_COMMAND_RIBBONGALLERY_CLICKED, self.GetId())
                      notification.SetEventObject(self)
                      notification.SetGallery(self)
                      notification.SetGalleryItem(self._selected_item)
                      self.GetEventHandler().ProcessEvent(notification)
                  
              self._mouse_active_rect = None
              self._active_item = None
              self.Refresh(False)
function_tokens: def OnMouseUp ( self , event ) : if self . _mouse_active_rect != None : pos = event . GetPosition ( ) if self . _active_item : if self . _art and self . _art . GetFlags ( ) & RIBBON_BAR_FLOW_VERTICAL : pos . x += self . _scroll_amount else : pos . y += self . _scroll_amount if self . _mouse_active_rect . Contains ( pos ) : if self . _mouse_active_rect == self . _scroll_up_button_rect : self . _up_button_state = RIBBON_GALLERY_BUTTON_HOVERED self . ScrollLines ( - 1 ) elif self . _mouse_active_rect == self . _scroll_down_button_rect : self . _down_button_state = RIBBON_GALLERY_BUTTON_HOVERED self . ScrollLines ( 1 ) elif self . _mouse_active_rect == self . _extension_button_rect : self . _extension_button_state = RIBBON_GALLERY_BUTTON_HOVERED notification = wx . CommandEvent ( wx . wxEVT_COMMAND_BUTTON_CLICKED , self . GetId ( ) ) notification . SetEventObject ( self ) self . GetEventHandler ( ) . ProcessEvent ( notification ) elif self . _active_item != None : if self . _selected_item != self . _active_item : self . _selected_item = self . _active_item notification = RibbonGalleryEvent ( wxEVT_COMMAND_RIBBONGALLERY_SELECTED , self . GetId ( ) ) notification . SetEventObject ( self ) notification . SetGallery ( self ) notification . SetGalleryItem ( self . _selected_item ) self . GetEventHandler ( ) . ProcessEvent ( notification ) notification = RibbonGalleryEvent ( wxEVT_COMMAND_RIBBONGALLERY_CLICKED , self . GetId ( ) ) notification . SetEventObject ( self ) notification . SetGallery ( self ) notification . SetGalleryItem ( self . _selected_item ) self . GetEventHandler ( ) . ProcessEvent ( notification ) self . _mouse_active_rect = None self . _active_item = None self . Refresh ( False )