Beispiel #1
0
    def undo(self, event):
        if self.dataset is None:
            raise Exception("Cannot undo, dataset is None")

        self.dataset.undo()
        evt = DEvent("UPDATE_DATASET", {})
        dispatcher.dispatch_event(evt)
Beispiel #2
0
    def open(self, event):
        filename = event.data['filename']
        with open(filename, mode='rb', buffering=0) as file:
            self.dataset = Dataset(initial_data=file.read())

        evt = DEvent("LOAD_DATASET", {"dataset": self.dataset})
        dispatcher.dispatch_event(evt)
Beispiel #3
0
    def on_saveas(self):
        file_opt = options = {}
        options['defaultextension'] = ''
        options['filetypes'] = [('all files', '.*')]
        options['initialdir'] = configManager.get_config("INITIAL_DIR", '\\')
        options['initialfile'] = configManager.get_config("INITIAL_FILE", 'myfile.hex')
        options['parent'] = self.root
        options['title'] = 'Save'
        filename = tkFileDialog.asksaveasfilename(**file_opt)

        # If no file selected
        if filename == "":
            return

        evt = DEvent("CONTROL_SAVEAS", {"filename":filename})
        dispatcher.dispatch_event(evt)
Beispiel #4
0
 def on_find(self):
     evt = DEvent("CONTROL_FIND", {})
     dispatcher.dispatch_event(evt)
Beispiel #5
0
 def on_delete(self):
     evt = DEvent("CONTROL_INSERT", {})
     dispatcher.dispatch_event(evt)
Beispiel #6
0
 def on_paste(self):
     evt = DEvent("CONTROL_PASTE", {})
     dispatcher.dispatch_event(evt)
Beispiel #7
0
 def on_copy(self):
     evt = DEvent("CONTROL_COPY", {})
     dispatcher.dispatch_event(evt)
Beispiel #8
0
 def on_cut(self):
     evt = DEvent("CONTROL_CUT", {})
     dispatcher.dispatch_event(evt)
Beispiel #9
0
 def on_redo(self):
     evt = DEvent("CONTROL_REDO", {})
     dispatcher.dispatch_event(evt)
Beispiel #10
0
 def on_exit(self):
     evt = DEvent("CONTROL_EXIT", {})
     dispatcher.dispatch_event(evt)
Beispiel #11
0
 def on_new(self):
     evt = DEvent("CONTROL_NEW", {})
     dispatcher.dispatch_event(evt)
Beispiel #12
0
 def on_about(self):
     evt = DEvent("CONTROL_ABOUT", {})
     dispatcher.dispatch_event(evt)
Beispiel #13
0
 def on_help(self):
     evt = DEvent("CONTROL_HELP", {})
     dispatcher.dispatch_event(evt)
Beispiel #14
0
 def on_excellence(self):
     evt = DEvent("CONTROL_EXCELLENCE", {})
     dispatcher.dispatch_event(evt)
Beispiel #15
0
 def on_preferences(self):
     evt = DEvent("CONTROL_PREFERENCES", {})
     dispatcher.dispatch_event(evt)
Beispiel #16
0
 def on_findnext(self):
     evt = DEvent("CONTROL_FINDNEXT", {})
     dispatcher.dispatch_event(evt)
Beispiel #17
0
 def on_selectall(self):
     evt = DEvent("CONTROL_SELECTALL", {})
     dispatcher.dispatch_event(evt)
Beispiel #18
0
 def on_undo(self):
     evt = DEvent("CONTROL_UNDO", {})
     dispatcher.dispatch_event(evt)