parameters: (self, evt)
docstring: Count the number of matches
docstring_summary: Count the number of matches
docstring_tokens: Count the number of matches
function: def OnCount(self, evt):
          """Count the number of matches"""
          stc = self._stc()
  
          # Create the search engine
          query = evt.GetFindString()
          mode = evt.GetSearchType()
          engine = ebmlib.SearchEngine(query, evt.IsRegEx(),
                                       True, evt.IsMatchCase(), evt.IsWholeWord())
  
          if mode == eclib.LOCATION_CURRENT_DOC:
              engine.SetSearchPool(stc.GetText())
          elif mode == eclib.LOCATION_IN_SELECTION:
              engine.SetSearchPool(stc.GetSelectedText())
          else:
              # TODO: report that this is not supported yet
              #       this case should not happen as the count button is currently
              #       disabled for any conditions that fall into this case.
              return
  
          matches = engine.FindAll()
          if matches:
              count = len(matches)
          else:
              count = 0
  
          rmap = dict(term=query, count=count)
          wx.MessageBox(_("The search term \'%(term)s\' was found %(count)d times.") % rmap,
                        _("Find Count"),
                        wx.ICON_INFORMATION|wx.OK)
function_tokens: def OnCount ( self , evt ) : stc = self . _stc ( ) # Create the search engine query = evt . GetFindString ( ) mode = evt . GetSearchType ( ) engine = ebmlib . SearchEngine ( query , evt . IsRegEx ( ) , True , evt . IsMatchCase ( ) , evt . IsWholeWord ( ) ) if mode == eclib . LOCATION_CURRENT_DOC : engine . SetSearchPool ( stc . GetText ( ) ) elif mode == eclib . LOCATION_IN_SELECTION : engine . SetSearchPool ( stc . GetSelectedText ( ) ) else : # TODO: report that this is not supported yet #       this case should not happen as the count button is currently #       disabled for any conditions that fall into this case. return matches = engine . FindAll ( ) if matches : count = len ( matches ) else : count = 0 rmap = dict ( term = query , count = count ) wx . MessageBox ( _ ( "The search term \'%(term)s\' was found %(count)d times." ) % rmap , _ ( "Find Count" ) , wx . ICON_INFORMATION | wx . OK )