Esempio n. 1
0
    def init_play_resolution_widgets(self):
        label = ttk.Label(self, text='分辨率:')
        box = ResolutionBox(self)
        label1 = ttk.Label(self, text='像素')

        label.grid(row=0, column=0, sticky=tk.E)
        box.grid(row=0, column=1, sticky=tk.EW)
        label1.grid(row=0, column=2, sticky=tk.W)

        box.set('1920x1080')
        self.play_resolution_box = box
Esempio n. 2
0
    def init_tune_duration_widgets(self):
        label = ttk.Label(self, text='微调时长:')
        spinbox = tk.Spinbox(self, justify=tk.RIGHT, from_=-10, to=100)
        label1 = ttk.Label(self, text='秒')

        label.grid(row=5, column=0, sticky=tk.E)
        spinbox.grid(row=5, column=1, sticky=tk.EW)
        label1.grid(row=5, column=2, sticky=tk.W)

        spinbox.delete(0, tk.END)
        spinbox.insert(0, 0)
        self.tune_duration_spinbox = spinbox
Esempio n. 3
0
    def init_line_count_widgets(self):
        label = ttk.Label(self, text='限制行数:')
        spinbox = tk.Spinbox(self, justify=tk.RIGHT, from_=0, to=100)
        label1 = ttk.Label(self, text='行')

        label.grid(row=3, column=0, sticky=tk.E)
        spinbox.grid(row=3, column=1, sticky=tk.EW)
        label1.grid(row=3, column=2, sticky=tk.W)

        spinbox.delete(0, tk.END)
        spinbox.insert(0, 4)
        self.line_count_spinbox = spinbox
Esempio n. 4
0
    def init_font_size_widgets(self):
        label = ttk.Label(self, text='字体大小:')
        spinbox = tk.Spinbox(self, justify=tk.RIGHT, from_=1, to=100)
        label1 = ttk.Label(self, text='像素')

        label.grid(row=2, column=0, sticky=tk.E)
        spinbox.grid(row=2, column=1, sticky=tk.EW)
        label1.grid(row=2, column=2, sticky=tk.W)

        spinbox.delete(0, tk.END)
        spinbox.insert(0, 32)
        self.font_size_spinbox = spinbox
Esempio n. 5
0
    def init_custom_offset_widgets(self):
        strvar = tk.StringVar()
        label = ttk.Label(self, text='自定偏移:')
        entry = ttk.Entry(self, textvariable=strvar, justify=tk.RIGHT)
        label1 = ttk.Label(self, text='秒')

        label.grid(row=8, column=0, sticky=tk.E)
        entry.grid(row=8, column=1, sticky=tk.EW)
        label1.grid(row=8, column=2, sticky=tk.W)

        strvar.set('00:00')
        self.custom_offset_strvar = strvar
Esempio n. 6
0
    def init_bottom_margin_widgets(self):
        label = ttk.Label(self, text='底部边距:')
        spinbox = tk.Spinbox(self, justify=tk.RIGHT, from_=0, to=100)
        label1 = ttk.Label(self, text='像素')

        label.grid(row=7, column=0, sticky=tk.E)
        spinbox.grid(row=7, column=1, sticky=tk.EW)
        label1.grid(row=7, column=2, sticky=tk.W)

        spinbox.delete(0, tk.END)
        spinbox.insert(0, 0)
        self.bottom_margin_spinbox = spinbox
Esempio n. 7
0
    def init_drop_offset_widgets(self):
        label = ttk.Label(self, text='丢弃偏移:')
        spinbox = tk.Spinbox(self, justify=tk.RIGHT, from_=0, to=100)
        label1 = ttk.Label(self, text='秒')

        label.grid(row=6, column=0, sticky=tk.E)
        spinbox.grid(row=6, column=1, sticky=tk.EW)
        label1.grid(row=6, column=2, sticky=tk.W)

        spinbox.delete(0, tk.END)
        spinbox.insert(0, 2)
        self.drop_offset_spinbox = spinbox
Esempio n. 8
0
    def init_layout_algorithm_widgets(self):
        label = ttk.Label(self, text='布局算法:')
        box = AlgorithmBox(self)

        label.grid(row=4, column=0, sticky=tk.E)
        box.grid(row=4, column=1, sticky=tk.EW, columnspan=2)

        box.set('sync')
        self.layout_algorithm_box = box
Esempio n. 9
0
    def init_custom_filter_widgets(self):
        strvar = tk.StringVar()
        label = ttk.Label(self, text='过滤文件:')
        entry = ttk.Entry(self, textvariable=strvar)
        button = ttk.Button(self, text='浏览', width=6)

        label.grid(row=1, column=0, sticky=tk.E)
        entry.grid(row=1, column=1, sticky=tk.EW)
        button.grid(row=1, column=2, sticky=tk.W)

        button['command'] = self.on_custom_filter_button_clicked
        self.custom_filter_strvar = strvar
Esempio n. 10
0
    def init_header_file_widgets(self):
        strvar = tk.StringVar()
        label = ttk.Label(self, text='样式模板:')
        entry = ttk.Entry(self, textvariable=strvar)
        button = ttk.Button(self, text='浏览', width=6)

        label.grid(row=9, column=0, sticky=tk.E)
        entry.grid(row=9, column=1, sticky=tk.EW)
        button.grid(row=9, column=2, sticky=tk.W)

        button['command'] = self.on_header_file_button_clicked
        self.header_file_strvar = strvar
Esempio n. 11
0
    def init_output_filename_widgets(self):
        strvar = tk.StringVar()
        label = ttk.Label(self, text='输出文件:')
        entry = ttk.Entry(self, textvariable=strvar)
        button = ttk.Button(self, text='浏览', width=6)

        label.grid(row=1, column=0, sticky=tk.E)
        entry.grid(row=1, column=1, sticky=tk.EW)
        button.grid(row=1, column=2, sticky=tk.W)

        strvar.set('')
        button['command'] = self.on_output_filename_button_clicked
        self.output_filename_strvar = strvar
Esempio n. 12
0
    def init_font_name_widgets(self):
        fonts = list(tk.font.families(self))
        fonts = list(set(fonts))
        fonts.sort()

        strvar = tk.StringVar()
        label = ttk.Label(self, text='字体名称:')
        combobox = ttk.Combobox(self, textvariable=strvar, values=fonts)

        label.grid(row=1, column=0, sticky=tk.E)
        combobox.grid(row=1, column=1, sticky=tk.EW, columnspan=2)

        if sys.platform == 'linux':
            strvar.set('WenQuanYi Micro Hei')
        else:
            strvar.set('微软雅黑')

        self.font_name_strvar = strvar
Esempio n. 13
0
    def init_widgets(self):
        width_spinbox = tk.Spinbox(self,
                                   justify=tk.RIGHT,
                                   width=8,
                                   from_=1,
                                   to=9999)
        label = ttk.Label(self, text='x')
        height_spinbox = tk.Spinbox(self,
                                    justify=tk.RIGHT,
                                    width=8,
                                    from_=1,
                                    to=9999)

        width_spinbox.pack(side=tk.LEFT, fill=tk.BOTH, expand=True)
        label.pack(side=tk.LEFT)
        height_spinbox.pack(side=tk.LEFT, fill=tk.BOTH, expand=True)

        self.width_spinbox = width_spinbox
        self.height_spinbox = height_spinbox