import tkSimpleDialog ###$ event <> ###$ win ###$ unix ###$ event <> ###$ win ###$ win ###$ unix ###$ event <> ###$ win ###$ unix ###$ event <> ###$ win ###$ event <> ###$ win ###$ event <> ###$ win ###$ unix class SearchBinding: windows_keydefs = { '<>': ['', ''], '<>': [''], '<>': [''], '<>': [''], '<>': [''], '<>': [''], } unix_keydefs = { '<>': [''], '<>': [''], '<>': [''], '<>': ['', ''], } menudefs = [ ('edit', [ None, ('_Find...', '<>'), ('Find a_gain', '<>'), ('Find _selection', '<>'), ('Find in Files...', '<>'), ('R_eplace...', '<>'), ('Go to _line', '<>'), ]), ] def __init__(self, editwin): self.editwin = editwin def find_event(self, event): import SearchDialog SearchDialog.find(self.editwin.text) return "break" def find_again_event(self, event): import SearchDialog SearchDialog.find_again(self.editwin.text) return "break" def find_selection_event(self, event): import SearchDialog SearchDialog.find_selection(self.editwin.text) return "break" def find_in_files_event(self, event): import GrepDialog GrepDialog.grep(self.editwin.text, self.editwin.io, self.editwin.flist) return "break" def replace_event(self, event): import ReplaceDialog ReplaceDialog.replace(self.editwin.text) return "break" def goto_line_event(self, event): print event text = self.editwin.text lineno = tkSimpleDialog.askinteger("Goto", "Go to line number:", parent=text) if lineno is None: return "break" if lineno <= 0: text.bell() return "break" text.mark_set("insert", "%d.0" % lineno) text.see("insert")