|
|
|
@ -12,11 +12,13 @@ class ProjectLiferFrame(Frame): |
|
|
|
|
|
|
|
|
|
|
|
ttk.Frame.__init__(self, root, padding=(5, 5, 5, 5)) |
|
|
|
ttk.Frame.__init__(self, root, padding=(5, 5, 5, 5)) |
|
|
|
|
|
|
|
|
|
|
|
# define buttons |
|
|
|
# define buttonframe |
|
|
|
self.butcombine = Button(self, text='Kombiniere Bilder', command=self.combine_pictures) |
|
|
|
self.buttonframe = Frame(self) |
|
|
|
self.butdirchooser = Button(self, text='Verzeichnis wählen', command=self.askdirectory) |
|
|
|
self.butdirchooser = Button(self.buttonframe, text='Verzeichnis wählen', command=self.askdirectory) |
|
|
|
self.butselall = Button(self, text='Alle wählen', command=self.select_all) |
|
|
|
self.dirtext = Label(self.buttonframe, wraplength=150, width=10,anchor=W, justify=LEFT) |
|
|
|
self.butselnone = Button(self, text='Keine wählen', command=self.select_none) |
|
|
|
self.butselall = Button(self.buttonframe, text='Alle wählen', command=self.select_all) |
|
|
|
|
|
|
|
self.butselnone = Button(self.buttonframe, text='Keine wählen', command=self.select_none) |
|
|
|
|
|
|
|
self.butcombine = Button(self.buttonframe, text='Kombiniere Bilder', command=self.combine_pictures) |
|
|
|
|
|
|
|
|
|
|
|
# define listbox and scrollbar |
|
|
|
# define listbox and scrollbar |
|
|
|
self.listbox = Listbox(self, selectmode=MULTIPLE) |
|
|
|
self.listbox = Listbox(self, selectmode=MULTIPLE) |
|
|
|
@ -35,21 +37,23 @@ class ProjectLiferFrame(Frame): |
|
|
|
# define ProgressBar |
|
|
|
# define ProgressBar |
|
|
|
self.pbar = Progressbar(self.pframe) |
|
|
|
self.pbar = Progressbar(self.pframe) |
|
|
|
|
|
|
|
|
|
|
|
# layout buttons |
|
|
|
# layout buttonframe |
|
|
|
self.butcombine.grid(row=0, columnspan=2, sticky=W + E + N + S, padx=5, pady=5) |
|
|
|
self.buttonframe.grid(row=0, column=0, sticky=N, padx=5, pady=5) |
|
|
|
self.butdirchooser.grid(row=1, columnspan=2, padx=5, pady=5) |
|
|
|
self.butdirchooser.grid(row=0, column=0,columnspan=2, sticky=N + W + E, pady=5) |
|
|
|
self.butselall.grid(row=2, column=0) |
|
|
|
self.dirtext.grid(row=1, column=0, columnspan=2, sticky=W +E, pady=5) |
|
|
|
self.butselnone.grid(row=2, column=1) |
|
|
|
self.butselall.grid(row=2, column=0, sticky=N, pady=5) |
|
|
|
|
|
|
|
self.butselnone.grid(row=2, column=1, sticky=N, pady=5) |
|
|
|
|
|
|
|
self.butcombine.grid(row=3, columnspan=2, sticky=N + W + E, pady=5) |
|
|
|
|
|
|
|
|
|
|
|
# layout listbox and scrollbar |
|
|
|
# layout listbox and scrollbar |
|
|
|
self.listbox.columnconfigure(0, weight=1) |
|
|
|
self.listbox.columnconfigure(0, weight=1) |
|
|
|
self.listbox.rowconfigure(0, weight=1) |
|
|
|
self.listbox.rowconfigure(0, weight=1) |
|
|
|
self.listbox.grid(row=0, column=2, rowspan=3, columnspan=2, sticky=W + E + N + S, pady=5, padx=5) |
|
|
|
self.listbox.grid(row=0, column=1, sticky=W + E + N + S, pady=5, padx=5) |
|
|
|
self.scrollbar.grid(column=1, sticky=N + S) |
|
|
|
self.scrollbar.grid(column=1, sticky=N + S) |
|
|
|
|
|
|
|
|
|
|
|
# layout progressbar and text |
|
|
|
# layout progressbar and text |
|
|
|
self.pframe.columnconfigure(1,weight=1) |
|
|
|
self.pframe.columnconfigure(1,weight=1) |
|
|
|
self.pframe.grid(row=3, column=0, columnspan=5, sticky=W+E+N+S, pady=5, padx=5) |
|
|
|
self.pframe.grid(row=1, column=0, columnspan=2, sticky=W+E+N+S, pady=5, padx=5) |
|
|
|
self.ptext.grid(row=0, column=0, sticky=W) |
|
|
|
self.ptext.grid(row=0, column=0, sticky=W) |
|
|
|
self.pbar.grid(row=0, column=1, sticky=W + E + N + S) |
|
|
|
self.pbar.grid(row=0, column=1, sticky=W + E + N + S) |
|
|
|
|
|
|
|
|
|
|
|
@ -59,12 +63,10 @@ class ProjectLiferFrame(Frame): |
|
|
|
options['mustexist'] = False |
|
|
|
options['mustexist'] = False |
|
|
|
options['parent'] = root |
|
|
|
options['parent'] = root |
|
|
|
options['title'] = 'Ordner auswählen' |
|
|
|
options['title'] = 'Ordner auswählen' |
|
|
|
self.columnconfigure(0, weight=1) |
|
|
|
self.columnconfigure(0, weight=0) |
|
|
|
self.columnconfigure(1, weight=1) |
|
|
|
self.columnconfigure(1, weight=1) |
|
|
|
self.columnconfigure(2, weight=10) |
|
|
|
self.rowconfigure(0, weight=1) |
|
|
|
self.rowconfigure(0, weight=5) |
|
|
|
self.rowconfigure(1, weight=0) |
|
|
|
self.rowconfigure(1, weight=1) |
|
|
|
|
|
|
|
self.rowconfigure(2, weight=1) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def combine_pictures(self): |
|
|
|
def combine_pictures(self): |
|
|
|
|
|
|
|
|
|
|
|
@ -126,6 +128,7 @@ class ProjectLiferFrame(Frame): |
|
|
|
self.listbox.delete(0, END) |
|
|
|
self.listbox.delete(0, END) |
|
|
|
self.files.clear() |
|
|
|
self.files.clear() |
|
|
|
self.folder = filedialog.askdirectory(**self.dir_opt) |
|
|
|
self.folder = filedialog.askdirectory(**self.dir_opt) |
|
|
|
|
|
|
|
self.dirtext['text'] = self.folder |
|
|
|
for file in os.listdir(self.folder): |
|
|
|
for file in os.listdir(self.folder): |
|
|
|
pathfile = os.path.join(self.folder, file) |
|
|
|
pathfile = os.path.join(self.folder, file) |
|
|
|
if os.path.isfile(pathfile): |
|
|
|
if os.path.isfile(pathfile): |
|
|
|
|