コード例 #1
0
    def __init__(self, parent, controller, title, file_dir, result, isTyping,
                 time, size):
        tk.Frame.__init__(self, parent)
        self.controller = controller

        heading = tk.Label(self,
                           bg="white",
                           fg="black",
                           text=title,
                           font='none 24 bold')
        heading.place(relx=0.5, rely=0.1, anchor=tk.CENTER)

        output_frame = hg.create_frame(self, 2)
        hg.create_label(output_frame, 'Result:', 0, 0)

        if (not isTyping):
            hg.create_label(output_frame, file_dir, 0, 1)
        else:
            hg.create_label(output_frame, result, 1, 0)

        info_frame = hg.create_frame(self, 3)
        hg.create_label(info_frame, 'Time elapsed: ' + str(time), 0, 0)
        hg.create_label(info_frame, 'Size: ' + str(size), 1, 0)

        back_frame = hg.create_frame(self, 4)
        hg.create_button(back_frame, 'Back',
                         lambda: self.controller.show_frame("StartPage"), 0, 1)
コード例 #2
0
    def render_selected_key_frame(self):
        selected_key_frame = hg.create_frame(self, self.KEY_OPTION_ROW + 1)

        hg.create_label(selected_key_frame, 'Selected Key:', 0, 0)
        self.selected_key_entry = hg.create_entry(selected_key_frame, "", 1, 0)
        hg.create_button(selected_key_frame, 'Choose',
                         lambda: self.load_selected_key(), 2, 0)
コード例 #3
0
    def render_execute_frame(self):
        execute_frame = hg.create_frame(self, self.EXECUTE_ROW + 1)

        hg.create_button(execute_frame, 'Execute', lambda: self.execute(), 0,
                         0)

        hg.create_button(execute_frame, 'Back',
                         lambda: self.controller.show_frame("StartPage"), 0, 1)
コード例 #4
0
    def render_message_file_frame(self):
        self.destroy_frame(self.message_frame)
        self.destroy_frame(self.output_frame)

        self.render_message_frame()
        self.render_output_frame()

        hg.create_label(self.message_frame,
                        self.message_dir,
                        0,
                        1,
                        fix_text=False)
        hg.create_button(self.message_frame, 'Choose',
                         lambda: self.load_message(), 1, 0)
コード例 #5
0
    def render_key_frame(self):
        public_key_frame = hg.create_frame(self, self.PUBLIC_KEY_ROW + 1)
        hg.create_label(public_key_frame, 'Public Key', 0, 0)
        hg.create_label(public_key_frame,
                        self.public_key_dir,
                        0,
                        1,
                        fix_text=False)
        hg.create_button(public_key_frame, 'Choose',
                         lambda: self.load_public_key(), 1, 0)

        private_key_frame = hg.create_frame(self, self.PRIVATE_KEY_ROW + 1)
        hg.create_label(private_key_frame, 'Private Key', 0, 0)
        hg.create_label(private_key_frame,
                        self.private_key_dir,
                        0,
                        1,
                        fix_text=False)
        hg.create_button(private_key_frame, 'Choose',
                         lambda: self.load_private_key(), 1, 0)

        button_key_frame = hg.create_frame(self, self.BUTTON_KEY_ROW + 1)
        hg.create_button(button_key_frame, 'Generate Key',
                         lambda: self.generate_key(), 1, 0)
        hg.create_button(button_key_frame, 'Back',
                         lambda: self.controller.show_frame("StartPage"), 1, 1)