示例#1
0
    def _bind_events(self):

        self.bind(CLOSE_EVENT, self._reset_name)
        EventHandler.add_event_listeners(self, CLOSE_EVENT)

        self.bind(OPEN_EVENT, self._set_name)
        EventHandler.add_event_listeners(self, OPEN_EVENT)
    def _bind_events(self):

        self.bind(OPEN_EVENT, self.open_xml)
        EventHandler.add_event_listeners(self, OPEN_EVENT)

        self.editor.bind('<KeyRelease>', self._edit_callback)

        return
示例#3
0
    def _bind_events(self):

        self.bind(OPEN_EVENT, self.display_widgets)
        EventHandler.add_event_listeners(self, OPEN_EVENT)
        self.bind(CLOSE_EVENT, self.hide_widgets)
        EventHandler.add_event_listeners(self, CLOSE_EVENT)
        self.bind('<<NotebookTabChanged>>', self._tab_changed)

        return
示例#4
0
    def _bind_events(self):
        """ Bind open and close file events and click events """

        self.bind(CLOSE_EVENT, self._clear_properties)
        EventHandler.add_event_listeners(self, CLOSE_EVENT)

        self.bind(OPEN_EVENT, self._load_properties)
        EventHandler.add_event_listeners(self, OPEN_EVENT)

        return
示例#5
0
    def _bind_events(self):
        """ Bind open and close file events and click events """

        self.bind(CLOSE_EVENT, self._clear_model)
        EventHandler.add_event_listeners(self, CLOSE_EVENT)

        self.bind(OPEN_EVENT, self._display_model)
        EventHandler.add_event_listeners(self, OPEN_EVENT)

        self.bind('<Double-1>', self._on_double_click)
        self.bind('<Button-1>', self._on_left_click)
        self.bind('<Button-3>', self._on_right_click)

        return
    def close_callback(self, event=None):

        if not Session.file_saved:
            if messagebox.askyesno('Save', "Save file before closing?"):
                self.save_callback()

        Session.lib_compiled = False
        Session.simulator = ODEINT_FIX
        Session.refine_strat = DEF_STRAT
        Session.file_saved = False
        Session.file_type = ''
        Session.file_path = ''

        if Session.file_opened:
            EventHandler.event_generate(CLOSE_EVENT)
        Session.file_opened = False
    def new_callback(self):
        """ Open template file """

        # Forget welcome screen widgets
        self.parent.open_label.pack_forget()
        self.parent.manual_label.pack_forget()
        self.parent.email_label.pack_forget()

        # If a file is already open, close it.
        if Session.file_opened:
            self.close_callback()

        Session.hybrid = HyIR.create_template()
        Session.file_path = None
        Session.file_opened = True
        Session.file_saved = False
        EventHandler.event_generate(OPEN_EVENT)

        return
    def open_callback(self):
        """ Select and open file """

        # Forget welcome screen widgets
        self.parent.open_label.pack_forget()
        self.parent.manual_label.pack_forget()
        self.parent.email_label.pack_forget()

        # If a file is already open, close it.
        if Session.file_opened:
            self.close_callback()

        file_path = filedialog.askopenfilename(**self.OPEN_OPT)
        if file_path:
            Session.file_path = file_path
            status = FileHandler.open_file(file_path)
            if status:
                Session.file_opened = True
                Session.file_saved = True
                EventHandler.event_generate(OPEN_EVENT)