<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def OnReplaceAll(self, event):
 """Called when a replace all operation is started"""


        find_string = event.GetFindString()
        flags = self._wxflag2flag(event.GetFlags())
        replace_string = event.GetReplaceString()

        findpositions = self.grid.actions.find_all(find_string, flags)

        with undo.group(_("Replace all")):
            self.grid.actions.replace_all(findpositions, find_string,
                                          replace_string)

        event.Skip()