def vp_start_gui(): '''Starting point when module is the main routine.''' global val, w, root root = tk.Tk() top = Detail(root) BaseView.init(root, top) root.mainloop()
def vp_start_gui(): '''Starting point when module is the main routine.''' global val, w, root root = tk.Tk() BaseView.set_Tk_var() top = Toplevel1 (root) BaseView.init(root, top) root.mainloop()
def create_Detail(rt, *args, **kwargs): '''Starting point when module is imported by another module. Correct form of call: 'create_Detail(root, *args, **kwargs)' .''' global w, w_win, root #rt = root root = rt w = tk.Toplevel(root) top = Detail(w) BaseView.init(w, top, *args, **kwargs) return (w, top)
def addgroup_action(self, request): game = datagate.get_item(request.getvalue('itemid')) teams = game.search1(name='groups') chats = game.search1(name='chats') board = game.search1(name='board') name = request.getvalue('name', '') if name: group = datagate.create_item(creatorid=request.session.user.id, parentid=teams.id) group.name = name group.save() teamchat = datagate.create_item(creatorid=request.session.user.id, parentid=chats.id) teamchat.name = name teamchat.save() BaseView.get_view('strikecomcommenter').initialize_activity(request, teamchat)
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#ececec' # Closest X11 color: 'gray92' self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.', background=_bgcolor) self.style.configure('.', foreground=_fgcolor) self.style.configure('.', font="TkDefaultFont") self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)]) top.geometry("323x237+341+174") top.minsize(120, 1) top.maxsize(1370, 749) top.resizable(1, 1) top.title(" ") top.configure(background="#d9d9d9") self.Label1 = tk.Label(top) self.Label1.place(relx=0.341, rely=0.211, height=15, width=103) self.Label1.configure(background="#d9d9d9") self.Label1.configure(cursor="fleur") self.Label1.configure(disabledforeground="#a3a3a3") self.Label1.configure(foreground="#000000") self.Label1.configure(text='''Pilih Pelanggan''') self.pelanggan = ttk.Combobox(top) self.pelanggan.place(relx=0.217, rely=0.338, relheight=0.105, relwidth=0.554) #self.pelanggan.configure(textvariable=BaseView.combobox) self.pelanggan['values'] = clientName self.pelanggan.configure(takefocus="") self.pick = tk.Button(top) self.pick.place(relx=0.372, rely=0.549, height=24, width=68) self.pick.configure(activebackground="#ececec") self.pick.configure(activeforeground="#000000") self.pick.configure(background="#d9d9d9") self.pick.configure(disabledforeground="#a3a3a3") self.pick.configure(foreground="#000000") self.pick.configure(highlightbackground="#d9d9d9") self.pick.configure(highlightcolor="black") self.pick.configure(pady="0") self.pick.configure(text='''Konfirmasi''') index = self.pelanggan.current() self.pick.configure( command=lambda: BaseView.viewCart(client[index], transaction))
def send_admin_page(self, request): '''Called from the administrator to allows customization of the activity''' activity = datagate.get_item(request.getvalue('itemid', '')) # the change form request.writeln('<center>') request.writeln(request.cgi_form(gm_action="GridView.rowscols", Rows=None, Columns=None, itemid=request.getvalue('itemid', ''))) request.writeln('<b>Grid Size</b>:') request.writeln('<table border=0>'); for axis, val in [ ('Rows', activity.getvalue('rows', 1)), ('Columns', activity.getvalue('cols', 1)) ]: request.writeln('<tr>') request.writeln('<td>' + axis + ':</td>') request.writeln('<td><select name="' + axis + '" onchange="javascript:form.submit()">') for i in range(1, 11): request.write('<option') if i == val: request.write(' selected') request.writeln('>' + str(i) + '</option>') request.writeln('</select></td>') request.writeln('</tr>') request.writeln('</table>') request.writeln('</form>') # display the grid for the subviews request.writeln('<p> </p>') request.writeln('<b>Grid View Types</b>') request.writeln('<table border=1 cellspacing=0 cellpadding=2>') for row in range(1, activity.getvalue('rows', 1) + 1): request.writeln('<tr>') for col in range(1, activity.getvalue('cols', 1) + 1): child = self.getview(request, activity, row, col) request.writeln('<td>') request.writeln(request.cgi_form(gm_action="GridView.changeview", childview=None, row=row, col=col, itemid=request.getvalue('itemid', ''))) request.writeln('<select name="childview" onchange="javascript:form.submit()">') for view in MeetingHome.meeting_components: comp = BaseView.get_view(view) request.write('<option') if view == child.view: request.writeln(' selected') request.writeln(' value="' + view + '">' + comp.NAME + '</option>') request.writeln('</select>') request.writeln('<br>') request.write('<center><font size="1">[ <a href="' + request.cgi_href(itemid=child.id, gm_action=None, view='Administrator', global_adminview=child.view) + '">Edit</a> ]</font></center>') request.writeln('</form>') request.writeln('</td>') request.writeln('</tr>') request.writeln('</table>') # footer request.writeln('<p><i>(Changes are saved automatically)</i><p>') request.writeln('</center>')
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#ececec' # Closest X11 color: 'gray92' font11 = "-family {Segoe UI} -size 10" top.geometry("458x197+346+172") top.minsize(120, 1) top.maxsize(1370, 749) top.resizable(1, 1) top.title(" ") top.configure(background="#d9d9d9") self.Label1 = tk.Label(top) self.Label1.place(relx=0.066, rely=0.102, height=70, width=411) self.Label1.configure(background="#d9d9d9") self.Label1.configure(cursor="fleur") self.Label1.configure(disabledforeground="#a3a3a3") self.Label1.configure(font=font11) self.Label1.configure(foreground="#000000") self.Label1.configure(text='''Pembayaran telah diterima, mohon menunggu struk pembayaran''') self.Button1 = tk.Button(top) self.Button1.place(relx=0.437, rely=0.508, height=34, width=57) self.Button1.configure(activebackground="#ececec") self.Button1.configure(activeforeground="#000000") self.Button1.configure(background="#d9d9d9") self.Button1.configure(disabledforeground="#a3a3a3") self.Button1.configure(foreground="#000000") self.Button1.configure(highlightbackground="#d9d9d9") self.Button1.configure(highlightcolor="black") self.Button1.configure(pady="0") self.Button1.configure(text='''Oke''') self.Button1.configure(command=lambda: BaseView.moreTransaction(client))
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#ececec' # Closest X11 color: 'gray92' top.geometry("600x450+282+154") top.minsize(120, 1) top.maxsize(1370, 749) top.resizable(1, 1) top.title("Cart") top.configure(background="#d9d9d9") self.Label1 = tk.Label(top) self.Label1.place(relx=0.033, rely=0.044, height=21, width=64) self.Label1.configure(background="#d9d9d9") self.Label1.configure(cursor="fleur") self.Label1.configure(disabledforeground="#a3a3a3") self.Label1.configure(foreground="#000000") self.Label1.configure(text='''TANGGAL''') self.tanggal = tk.Label(top) self.tanggal.place(relx=0.167, rely=0.044, height=21, width=120) self.tanggal.configure(background="#d9d9d9") self.tanggal.configure(disabledforeground="#a3a3a3") self.tanggal.configure(foreground="#000000") self.tanggal.configure(text=transaction.date) self.Label3 = tk.Label(top) self.Label3.place(relx=0.5, rely=0.044, height=21, width=104) self.Label3.configure(background="#d9d9d9") self.Label3.configure(cursor="fleur") self.Label3.configure(disabledforeground="#a3a3a3") self.Label3.configure(foreground="#000000") self.Label3.configure(text='''PELANGGAN''') self.pelanggan = tk.Label(top) self.pelanggan.place(relx=0.7, rely=0.044, height=21, width=164) self.pelanggan.configure(background="#d9d9d9") self.pelanggan.configure(cursor="fleur") self.pelanggan.configure(disabledforeground="#a3a3a3") self.pelanggan.configure(foreground="#000000") self.pelanggan.configure(text=transaction.account.username.upper()) self.Frame1 = tk.Frame(top) self.Frame1.place(relx=0.067, rely=0.178, relheight=0.5, relwidth=0.708) self.Frame1.configure(relief='groove') self.Frame1.configure(borderwidth="2") self.Frame1.configure(relief="groove") self.Frame1.configure(background="#d9d9d9") cols = ['No', 'Produk', 'Qty', 'Harga', 'Subtotal'] self.tree = ttk.Treeview(self.Frame1) self.tree.pack() minwidth = self.tree.column('#0', option='minwidth') self.tree.column('#0', width=minwidth) self.tree["columns"] = cols for i in cols: self.tree.heading(i, text=i.capitalize(), anchor='w') self.tree.column('No', width=25) self.tree.column('Produk', width=120) self.tree.column('Qty', width=30) self.tree.column('Harga', width=80) self.tree.column('Subtotal', width=100) for i in cart: index = len(cart) - cart.index(i) values = [ index, i.product.name, i.qty, i.product.price, i.qty * i.product.price ] self.tree.insert("", 0, text=index, values=values) total = 0 for line in self.tree.get_children(): total += self.tree.item(line)['values'][4] self.Label5 = tk.Label(top) self.Label5.place(relx=0.35, rely=0.711, height=21, width=83) self.Label5.configure(background="#d9d9d9") self.Label5.configure(disabledforeground="#a3a3a3") self.Label5.configure(foreground="#000000") self.Label5.configure(text='''TOTAL''') self.total = tk.Label(top) self.total.place(relx=0.517, rely=0.711, height=21, width=154) self.total.configure(background="#d9d9d9") self.total.configure(disabledforeground="#a3a3a3") self.total.configure(foreground="#000000") self.total.configure(text="Rp " + str(total)) self.add = tk.Button(top) self.add.place(relx=0.833, rely=0.2, height=24, width=55) self.add.configure(activebackground="#ececec") self.add.configure(activeforeground="#000000") self.add.configure(background="#d9d9d9") self.add.configure(disabledforeground="#a3a3a3") self.add.configure(foreground="#000000") self.add.configure(highlightbackground="#d9d9d9") self.add.configure(highlightcolor="black") self.add.configure(pady="0") self.add.configure(text='''Tambah''') self.add.configure( command=lambda: BaseView.redirect(PickProduct, transaction)) self.delete = tk.Button(top) self.delete.place(relx=0.833, rely=0.311, height=24, width=55) self.delete.configure(activebackground="#ececec") self.delete.configure(activeforeground="#000000") self.delete.configure(background="#d9d9d9") self.delete.configure(disabledforeground="#a3a3a3") self.delete.configure(foreground="#000000") self.delete.configure(highlightbackground="#d9d9d9") self.delete.configure(highlightcolor="black") self.delete.configure(pady="0") self.delete.configure(text='''Hapus''') self.confirm = tk.Button(top) self.confirm.place(relx=0.033, rely=0.844, height=24, width=557) self.confirm.configure(activebackground="#ececec") self.confirm.configure(activeforeground="#000000") self.confirm.configure(background="#d9d9d9") self.confirm.configure(disabledforeground="#a3a3a3") self.confirm.configure(foreground="#000000") self.confirm.configure(highlightbackground="#d9d9d9") self.confirm.configure(highlightcolor="black") self.confirm.configure(pady="0") self.confirm.configure(text='''Bayar''') self.confirm.configure( command=lambda: BaseView.confirmation(transaction)) self.cancel = tk.Button(top) self.cancel.place(relx=0.033, rely=0.911, height=24, width=557) self.cancel.configure(activebackground="#ececec") self.cancel.configure(activeforeground="#000000") self.cancel.configure(background="#d9d9d9") self.cancel.configure(disabledforeground="#a3a3a3") self.cancel.configure(foreground="#000000") self.cancel.configure(highlightbackground="#d9d9d9") self.cancel.configure(highlightcolor="black") self.cancel.configure(pady="0") self.cancel.configure(text='''Batal''') self.cancel.configure(command=lambda: BaseView.redirect(Login)) self.menubar = tk.Menu(top, font="TkMenuFont", bg=_bgcolor, fg=_fgcolor) top.configure(menu=self.menubar)
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#ececec' # Closest X11 color: 'gray92' self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.',background=_bgcolor) self.style.configure('.',foreground=_fgcolor) self.style.configure('.',font="TkDefaultFont") self.style.map('.',background= [('selected', _compcolor), ('active',_ana2color)]) top.geometry("434x346+390+147") top.minsize(120, 1) top.maxsize(1370, 749) top.resizable(1, 1) top.title("REGISTER") top.configure(background="#d9d9d9") self.Label1 = tk.Label(top) self.Label1.place(relx=0.415, rely=0.087, height=21, width=74) self.Label1.configure(background="#d9d9d9") self.Label1.configure(disabledforeground="#a3a3a3") self.Label1.configure(foreground="#000000") self.Label1.configure(text='''Jenis Akun''') self.Label1_1 = tk.Label(top) self.Label1_1.place(relx=0.415, rely=0.237, height=11, width=64) self.Label1_1.configure(activebackground="#f9f9f9") self.Label1_1.configure(activeforeground="black") self.Label1_1.configure(background="#d9d9d9") self.Label1_1.configure(disabledforeground="#a3a3a3") self.Label1_1.configure(foreground="#000000") self.Label1_1.configure(highlightbackground="#d9d9d9") self.Label1_1.configure(highlightcolor="black") self.Label1_1.configure(text='''Username''') self.Label1_2 = tk.Label(top) self.Label1_2.place(relx=0.438, rely=0.384, height=21, width=44) self.Label1_2.configure(activebackground="#f9f9f9") self.Label1_2.configure(activeforeground="black") self.Label1_2.configure(background="#d9d9d9") self.Label1_2.configure(cursor="fleur") self.Label1_2.configure(disabledforeground="#a3a3a3") self.Label1_2.configure(foreground="#000000") self.Label1_2.configure(highlightbackground="#d9d9d9") self.Label1_2.configure(highlightcolor="black") self.Label1_2.configure(text='''Email''') self.Label1_3 = tk.Label(top) self.Label1_3.place(relx=0.415, rely=0.561, height=11, width=64) self.Label1_3.configure(activebackground="#f9f9f9") self.Label1_3.configure(activeforeground="black") self.Label1_3.configure(background="#d9d9d9") self.Label1_3.configure(disabledforeground="#a3a3a3") self.Label1_3.configure(foreground="#000000") self.Label1_3.configure(highlightbackground="#d9d9d9") self.Label1_3.configure(highlightcolor="black") self.Label1_3.configure(text='''Password''') self.Label1_4 = tk.Label(top) self.Label1_4.place(relx=0.369, rely=0.708, height=21, width=114) self.Label1_4.configure(activebackground="#f9f9f9") self.Label1_4.configure(activeforeground="black") self.Label1_4.configure(background="#d9d9d9") self.Label1_4.configure(disabledforeground="#a3a3a3") self.Label1_4.configure(foreground="#000000") self.Label1_4.configure(highlightbackground="#d9d9d9") self.Label1_4.configure(highlightcolor="black") self.Label1_4.configure(text='''Confirm Password''') self.type = ttk.Combobox(top) self.type.place(relx=0.323, rely=0.147, relheight=0.061, relwidth=0.329) self.type.configure(justify='center') self.type["values"] = ["Pelanggan", "Karyawan"] self.type.configure(textvariable=BaseView.type) self.type.configure(takefocus="") self.username = tk.Entry(top) self.username.place(relx=0.323, rely=0.295,height=20, relwidth=0.332) self.username.configure(background="white") self.username.configure(disabledforeground="#a3a3a3") self.username.configure(font="TkFixedFont") self.username.configure(foreground="#000000") self.username.configure(insertbackground="black") #self.username.configure(textvariable=BaseView.username) self.username.configure(text='''Username''') self.email = tk.Entry(top) self.email.place(relx=0.332, rely=0.457,height=20, relwidth=0.332) self.email.configure(background="white") self.email.configure(disabledforeground="#a3a3a3") self.email.configure(font="TkFixedFont") self.email.configure(foreground="#000000") self.email.configure(highlightbackground="#d9d9d9") self.email.configure(highlightcolor="black") self.email.configure(insertbackground="black") self.email.configure(selectbackground="#c4c4c4") self.email.configure(selectforeground="black") self.password = tk.Entry(top) self.password.place(relx=0.323, rely=0.618,height=20, relwidth=0.332) self.password.configure(background="white") self.password.configure(disabledforeground="#a3a3a3") self.password.configure(font="TkFixedFont") self.password.configure(foreground="#000000") self.password.configure(highlightbackground="#d9d9d9") self.password.configure(highlightcolor="black") self.password.configure(insertbackground="black") self.password.configure(selectbackground="#c4c4c4") self.password.configure(selectforeground="black") self.password.config(show="*"); self.c_password = tk.Entry(top) self.c_password.place(relx=0.323, rely=0.78,height=20, relwidth=0.332) self.c_password.configure(background="white") self.c_password.configure(disabledforeground="#a3a3a3") self.c_password.configure(font="TkFixedFont") self.c_password.configure(foreground="#000000") self.c_password.configure(highlightbackground="#d9d9d9") self.c_password.configure(highlightcolor="black") self.c_password.configure(insertbackground="black") self.c_password.configure(selectbackground="#c4c4c4") self.c_password.configure(selectforeground="black") self.c_password.config(show="*"); self.register = tk.Button(top) self.register.place(relx=0.438, rely=0.867, height=24, width=53) self.register.configure(activebackground="#ececec") self.register.configure(activeforeground="#000000") self.register.configure(background="#d9d9d9") self.register.configure(cursor="fleur") self.register.configure(command=lambda :BaseView.register( self.type.get(), self.username.get(), self.email.get(), self.password.get(), self.c_password.get())) self.register.configure(disabledforeground="#a3a3a3") self.register.configure(foreground="#000000") self.register.configure(highlightbackground="#d9d9d9") self.register.configure(highlightcolor="black") self.register.configure(pady="0") self.register.configure(text='''Register''') self.login = tk.Button(top) self.login.place(relx=0.853, rely=0.029, height=24, width=41) self.login.configure(activebackground="#ececec") self.login.configure(activeforeground="#000000") self.login.configure(background="#d9d9d9") self.login.configure(command=lambda :BaseView.redirect(Login)) self.login.configure(disabledforeground="#a3a3a3") self.login.configure(foreground="#000000") self.login.configure(highlightbackground="#d9d9d9") self.login.configure(highlightcolor="black") self.login.configure(pady="0") self.login.configure(text='''Login''')
def send_admin_page(self, request): '''Called from the administrator to allows customization of the activity''' BaseView.get_view('rating').send_admin_page(request)
def initialize_activity(self, request, root): '''Initializes this item''' BaseView.get_view('rating').initialize_activity(request, root)
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#ececec' # Closest X11 color: 'gray92' top.geometry("363x276+342+202") top.minsize(120, 1) top.maxsize(1370, 749) top.resizable(1, 1) top.title("LOGIN") top.configure(background="#d9d9d9") top.configure(highlightbackground="#d9d9d9") top.configure(highlightcolor="black") self.Label1 = tk.Label(top) self.Label1.place(relx=0.405, rely=0.174, height=17, width=59) self.Label1.configure(activebackground="#f9f9f9") self.Label1.configure(activeforeground="black") self.Label1.configure(background="#d9d9d9") self.Label1.configure(disabledforeground="#a3a3a3") self.Label1.configure(foreground="#000000") self.Label1.configure(highlightbackground="#d9d9d9") self.Label1.configure(highlightcolor="black") self.Label1.configure(text='''Username''') self.Label2 = tk.Label(top) self.Label2.place(relx=0.413, rely=0.435, height=17, width=56) self.Label2.configure(activebackground="#f9f9f9") self.Label2.configure(activeforeground="black") self.Label2.configure(background="#d9d9d9") self.Label2.configure(disabledforeground="#a3a3a3") self.Label2.configure(foreground="#000000") self.Label2.configure(highlightbackground="#d9d9d9") self.Label2.configure(highlightcolor="black") self.Label2.configure(text='''Password''') self.username = tk.Entry(top) self.username.place(relx=0.358, rely=0.254, height=20, relwidth=0.287) self.username.configure(background="white") self.username.configure(disabledforeground="#a3a3a3") self.username.configure(font="TkFixedFont") self.username.configure(foreground="#000000") self.username.configure(highlightbackground="#d9d9d9") self.username.configure(highlightcolor="black") self.username.configure(insertbackground="black") self.username.configure(selectbackground="#c4c4c4") self.username.configure(selectforeground="black") self.password = tk.Entry(top) self.password.place(relx=0.386, rely=0.543, height=20, relwidth=0.231) self.password.configure(background="white") self.password.configure(disabledforeground="#a3a3a3") self.password.configure(font="TkFixedFont") self.password.configure(foreground="#000000") self.password.configure(highlightbackground="#d9d9d9") self.password.configure(highlightcolor="black") self.password.configure(insertbackground="black") self.password.configure(selectbackground="#c4c4c4") self.password.configure(selectforeground="black") self.password.config(show="*") self.login = tk.Button(top) self.login.place(relx=0.441, rely=0.725, height=24, width=41) self.login.configure(activebackground="#ececec") self.login.configure(activeforeground="#000000") self.login.configure(background="#d9d9d9") self.login.configure(command=lambda: BaseView.login( self.username.get(), self.password.get())) self.login.configure(disabledforeground="#a3a3a3") self.login.configure(foreground="#000000") self.login.configure(highlightbackground="#d9d9d9") self.login.configure(highlightcolor="black") self.login.configure(pady="0") self.login.configure(text='''Login''') self.register = tk.Button(top) self.register.place(relx=0.826, rely=0.87, height=24, width=53) self.register.configure(activebackground="#ececec") self.register.configure(activeforeground="#000000") self.register.configure(background="#d9d9d9") self.register.configure(disabledforeground="#a3a3a3") self.register.configure(command=lambda: BaseView.redirect(Register)) self.register.configure(foreground="#000000") self.register.configure(highlightbackground="#d9d9d9") self.register.configure(highlightcolor="black") self.register.configure(pady="0") self.register.configure(text='''Register''') self.menubar = tk.Menu(top, font="TkMenuFont", bg=_bgcolor, fg=_fgcolor) top.configure(menu=self.menubar)
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#ececec' # Closest X11 color: 'gray92' self.style = ttk.Style() if sys.platform == "win32": self.style.theme_use('winnative') self.style.configure('.',background=_bgcolor) self.style.configure('.',foreground=_fgcolor) self.style.configure('.',font="TkDefaultFont") self.style.map('.',background= [('selected', _compcolor), ('active',_ana2color)]) top.geometry("360x479+337+145") top.minsize(120, 1) top.maxsize(1370, 749) top.resizable(1, 1) top.title("List of Product") top.configure(background="#d9d9d9") self.Label1 = tk.Label(top) self.Label1.place(relx=0.25, rely=0.125, height=21, width=83) self.Label1.configure(background="#d9d9d9") self.Label1.configure(disabledforeground="#a3a3a3") self.Label1.configure(foreground="#000000") self.Label1.configure(text='''PILIH PRODUK''') self.Label2 = tk.Label(top) self.Label2.place(relx=0.25, rely=0.292, height=21, width=94) self.Label2.configure(background="#d9d9d9") self.Label2.configure(disabledforeground="#a3a3a3") self.Label2.configure(foreground="#000000") self.Label2.configure(text='''HARGA SATUAN''') self.satuan = tk.Label(top) self.satuan.place(relx=0.25, rely=0.355, height=31, width=184) self.satuan.configure(background="#d9d9d9") self.satuan.configure(disabledforeground="#a3a3a3") self.satuan.configure(foreground="#000000") self.satuan.configure(justify='right') self.satuan.configure(text='''0''') self.Label4 = tk.Label(top) self.Label4.place(relx=0.25, rely=0.459, height=21, width=54) self.Label4.configure(background="#d9d9d9") self.Label4.configure(cursor="fleur") self.Label4.configure(disabledforeground="#a3a3a3") self.Label4.configure(foreground="#000000") self.Label4.configure(text='''JUMLAH''') sv = tk.StringVar() sv.trace("w", lambda name, index, mode, sv=sv: self.callback()) self.jumlah = tk.Entry(top, textvariable=sv) self.jumlah.place(relx=0.278, rely=0.522,height=20, relwidth=0.456) self.jumlah.configure(background="white") self.jumlah.configure(disabledforeground="#a3a3a3") self.jumlah.configure(font="TkFixedFont") self.jumlah.configure(foreground="#000000") self.jumlah.configure(insertbackground="black") self.Label5 = tk.Label(top) self.Label5.place(relx=0.25, rely=0.605, height=21, width=64) self.Label5.configure(background="#d9d9d9") self.Label5.configure(cursor="fleur") self.Label5.configure(disabledforeground="#a3a3a3") self.Label5.configure(foreground="#000000") self.Label5.configure(text='''SUBTOTAL''') self.subtotal = tk.Label(top) self.subtotal.place(relx=0.278, rely=0.668, height=21, width=164) self.subtotal.configure(background="#d9d9d9") self.subtotal.configure(disabledforeground="#a3a3a3") self.subtotal.configure(foreground="#000000") self.subtotal.configure(text='''0''') self.produk = ttk.Combobox(top) self.produk.place(relx=0.25, rely=0.188, relheight=0.044, relwidth=0.508) self.produk['value'] = productName #self.produk.configure(textvariable=BaseView.combobox) self.produk.configure(takefocus="") self.produk.bind('<<ComboboxSelected>>', lambda e: self.handler(self.produk.current(), self.satuan)) self.tambah = tk.Button(top) self.tambah.place(relx=0.25, rely=0.772, height=24, width=187) self.tambah.configure(activebackground="#ececec") self.tambah.configure(activeforeground="#000000") self.tambah.configure(background="#d9d9d9") self.tambah.configure(disabledforeground="#a3a3a3") self.tambah.configure(foreground="#000000") self.tambah.configure(highlightbackground="#d9d9d9") self.tambah.configure(highlightcolor="black") self.tambah.configure(pady="0") self.tambah.configure(text='''Tambah''') self.tambah.configure(command=lambda : BaseView.addProduct( transaction, productList[self.produk.current()], int(self.jumlah.get()))) self.batal = tk.Button(top) self.batal.place(relx=0.25, rely=0.877, height=24, width=187) self.batal.configure(activebackground="#ececec") self.batal.configure(activeforeground="#000000") self.batal.configure(background="#d9d9d9") self.batal.configure(cursor="fleur") self.batal.configure(disabledforeground="#a3a3a3") self.batal.configure(foreground="#000000") self.batal.configure(highlightbackground="#d9d9d9") self.batal.configure(highlightcolor="black") self.batal.configure(pady="0") self.batal.configure(text='''Batal''') self.batal.configure(command=lambda: BaseView.cancel(transaction))
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#ececec' # Closest X11 color: 'gray92' top.geometry("720x491+-1+105") top.minsize(120, 1) top.maxsize(1370, 749) top.resizable(1, 1) top.title("List Transaksi") top.configure(background="#d9d9d9") self.newTransaction = tk.Button(top) self.newTransaction.place(relx=0.025, rely=0.027, height=24, width=87) self.newTransaction.configure(activebackground="#ececec") self.newTransaction.configure(activeforeground="#000000") self.newTransaction.configure(background="#d9d9d9") self.newTransaction.configure( command=lambda: BaseView.newTransaction()) self.newTransaction.configure(disabledforeground="#a3a3a3") self.newTransaction.configure(foreground="#000000") self.newTransaction.configure(highlightbackground="#d9d9d9") self.newTransaction.configure(highlightcolor="black") self.newTransaction.configure(pady="0") self.newTransaction.configure(text='''Transaksi Baru''') self.logout = tk.Button(top) self.logout.place(relx=0.85, rely=0.027, height=24, width=44) self.logout.configure(activebackground="#ececec") self.logout.configure(activeforeground="#000000") self.logout.configure(background="#d9d9d9") self.logout.configure(disabledforeground="#a3a3a3") self.logout.configure(foreground="#000000") self.logout.configure(highlightbackground="#d9d9d9") self.logout.configure(highlightcolor="black") self.logout.configure(pady="0") self.logout.configure(text='''Keluar''') self.logout.configure(command=lambda: BaseView.redirect(Login)) self.menubar = tk.Menu(top, font="TkMenuFont", bg=_bgcolor, fg=_fgcolor) top.configure(menu=self.menubar) self.Frame1 = tk.Frame(top) self.Frame1.place(relx=0.012, rely=0.214, relheight=0.684, relwidth=0.94) self.Frame1.configure(relief='groove') self.Frame1.configure(borderwidth="2") self.Frame1.configure(relief="groove") self.Frame1.configure(background="#d9d9d9") df = pd.read_csv('Transaction.csv') cols = ['No', 'Tanggal', 'Pelanggan', 'Total'] self.tree = ttk.Treeview(self.Frame1) self.tree.pack() minwidth = self.tree.column('#0', option='minwidth') self.tree.column('#0', width=minwidth) self.tree["columns"] = cols for i in cols: self.tree.heading(i, text=i.capitalize(), anchor='w') self.tree.column('No', width=25) self.tree.column('Tanggal', width=120) self.tree.column('Pelanggan', width=60) self.tree.column('Total', width=100) for i in transaction: index = len(transaction) - transaction.index(i) values = [index, i.date, i.account.username.upper(), total] self.tree.insert("", 0, text=index, values=values)