def __init__(self, controller): self.ctrl = controller self.root = tk.Tk() self.root.resizable(width=False, height=False) self.root.geometry(GEOMETRY) self.root.title('Money Manager') self.totalFunds = tk.DoubleVar() self.totalFunds.set(0.0) self.mainAcctFunds = tk.DoubleVar() self.mainAcctFunds.set(0.0) self.limitLeft = tk.DoubleVar() self.limitLeft.set(0.0) self.currUnit = tk.StringVar() self.currUnit.set('$') f = tkFont.Font(family='times', size=-18) s = ttk.Style() s.configure('.', font=f) self.tabBase = ttk.Notebook(self.root) self.mainPage = ttk.Frame(self.tabBase) self.topFrame = tk.Frame(self.mainPage) self.topFrame.config(bg='#b0c4de', bd=5, relief=tk.GROOVE) self.topFrame.pack(expand=1, fill=tk.BOTH, side=tk.TOP) self.topLeftFrame = tk.Frame(self.topFrame) self.topLeftFrame.config(bg='#b0c4de') self.topLeftFrame.pack(expand=1, side=tk.LEFT, padx=15) self.topRightFrame = tk.Frame(self.topFrame) self.topRightFrame.config(bg='#b0c4de') self.topRightFrame.pack(expand=1, side=tk.RIGHT) self.vSep = ttk.Separator(self.root, orient="horizontal") self.vSep.pack(side="top", fill="x", padx=0) self.bottomFrame = tk.Frame(self.mainPage) self.bottomFrame.config(bg='#b0c4de', bd=5, relief=tk.GROOVE) self.bottomFrame.pack(expand=1, fill=tk.BOTH, side=tk.BOTTOM) self.bottomLeftFrame = tk.Frame(self.bottomFrame) self.bottomLeftFrame.pack(expand=1, side=tk.LEFT, padx=15) self.bottomLeftFrame.config(bg='#b0c4de') self.bottomRightFrame = tk.Frame(self.bottomFrame) self.bottomRightFrame.config(bg='#b0c4de') self.bottomRightFrame.pack(expand=1, side=tk.RIGHT) self.textFont = ('symbol', 14, 'bold') self.labelFont = ('symbol', 18, 'bold') #self.menu() self.BigButtons() self.Buttons() self.ListBoxes() self.labels() self.chartBox() self.boxFont = ('times', 12) self.buttFont = ('times', 13, 'bold') # transactions frame self.transPage = ttk.Frame(self.tabBase) self.transTop = tk.Frame(self.transPage) self.transTop.pack(side=tk.TOP) self.transBottom = tk.Frame(self.transPage) self.transBottom.pack(side=tk.BOTTOM) self.transBox = tk.Listbox(self.transTop) self.transBox.config(font=self.boxFont, width=150, height=30) self.transBox.pack() self.transRemoveButton = tk.Button(self.transBottom, text="Remove Selection", command=self.removeTrans) self.transRemoveButton.config(relief=tk.RAISED, bd=6, height=4, width=15, font=self.buttFont) self.transRemoveButton.pack(side=tk.LEFT) self.transExitButton = tk.Button(self.transBottom, text="Exit Program", command=self.finish) self.transExitButton.config(relief=tk.RAISED, bd=6, height=4, width=15, font=self.buttFont) self.transExitButton.pack(side=tk.RIGHT, padx=50) # bills frame self.billsPage = ttk.Frame(self.tabBase) self.billsTop = tk.Frame(self.billsPage) self.billsTop.pack(side=tk.TOP) self.billsBottom = tk.Frame(self.billsPage) self.billsBottom.pack(side=tk.BOTTOM) self.billsBox = tk.Listbox(self.billsTop) self.billsBox.config(font=self.boxFont, width=150, height=30) self.billsBox.pack() self.billsRemoveButton = tk.Button(self.billsBottom, text="Remove Selection", command=self.removeBill) self.billsRemoveButton.config(relief=tk.RAISED, bd=6, height=4, width=15, font=self.buttFont) self.billsRemoveButton.pack(side=tk.LEFT) self.billsExitButton = tk.Button(self.billsBottom, text="Exit Program", command=self.finish) self.billsExitButton.config(relief=tk.RAISED, bd=6, height=4, width=15, font=self.buttFont) self.billsExitButton.pack(side=tk.RIGHT, padx=50) # income frame self.incomePage = ttk.Frame(self.tabBase) self.incomeTop = tk.Frame(self.incomePage) self.incomeTop.pack(side=tk.TOP) self.incomeBottom = tk.Frame(self.incomePage) self.incomeBottom.pack(side=tk.BOTTOM) self.incomeBox = tk.Listbox(self.incomeTop) self.incomeBox.config(font=self.boxFont, width=150, height=30) self.incomeBox.pack() self.incomeRemoveButton = tk.Button(self.incomeBottom, text="Remove Selection", command=self.removeIncome) self.incomeRemoveButton.config(relief=tk.RAISED, bd=6, height=4, width=15, font=self.buttFont) self.incomeRemoveButton.pack(side=tk.LEFT) self.incomeExitButton = tk.Button(self.incomeBottom, text="Exit Program", command=self.finish) self.incomeExitButton.config(relief=tk.RAISED, bd=6, height=4, width=15, font=self.buttFont) self.incomeExitButton.pack(side=tk.RIGHT, padx=50) # account frame self.acctPage = ttk.Frame(self.tabBase) self.acctTop = tk.Frame(self.acctPage) self.acctTop.pack(side=tk.TOP) self.acctBottom = tk.Frame(self.acctPage) self.acctBottom.pack(side=tk.BOTTOM) self.acctBox = tk.Listbox(self.acctTop) self.acctBox.config(font=self.boxFont, width=150, height=30) self.acctBox.pack() self.acctRemoveButton = tk.Button(self.acctBottom, text="Remove Selection", command=self.removeAcct) self.acctRemoveButton.config(relief=tk.RAISED, bd=6, height=4, width=15, font=self.buttFont) self.acctRemoveButton.pack(side=tk.LEFT) self.acctExitButton = tk.Button(self.acctBottom, text="Exit Program", command=self.finish) self.acctExitButton.config(relief=tk.RAISED, bd=6, height=4, width=15, font=self.buttFont) self.acctExitButton.pack(side=tk.RIGHT, padx=50) self.tabBase.add(self.mainPage, text='Main') self.tabBase.add(self.transPage, text='Transactions') self.tabBase.add(self.billsPage, text='Bills') self.tabBase.add(self.incomePage, text='Income') self.tabBase.add(self.acctPage, text='Account') self.tabBase.pack(expand=1, fill="both")
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' font10 = "-family {Rockwell Extra Bold} -size 12 -weight bold " \ "-slant roman -underline 0 -overstrike 0" font11 = "-family {Rockwell Extra Bold} -size 40 -weight bold " \ "-slant roman -underline 0 -overstrike 0" font12 = "-family Rockwell -size 15 -weight normal -slant " \ "roman -underline 0 -overstrike 0" font13 = "-family Rockwell -size 9 -weight normal -slant roman" \ " -underline 0 -overstrike 0" font14 = "-family Rockwell -size 12 -weight normal -slant " \ "roman -underline 0 -overstrike 0" font15 = "-family Rockwell -size 13 -weight bold -slant roman " \ "-underline 0 -overstrike 0" font20 = "-family {Britannic Bold} -size 48 -weight bold " \ "-slant roman -underline 0 -overstrike 0" font16 = "-family {Palatino Linotype} -size 11 -weight normal " \ "-slant roman -underline 0 -overstrike 0" font9 = "-family {Segoe Script} -size 12 -weight normal -slant" \ " italic -underline 0 -overstrike 0" font41 = "-family {Arial Black} -size 16 -weight bold" 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("1538x878+41+60") top.title("New Toplevel") top.configure(background="#ffff24") top.configure(highlightbackground="#d9d9d9") top.configure(highlightcolor="black") self.Label1 = tk.Label(top) self.Label1.place(relx=0.013, rely=0.023, height=81, width=156) self.Label1.configure(activebackground="#f9f9f9") self.Label1.configure(activeforeground="black") self.Label1.configure(background="#ffff24") self.Label1.configure(disabledforeground="#a3a3a3") self.Label1.configure(font=font20) self.Label1.configure(foreground="#ff250d") self.Label1.configure(highlightbackground="#d9d9d9") self.Label1.configure(highlightcolor="black") self.Label1.configure(text='''eTAX''') self.Label1_1 = tk.Label(top) self.Label1_1.place(relx=0.117, rely=0.023, height=81, width=156) self.Label1_1.configure(activebackground="#f9f9f9") self.Label1_1.configure(activeforeground="black") self.Label1_1.configure(background="#ffff24") self.Label1_1.configure(disabledforeground="#a3a3a3") self.Label1_1.configure(font=font20) self.Label1_1.configure(foreground="#2212ff") self.Label1_1.configure(highlightbackground="#d9d9d9") self.Label1_1.configure(highlightcolor="black") self.Label1_1.configure(text='''2019''') self.Label2 = tk.Label(top) self.Label2.place(relx=0.072, rely=0.103, height=31, width=141) self.Label2.configure(activebackground="#f9f9f9") self.Label2.configure(activeforeground="black") self.Label2.configure(background="#ffff24") self.Label2.configure(disabledforeground="#a3a3a3") self.Label2.configure(font=font9) self.Label2.configure(foreground="#13c12a") self.Label2.configure(highlightbackground="#d9d9d9") self.Label2.configure(highlightcolor="black") self.Label2.configure(text='''working for you''') self.backbutton = tk.Button(top) self.backbutton.place(relx=0.013, rely=0.159, height=44, width=97) self.backbutton.configure(activebackground="#ececec") self.backbutton.configure(activeforeground="#000000") self.backbutton.configure(background="#120bd8") self.backbutton.configure(disabledforeground="#a3a3a3") self.backbutton.configure(font=font10) self.backbutton.configure(foreground="#fcffff") self.backbutton.configure(highlightbackground="#d9d9d9") self.backbutton.configure(highlightcolor="black") self.backbutton.configure(pady="0") self.backbutton.configure(text='''Back''') self.exit = tk.Button(top) self.exit.place(relx=0.104, rely=0.159, height=44, width=97) self.exit.configure(activebackground="#ececec") self.exit.configure(activeforeground="#000000") self.exit.configure(background="#120bd8") self.exit.configure(disabledforeground="#a3a3a3") self.exit.configure(font=font10) self.exit.configure(foreground="#fcffff") self.exit.configure(highlightbackground="#d9d9d9") self.exit.configure(highlightcolor="black") self.exit.configure(pady="0") self.exit.configure(command=self.exits, text='''Exit''') self.Label3 = tk.Label(top) self.Label3.place(relx=0.013, rely=0.9, height=21, width=56) self.Label3.configure(activebackground="#f9f9f9") self.Label3.configure(activeforeground="black") self.Label3.configure(background="#ffff24") self.Label3.configure(disabledforeground="#a3a3a3") self.Label3.configure(foreground="#000000") self.Label3.configure(highlightbackground="#d9d9d9") self.Label3.configure(highlightcolor="black") self.Label3.configure(text='''etax-2019''') self.Label3_3 = tk.Label(top) self.Label3_3.place(relx=0.013, rely=0.923, height=21, width=34) self.Label3_3.configure(activebackground="#f9f9f9") self.Label3_3.configure(activeforeground="black") self.Label3_3.configure(background="#ffff24") self.Label3_3.configure(disabledforeground="#a3a3a3") self.Label3_3.configure(foreground="#000000") self.Label3_3.configure(highlightbackground="#d9d9d9") self.Label3_3.configure(highlightcolor="black") self.Label3_3.configure(text='''v 1.0.2''') self.Label3_4 = tk.Label(top) self.Label3_4.place(relx=0.007, rely=0.968, height=21, width=134) self.Label3_4.configure(activebackground="#f9f9f9") self.Label3_4.configure(activeforeground="black") self.Label3_4.configure(background="#ffff24") self.Label3_4.configure(disabledforeground="#a3a3a3") self.Label3_4.configure(foreground="#000000") self.Label3_4.configure(highlightbackground="#d9d9d9") self.Label3_4.configure(highlightcolor="black") self.Label3_4.configure(text='''Working On Windows''') self.Label3_1 = tk.Label(top) self.Label3_1.place(relx=0.013, rely=0.945, height=21, width=164) self.Label3_1.configure(activebackground="#f9f9f9") self.Label3_1.configure(activeforeground="black") self.Label3_1.configure(background="#ffff24") self.Label3_1.configure(disabledforeground="#a3a3a3") self.Label3_1.configure(foreground="#000000") self.Label3_1.configure(highlightbackground="#d9d9d9") self.Label3_1.configure(highlightcolor="black") self.Label3_1.configure(text='''Connected to MySQL server 8.0''') self.Label4 = tk.Label(top) self.Label4.place(relx=0.416, rely=0.034, height=68, width=321) self.Label4.configure(activebackground="#f9f9f9") self.Label4.configure(activeforeground="black") self.Label4.configure(background="#ffff24") self.Label4.configure(disabledforeground="#36911a") self.Label4.configure(font=font11) self.Label4.configure(foreground="#36911a") self.Label4.configure(highlightbackground="#d9d9d9") self.Label4.configure(highlightcolor="black") self.Label4.configure(text='''Database''') self.Label5 = tk.Label(top) self.Label5.place(relx=0.793, rely=0.034, height=28, width=192) self.Label5.configure(activebackground="#f9f9f9") self.Label5.configure(activeforeground="black") self.Label5.configure(background="#ffff24") self.Label5.configure(disabledforeground="#a3a3a3") self.Label5.configure(font=font12) self.Label5.configure(foreground="#000000") self.Label5.configure(highlightbackground="#d9d9d9") self.Label5.configure(highlightcolor="black") self.Label5.configure(text='''Village : Kalamwadi''') self.Label5_2 = tk.Label(top) self.Label5_2.place(relx=0.813, rely=0.068, height=28, width=172) self.Label5_2.configure(activebackground="#f9f9f9") self.Label5_2.configure(activeforeground="black") self.Label5_2.configure(background="#ffff24") self.Label5_2.configure(disabledforeground="#a3a3a3") self.Label5_2.configure(font=font12) self.Label5_2.configure(foreground="#000000") self.Label5_2.configure(highlightbackground="#d9d9d9") self.Label5_2.configure(highlightcolor="black") self.Label5_2.configure(text='''District : Sangli''') self.Label5_3 = tk.Label(top) self.Label5_3.place(relx=0.897, rely=0.923, height=28, width=172) self.Label5_3.configure(activebackground="#f9f9f9") self.Label5_3.configure(activeforeground="black") self.Label5_3.configure(background="#ffff24") self.Label5_3.configure(disabledforeground="#a3a3a3") self.Label5_3.configure(font=font13) self.Label5_3.configure(foreground="#000000") self.Label5_3.configure(highlightbackground="#d9d9d9") self.Label5_3.configure(highlightcolor="black") self.Label5_3.configure(text='''Server Status : Online''') self.Label5_4 = tk.Label(top) self.Label5_4.place(relx=0.904, rely=0.945, height=28, width=172) self.Label5_4.configure(activebackground="#f9f9f9") self.Label5_4.configure(activeforeground="black") self.Label5_4.configure(background="#ffff24") self.Label5_4.configure(disabledforeground="#a3a3a3") self.Label5_4.configure(font=font13) self.Label5_4.configure(foreground="#000000") self.Label5_4.configure(highlightbackground="#d9d9d9") self.Label5_4.configure(highlightcolor="black") self.Label5_4.configure(text='''Host : localhost''') self.Label5_5 = tk.Label(top) self.Label5_5.place(relx=0.904, rely=0.968, height=28, width=172) self.Label5_5.configure(activebackground="#f9f9f9") self.Label5_5.configure(activeforeground="black") self.Label5_5.configure(background="#ffff24") self.Label5_5.configure(disabledforeground="#a3a3a3") self.Label5_5.configure(font=font13) self.Label5_5.configure(foreground="#000000") self.Label5_5.configure(highlightbackground="#d9d9d9") self.Label5_5.configure(highlightcolor="black") self.Label5_5.configure(text='''Port : 3306''') self.Label5_1 = tk.Label(top) self.Label5_1.place(relx=0.91, rely=0.091, height=28, width=172) self.Label5_1.configure(activebackground="#f9f9f9") self.Label5_1.configure(activeforeground="black") self.Label5_1.configure(background="#ffff24") self.Label5_1.configure(disabledforeground="#a3a3a3") self.Label5_1.configure(font=font14) self.Label5_1.configure(foreground="#000000") self.Label5_1.configure(highlightbackground="#d9d9d9") self.Label5_1.configure(highlightcolor="black") self.Label5_1.configure(text='''User : user''') self.box1o1 = ScrolledListBox(top) self.box1o1.place(relx=0.013, rely=0.285, relheight=0.598, relwidth=0.274) self.box1o1.configure(background="white") self.box1o1.configure(disabledforeground="#a3a3a3") self.box1o1.configure(font="TkFixedFont") self.box1o1.configure(foreground="black") self.box1o1.configure(highlightbackground="#d9d9d9") self.box1o1.configure(highlightcolor="#d9d9d9") self.box1o1.configure(selectbackground="#c4c4c4") self.box1o1.configure(selectforeground="black") self.box1o1.configure(width=10) self.box2o1 = ScrolledListBox(top) self.box2o1.place(relx=0.293, rely=0.285, relheight=0.598, relwidth=0.703) self.box2o1.configure(background="white") self.box2o1.configure(disabledforeground="#a3a3a3") self.box2o1.configure(font="TkFixedFont") self.box2o1.configure(foreground="black") self.box2o1.configure(highlightbackground="#d9d9d9") self.box2o1.configure(highlightcolor="#d9d9d9") self.box2o1.configure(selectbackground="#c4c4c4") self.box2o1.configure(selectforeground="black") self.box2o1.configure(width=10) self.TSeparator1 = ttk.Separator(top) self.TSeparator1.place(relx=0.923, rely=0.011, relheight=0.114) self.TSeparator1.configure(orient="vertical") self.TSeparator2 = ttk.Separator(top) self.TSeparator2.place(relx=0.013, rely=0.137, relwidth=0.202) self.TSeparator3 = ttk.Separator(top) self.TSeparator3.place(relx=0.013, rely=0.228, relwidth=0.975) self.TSeparator3_6 = ttk.Separator(top) self.TSeparator3_6.place(relx=0.013, rely=0.894, relwidth=0.975) self.viewbutton = tk.Button(top) self.viewbutton.place(relx=0.364, rely=0.923, height=33, width=148) self.viewbutton.configure(activebackground="#ececec") self.viewbutton.configure(activeforeground="#000000") self.viewbutton.configure(background="#2020d8") self.viewbutton.configure(disabledforeground="#a3a3a3") self.viewbutton.configure(font=font15) self.viewbutton.configure(foreground="#ffffff") self.viewbutton.configure(highlightbackground="#d9d9d9") self.viewbutton.configure(highlightcolor="black") self.viewbutton.configure(pady="0") self.viewbutton.configure(takefocus="0") self.viewbutton.configure(command=self.viewnames, text='''View all Names''') self.viewbutton_8 = tk.Button(top) self.viewbutton_8.place(relx=0.501, rely=0.923, height=33, width=148) self.viewbutton_8.configure(activebackground="#ececec") self.viewbutton_8.configure(activeforeground="#000000") self.viewbutton_8.configure(background="#2020d8") self.viewbutton_8.configure(disabledforeground="#a3a3a3") self.viewbutton_8.configure(font=font15) self.viewbutton_8.configure(foreground="#ffffff") self.viewbutton_8.configure(highlightbackground="#d9d9d9") self.viewbutton_8.configure(highlightcolor="black") self.viewbutton_8.configure(pady="0") self.viewbutton_8.configure(takefocus="0") self.viewbutton_8.configure(command=self.viewalls, text='''View all Data''') self.viewbutton_9 = tk.Button(top) self.viewbutton_9.place(relx=0.637, rely=0.923, height=33, width=108) self.viewbutton_9.configure(activebackground="#ececec") self.viewbutton_9.configure(activeforeground="#000000") self.viewbutton_9.configure(background="#2020d8") self.viewbutton_9.configure(disabledforeground="#a3a3a3") self.viewbutton_9.configure(font=font15) self.viewbutton_9.configure(foreground="#ffffff") self.viewbutton_9.configure(highlightbackground="#d9d9d9") self.viewbutton_9.configure(highlightcolor="black") self.viewbutton_9.configure(pady="0") self.viewbutton_9.configure(takefocus="0") self.viewbutton_9.configure(command=self.clearalls, text='''Clear all''') self.Label7 = tk.Label(top) self.Label7.place(relx=0.013, rely=0.251, height=26, width=78) self.Label7.configure(activebackground="#f9f9f9") self.Label7.configure(activeforeground="black") self.Label7.configure(background="#ffff24") self.Label7.configure(disabledforeground="#a3a3a3") self.Label7.configure(font=font16) self.Label7.configure(foreground="#1220e0") self.Label7.configure(highlightbackground="#d9d9d9") self.Label7.configure(highlightcolor="black") self.Label7.configure(text='''Id number''') self.menubar = tk.Menu(top, font="TkMenuFont", bg=_bgcolor, fg=_fgcolor) top.configure(menu=self.menubar) self.Label7_1 = tk.Label(top) self.Label7_1.place(relx=0.104, rely=0.251, height=26, width=78) self.Label7_1.configure(activebackground="#f9f9f9") self.Label7_1.configure(activeforeground="black") self.Label7_1.configure(background="#ffff24") self.Label7_1.configure(disabledforeground="#a3a3a3") self.Label7_1.configure(font=font16) self.Label7_1.configure(foreground="#1220e0") self.Label7_1.configure(highlightbackground="#d9d9d9") self.Label7_1.configure(highlightcolor="black") self.Label7_1.configure(text='''Name''') self.Label7_2 = tk.Label(top) self.Label7_2.place(relx=0.293, rely=0.251, height=26, width=68) self.Label7_2.configure(activebackground="#f9f9f9") self.Label7_2.configure(activeforeground="black") self.Label7_2.configure(background="#ffff24") self.Label7_2.configure(disabledforeground="#a3a3a3") self.Label7_2.configure(font=font16) self.Label7_2.configure(foreground="#1220e0") self.Label7_2.configure(highlightbackground="#d9d9d9") self.Label7_2.configure(highlightcolor="black") self.Label7_2.configure(text='''Id number''') self.Label7_3 = tk.Label(top) self.Label7_3.place(relx=0.345, rely=0.251, height=26, width=68) self.Label7_3.configure(activebackground="#f9f9f9") self.Label7_3.configure(activeforeground="black") self.Label7_3.configure(background="#ffff24") self.Label7_3.configure(disabledforeground="#a3a3a3") self.Label7_3.configure(font=font16) self.Label7_3.configure(foreground="#1220e0") self.Label7_3.configure(highlightbackground="#d9d9d9") self.Label7_3.configure(highlightcolor="black") self.Label7_3.configure(text='''Meter No.''') self.Label7_4 = tk.Label(top) self.Label7_4.place(relx=0.397, rely=0.251, height=26, width=68) self.Label7_4.configure(activebackground="#f9f9f9") self.Label7_4.configure(activeforeground="black") self.Label7_4.configure(background="#ffff24") self.Label7_4.configure(disabledforeground="#a3a3a3") self.Label7_4.configure(font=font16) self.Label7_4.configure(foreground="#1220e0") self.Label7_4.configure(highlightbackground="#d9d9d9") self.Label7_4.configure(highlightcolor="black") self.Label7_4.configure(text='''Ward No.''') self.Label7_1 = tk.Label(top) self.Label7_1.place(relx=0.449, rely=0.251, height=26, width=58) self.Label7_1.configure(activebackground="#f9f9f9") self.Label7_1.configure(activeforeground="black") self.Label7_1.configure(background="#ffff24") self.Label7_1.configure(disabledforeground="#a3a3a3") self.Label7_1.configure(font=font16) self.Label7_1.configure(foreground="#1220e0") self.Label7_1.configure(highlightbackground="#d9d9d9") self.Label7_1.configure(highlightcolor="black") self.Label7_1.configure(text='''Housetax''') self.Label7_2 = tk.Label(top) self.Label7_2.place(relx=0.494, rely=0.251, height=26, width=68) self.Label7_2.configure(activebackground="#f9f9f9") self.Label7_2.configure(activeforeground="black") self.Label7_2.configure(background="#ffff24") self.Label7_2.configure(disabledforeground="#a3a3a3") self.Label7_2.configure(font=font16) self.Label7_2.configure(foreground="#1220e0") self.Label7_2.configure(highlightbackground="#d9d9d9") self.Label7_2.configure(highlightcolor="black") self.Label7_2.configure(text='''Healthtax''') self.Label7_3 = tk.Label(top) self.Label7_3.place(relx=0.54, rely=0.251, height=26, width=58) self.Label7_3.configure(activebackground="#f9f9f9") self.Label7_3.configure(activeforeground="black") self.Label7_3.configure(background="#ffff24") self.Label7_3.configure(disabledforeground="#a3a3a3") self.Label7_3.configure(font=font16) self.Label7_3.configure(foreground="#1220e0") self.Label7_3.configure(highlightbackground="#d9d9d9") self.Label7_3.configure(highlightcolor="black") self.Label7_3.configure(text='''Lighttax''') self.Label7_5 = tk.Label(top) self.Label7_5.place(relx=0.579, rely=0.251, height=26, width=68) self.Label7_5.configure(activebackground="#f9f9f9") self.Label7_5.configure(activeforeground="black") self.Label7_5.configure(background="#ffff24") self.Label7_5.configure(disabledforeground="#a3a3a3") self.Label7_5.configure(font=font16) self.Label7_5.configure(foreground="#1220e0") self.Label7_5.configure(highlightbackground="#d9d9d9") self.Label7_5.configure(highlightcolor="black") self.Label7_5.configure(text='''Watertax''') self.Label7_5 = tk.Label(top) self.Label7_5.place(relx=0.624, rely=0.251, height=26, width=48) self.Label7_5.configure(activebackground="#f9f9f9") self.Label7_5.configure(activeforeground="black") self.Label7_5.configure(background="#ffff24") self.Label7_5.configure(disabledforeground="#a3a3a3") self.Label7_5.configure(font=font16) self.Label7_5.configure(foreground="#1220e0") self.Label7_5.configure(highlightbackground="#d9d9d9") self.Label7_5.configure(highlightcolor="black") self.Label7_5.configure(text='''Total''') self.Label7_5 = tk.Label(top) self.Label7_5.place(relx=0.663, rely=0.251, height=26, width=78) self.Label7_5.configure(activebackground="#f9f9f9") self.Label7_5.configure(activeforeground="black") self.Label7_5.configure(background="#ffff24") self.Label7_5.configure(disabledforeground="#a3a3a3") self.Label7_5.configure(font=font16) self.Label7_5.configure(foreground="#1220e0") self.Label7_5.configure(highlightbackground="#d9d9d9") self.Label7_5.configure(highlightcolor="black") self.Label7_5.configure(text='''Reciept No.''') self.Label7_6 = tk.Label(top) self.Label7_6.place(relx=0.722, rely=0.251, height=26, width=68) self.Label7_6.configure(activebackground="#f9f9f9") self.Label7_6.configure(activeforeground="black") self.Label7_6.configure(background="#ffff24") self.Label7_6.configure(disabledforeground="#a3a3a3") self.Label7_6.configure(font=font16) self.Label7_6.configure(foreground="#1220e0") self.Label7_6.configure(highlightbackground="#d9d9d9") self.Label7_6.configure(highlightcolor="black") self.Label7_6.configure(text='''Housetax''') self.Label7_6.configure(width=68) self.Label7_6 = tk.Label(top) self.Label7_6.place(relx=0.767, rely=0.251, height=26, width=68) self.Label7_6.configure(activebackground="#f9f9f9") self.Label7_6.configure(activeforeground="black") self.Label7_6.configure(background="#ffff24") self.Label7_6.configure(disabledforeground="#a3a3a3") self.Label7_6.configure(font=font16) self.Label7_6.configure(foreground="#1220e0") self.Label7_6.configure(highlightbackground="#d9d9d9") self.Label7_6.configure(highlightcolor="black") self.Label7_6.configure(text='''Lighttax''') self.Label7_6 = tk.Label(top) self.Label7_6.place(relx=0.813, rely=0.251, height=26, width=68) self.Label7_6.configure(activebackground="#f9f9f9") self.Label7_6.configure(activeforeground="black") self.Label7_6.configure(background="#ffff24") self.Label7_6.configure(disabledforeground="#a3a3a3") self.Label7_6.configure(font=font16) self.Label7_6.configure(foreground="#1220e0") self.Label7_6.configure(highlightbackground="#d9d9d9") self.Label7_6.configure(highlightcolor="black") self.Label7_6.configure(text='''Watertax''') self.Label7_6 = tk.Label(top) self.Label7_6.place(relx=0.904, rely=0.251, height=26, width=48) self.Label7_6.configure(activebackground="#f9f9f9") self.Label7_6.configure(activeforeground="black") self.Label7_6.configure(background="#ffff24") self.Label7_6.configure(disabledforeground="#a3a3a3") self.Label7_6.configure(font=font16) self.Label7_6.configure(foreground="#1220e0") self.Label7_6.configure(highlightbackground="#d9d9d9") self.Label7_6.configure(highlightcolor="black") self.Label7_6.configure(text='''Total''') self.Label7_3 = tk.Label(top) self.Label7_3.place(relx=0.858, rely=0.251, height=26, width=68) self.Label7_3.configure(activebackground="#f9f9f9") self.Label7_3.configure(activeforeground="black") self.Label7_3.configure(background="#ffff24") self.Label7_3.configure(disabledforeground="#a3a3a3") self.Label7_3.configure(font=font16) self.Label7_3.configure(foreground="#1220e0") self.Label7_3.configure(highlightbackground="#d9d9d9") self.Label7_3.configure(highlightcolor="black") self.Label7_3.configure(text='''Healthtax''') self.Label7_4 = tk.Label(top) self.Label7_4.place(relx=0.943, rely=0.251, height=26, width=48) self.Label7_4.configure(activebackground="#f9f9f9") self.Label7_4.configure(activeforeground="black") self.Label7_4.configure(background="#ffff24") self.Label7_4.configure(disabledforeground="#a3a3a3") self.Label7_4.configure(font=font16) self.Label7_4.configure(foreground="#1220e0") self.Label7_4.configure(highlightbackground="#d9d9d9") self.Label7_4.configure(highlightcolor="black") self.Label7_4.configure(text='''Rest''') self.Label7_5 = tk.Label(top) self.Label7_5.place(relx=0.806, rely=0.216, height=26, width=68) self.Label7_5.configure(activebackground="#f9f9f9") self.Label7_5.configure(activeforeground="black") self.Label7_5.configure(background="#ffff24") self.Label7_5.configure(disabledforeground="#a3a3a3") self.Label7_5.configure(font=font16) self.Label7_5.configure(foreground="#1220e0") self.Label7_5.configure(highlightbackground="#d9d9d9") self.Label7_5.configure(highlightcolor="black") self.Label7_5.configure(text='''Paid''') self.TSeparator4 = ttk.Separator(top) self.TSeparator4.place(relx=0.715, rely=0.228, relheight=0.057) self.TSeparator4.configure(orient="vertical") self.TSeparator4_6 = ttk.Separator(top) self.TSeparator4_6.place(relx=0.936, rely=0.228, relheight=0.057) self.TSeparator4_6.configure(orient="vertical") self.viewtotal = tk.Button(top) self.viewtotal.place(relx=0.844, rely=0.155, height=53, width=158) self.viewtotal.configure(activebackground="#ececec") self.viewtotal.configure(activeforeground="#000000") self.viewtotal.configure(background="#ff0d0d") self.viewtotal.configure(disabledforeground="#a3a3a3") self.viewtotal.configure( font="-family {Rockwell} -size 13 -weight bold") self.viewtotal.configure(foreground="#ffffff") self.viewtotal.configure(highlightbackground="#d9d9d9") self.viewtotal.configure(highlightcolor="black") self.viewtotal.configure(pady="0") self.viewtotal.configure(takefocus="0") self.viewtotal.configure(text='''VIEW TOTAL''') self.viewtotal.configure(width=158, command=self.viewtotals) self.txt_viewtotal = tk.Text(top) self.txt_viewtotal.place(relx=0.706, rely=0.155, relheight=0.053, relwidth=0.121) self.txt_viewtotal.configure(background="#757575") self.txt_viewtotal.configure(font=font41) self.txt_viewtotal.configure(foreground="aqua") self.txt_viewtotal.configure(highlightbackground="#d9d9d9") self.txt_viewtotal.configure(highlightcolor="black") self.txt_viewtotal.configure(insertbackground="black") self.txt_viewtotal.configure(selectbackground="#c4c4c4") self.txt_viewtotal.configure(selectforeground="black") self.txt_viewtotal.configure(width=194) self.txt_viewtotal.configure(wrap='word') self.Label6 = tk.Label(top) self.Label6.place(relx=0.949, rely=0.034, height=44, width=44) self.Label6.configure(background="#d9d9d9") self.Label6.configure(disabledforeground="#a3a3a3") self.Label6.configure(foreground="#000000") self._img1 = tk.PhotoImage(file="./login3.png") self.Label6.configure(image=self._img1) self.Label6.configure(text='''Label''')
def __init__(self, master): Frame.__init__(self, master, background="#00629B") self.grid(row=0, column=0) self.speed = 0 self.button0Flag = False self.button1Flag = False self.button2Flag = False self.button3Flag = False self.button4Flag = False self.button5Flag = False self.button6Flag = False self.button7Flag = False self.button8Flag = False self.button0 = Button(self, text="Stop", width=15, highlightbackground="#00629B") self.button0.grid(row=1, column=1, padx=(10, 0), pady=(10, 0)) self.button0["command"] = self.stop self.button1 = Button(self, text="Forward", width=15, highlightbackground="#00629B") self.button1.grid(row=0, column=1, padx=(10, 0), pady=(10, 0)) self.button1["command"] = self.forward self.button2 = Button(self, text="Forward Right", width=15, highlightbackground="#00629B") self.button2.grid(row=0, column=2, padx=(10, 10), pady=(10, 0)) self.button2["command"] = self.forwardRight self.button3 = Button(self, text="Right", width=15, highlightbackground="#00629B") self.button3.grid(row=1, column=2, padx=(10, 10), pady=(10, 0)) self.button3["command"] = self.right self.button4 = Button(self, text="Backward Right", width=15, highlightbackground="#00629B") self.button4.grid(row=2, column=2, padx=(10, 10), pady=(10, 0)) self.button4["command"] = self.backwardRight self.button5 = Button(self, text="Backward", width=15, highlightbackground="#00629B") self.button5.grid(row=2, column=1, padx=(10, 0), pady=(10, 0)) self.button5["command"] = self.backward self.button6 = Button(self, text="Backward Left", width=15, highlightbackground="#00629B") self.button6.grid(row=2, column=0, padx=(10, 0), pady=(10, 0)) self.button6["command"] = self.backwardLeft self.button7 = Button(self, text="Left", width=15, highlightbackground="#00629B") self.button7.grid(row=1, column=0, padx=(10, 0), pady=(10, 0)) self.button7["command"] = self.left self.button8 = Button(self, text="Forward Left", width=15, highlightbackground="#00629B") self.button8.grid(row=0, column=0, padx=(10, 0), pady=(10, 0)) self.button8["command"] = self.forwardLeft self.separator0 = ttk.Separator(self, orient="horizontal") self.separator0.grid(row=3, column=0) self.button9 = Button(self, text="Clockwise", width=15, highlightbackground="#00629B") self.button9.grid(row=4, column=0, padx=(10, 0), pady=(10, 0)) self.button9["command"] = self.clockwise self.button10 = Button(self, text="Counter Clockwise", width=15, highlightbackground="#00629B") self.button10.grid(row=4, column=1, padx=(10, 0), pady=(10, 0)) self.button10["command"] = self.counterClockwise self.entry0 = Entry(self, text="Speed", width=15, highlightbackground="#00629B") self.entry0.grid(row=6, column=0, padx=(10, 0), pady=(10, 10)) self.button11 = Button(self, text="Speed", width=15, highlightbackground="#00629B") self.button11.grid(row=6, column=1, padx=(10, 0), pady=(10, 10)) self.button11["command"] = self.speedInput
def __init__(self, View_Data_Window=None): '''This class configures and populates the toplevel window. View_Data_Window 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' font9 = "-family {Segoe UI} -size 9 -weight normal -slant " \ "roman -underline 0 -overstrike 0" font10 = "-family {Helvatica} -size 13 -weight normal -slant " \ "roman -underline 0 -overstrike 0" 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)]) View_Data_Window.geometry("1491x739+35+31") View_Data_Window.minsize(148, 1) View_Data_Window.maxsize(4112, 1330) View_Data_Window.resizable(1, 1) View_Data_Window.title("VIEW DATA") View_Data_Window.configure(background="#40b3a3") self.menubar = tk.Menu(View_Data_Window, font=font9, bg=_bgcolor, fg=_fgcolor) View_Data_Window.configure(menu = self.menubar) self.sub_menu = tk.Menu(View_Data_Window, tearoff=0) self.menubar.add_cascade(menu=self.sub_menu, activebackground="#ececec", activeforeground="#000000", background="#d9d9d9", compound="left", foreground="#000000", label="File") self.sub_menu.add_command( activebackground="#ececec", activeforeground="#000000", background="#d9d9d9", foreground="#000000", label="Exit", command=view_data_window1_support.destroy_window) self.TSeparator1 = ttk.Separator(View_Data_Window) self.TSeparator1.place(relx=0.355, rely=0.0, relheight=1.001) self.TSeparator1.configure(orient="vertical") self.TSeparator2 = ttk.Separator(View_Data_Window) self.TSeparator2.place(relx=0.0, rely=0.46, relwidth=0.355) self.TSeparator3 = ttk.Separator(View_Data_Window) self.TSeparator3.place(relx=0.355, rely=0.46, relwidth=1.0) self.ETable_Name_Drop = ttk.Combobox(View_Data_Window) self.ETable_Name_Drop.place(relx=0.034, rely=0.095, relheight=0.035 , relwidth=0.125) self.ETable_Name_Drop.configure(textvariable=view_data_window1_support.Ecombobox1) self.ETable_Name_Drop.configure(takefocus="") self.ETable_Name_Drop.configure(values=("Department","Dental Camp","Turnover","Satellite")) self.EPatient_Type_Drop = ttk.Combobox(View_Data_Window) self.EPatient_Type_Drop.place(relx=0.181, rely=0.095, relheight=0.035 , relwidth=0.125) self.EPatient_Type_Drop.configure(textvariable=view_data_window1_support.Ecombobox2) self.EPatient_Type_Drop.configure(takefocus="") self.EPatient_Type_Drop.configure(values=("All","Treated","Reffered","Screened")) self.Excel_Label = tk.Label(View_Data_Window) self.Excel_Label.place(relx=0.034, rely=0.014, relheight=0.062 , relwidth=0.276) self.Excel_Label.configure(background="#d9d9d9") self.Excel_Label.configure(font="font10") self.Excel_Label.configure(disabledforeground="#a3a3a3") self.Excel_Label.configure(foreground="#000000") self.Excel_Label.configure(relief="raised") self.Excel_Label.configure(text='''Excel View''') self.EFrom_Date_Label = tk.Label(View_Data_Window) self.EFrom_Date_Label.place(relx=0.034, rely=0.162, relheight=0.049, relwidth=0.122) self.EFrom_Date_Label.configure(font="font10") self.EFrom_Date_Label.configure(background="#d9d9d9") self.EFrom_Date_Label.configure(disabledforeground="#a3a3a3") self.EFrom_Date_Label.configure(foreground="#000000") self.EFrom_Date_Label.configure(text='''From Date:''') now = datetime.datetime.now() self.EFrom_Date_Entry = DateEntry(View_Data_Window, year=now.year, month=now.month, day=now.day) self.EFrom_Date_Entry.place(relx=0.168, rely=0.162, relheight=0.046, relwidth=0.137) self.EFrom_Date_Entry.configure(background="white") self.EFrom_Date_Entry.configure(date_pattern='y-mm-dd') self.EFrom_Date_Entry.configure(font="-family {Helvetica} -size 10") self.EFrom_Date_Entry.configure(foreground="#000000") self.EFrom_Date_Entry.configure(borderwidth=2) self.EFrom_Date_Entry.configure(width=12) self.ETo_Date_Label = tk.Label(View_Data_Window) self.ETo_Date_Label.place(relx=0.034, rely=0.23, relheight=0.049, relwidth=0.122) self.ETo_Date_Label.configure(activebackground="#f9f9f9") self.ETo_Date_Label.configure(font="font10") self.ETo_Date_Label.configure(activeforeground="black") self.ETo_Date_Label.configure(background="#d9d9d9") self.ETo_Date_Label.configure(disabledforeground="#a3a3a3") self.ETo_Date_Label.configure(foreground="#000000") self.ETo_Date_Label.configure(highlightbackground="#d9d9d9") self.ETo_Date_Label.configure(highlightcolor="black") self.ETo_Date_Label.configure(text='''To Date:''') now1 = datetime.datetime.now() self.ETo_Date_Entry = DateEntry(View_Data_Window, year=now1.year, month=now1.month, day=now1.day) self.ETo_Date_Entry.place(relx=0.168, rely=0.23, relheight=0.046, relwidth=0.137) self.ETo_Date_Entry.configure(background="white") self.ETo_Date_Entry.configure(date_pattern='y-mm-dd') self.ETo_Date_Entry.configure(font="-family {Helvetica} -size 10") self.ETo_Date_Entry.configure(foreground="#000000") self.ETo_Date_Entry.configure(borderwidth=2) self.ETo_Date_Entry.configure(width=12) self.Gen_Excel_Button = tk.Button(View_Data_Window) self.Gen_Excel_Button.place(relx=0.114, rely=0.311, relheight=0.045, relwidth=0.111) self.Gen_Excel_Button.configure(font="font10") self.Gen_Excel_Button.configure(activebackground="#ececec") self.Gen_Excel_Button.configure(activeforeground="#000000") self.Gen_Excel_Button.configure(background="#d9d9d9") self.Gen_Excel_Button.configure(disabledforeground="#a3a3a3") self.Gen_Excel_Button.configure(foreground="#000000") self.Gen_Excel_Button.configure(highlightbackground="#d9d9d9") self.Gen_Excel_Button.configure(highlightcolor="black") self.Gen_Excel_Button.configure(pady="0") self.Gen_Excel_Button.configure(text='''Generate Excel''') self.Gen_Excel_Button.configure(command=self.print_excel) self.Word_Label = tk.Label(View_Data_Window) self.Word_Label.place(relx=0.034, rely=0.487, relheight=0.062, relwidth=0.276) self.Word_Label.configure(activebackground="#f9f9f9") self.Word_Label.configure(font="font10") self.Word_Label.configure(activeforeground="black") self.Word_Label.configure(background="#d9d9d9") self.Word_Label.configure(disabledforeground="#a3a3a3") self.Word_Label.configure(foreground="#000000") self.Word_Label.configure(highlightbackground="#d9d9d9") self.Word_Label.configure(highlightcolor="black") self.Word_Label.configure(relief="raised") self.Word_Label.configure(text='''Camp Report ''') self.WDate_Label = tk.Label(View_Data_Window) self.WDate_Label.place(relx=0.034, rely=0.622, relheight=0.049, relwidth=0.122) self.WDate_Label.configure(activebackground="#f9f9f9") self.WDate_Label.configure(font="font10") self.WDate_Label.configure(activeforeground="black") self.WDate_Label.configure(background="#d9d9d9") self.WDate_Label.configure(disabledforeground="#a3a3a3") self.WDate_Label.configure(foreground="#000000") self.WDate_Label.configure(highlightbackground="#d9d9d9") self.WDate_Label.configure(highlightcolor="black") self.WDate_Label.configure(text='''Date:''') now2 = datetime.datetime.now() self.WDate_Entry = DateEntry(View_Data_Window, year=now2.year, month=now2.month, day=now2.day) self.WDate_Entry.place(relx=0.168, rely=0.622, relheight=0.046 , relwidth=0.137) self.WDate_Entry.configure(background="white") self.WDate_Entry.configure(date_pattern='y-mm-dd') self.WDate_Entry.configure(font="-family {Helvetica} -size 10") self.WDate_Entry.configure(foreground="#000000") self.WDate_Entry.configure(borderwidth=2) self.WDate_Entry.configure(width=12) self.Gen_Word_Button = tk.Button(View_Data_Window) self.Gen_Word_Button.place(relx=0.131, rely=0.785, relheight=0.045, relwidth=0.111) self.Gen_Word_Button.configure(activebackground="#ececec") self.Gen_Word_Button.configure(font="font10") self.Gen_Word_Button.configure(activeforeground="#000000") self.Gen_Word_Button.configure(background="#d9d9d9") self.Gen_Word_Button.configure(disabledforeground="#a3a3a3") self.Gen_Word_Button.configure(foreground="#000000") self.Gen_Word_Button.configure(highlightbackground="#d9d9d9") self.Gen_Word_Button.configure(highlightcolor="black") self.Gen_Word_Button.configure(pady="0") self.Gen_Word_Button.configure(text='''Generate Word''') self.Gen_Word_Button.configure(command=self.print_word) self.Graph_Label = tk.Label(View_Data_Window) self.Graph_Label.place(relx=0.543, rely=0.014, relheight=0.062, relwidth=0.276) self.Graph_Label.configure(activebackground="#f9f9f9") self.Graph_Label.configure(font="font10") self.Graph_Label.configure(activeforeground="black") self.Graph_Label.configure(background="#d9d9d9") self.Graph_Label.configure(disabledforeground="#a3a3a3") self.Graph_Label.configure(foreground="#000000") self.Graph_Label.configure(highlightbackground="#d9d9d9") self.Graph_Label.configure(highlightcolor="black") self.Graph_Label.configure(relief="raised") self.Graph_Label.configure(text='''Graph View''') self.GTable_Name_Drop = ttk.Combobox(View_Data_Window) self.GTable_Name_Drop.place(relx=0.416, rely=0.122, relheight=0.035 , relwidth=0.125) self.GTable_Name_Drop.configure(textvariable=view_data_window1_support.Gcombobox1) self.GTable_Name_Drop.configure(takefocus="") self.GTable_Name_Drop.configure(values=("All","Department","Dental Camp","Turn Over","Satellite")) self.GGroup_By_Drop = ttk.Combobox(View_Data_Window) self.GGroup_By_Drop.place(relx=0.805, rely=0.122, relheight=0.035 , relwidth=0.125) self.GGroup_By_Drop.configure(textvariable=view_data_window1_support.Gcombobox3) self.GGroup_By_Drop.configure(takefocus="") self.GGroup_By_Drop.configure(values=("By Month","By Year")) self.GFrom_Date_Label = tk.Label(View_Data_Window) self.GFrom_Date_Label.place(relx=0.396, rely=0.23, relheight=0.049, relwidth=0.122) self.GFrom_Date_Label.configure(activebackground="#f9f9f9") self.GFrom_Date_Label.configure(font="font10") self.GFrom_Date_Label.configure(activeforeground="black") self.GFrom_Date_Label.configure(background="#d9d9d9") self.GFrom_Date_Label.configure(disabledforeground="#a3a3a3") self.GFrom_Date_Label.configure(foreground="#000000") self.GFrom_Date_Label.configure(highlightbackground="#d9d9d9") self.GFrom_Date_Label.configure(highlightcolor="black") self.GFrom_Date_Label.configure(text='''From Date:''') self.GTo_Date_Label = tk.Label(View_Data_Window) self.GTo_Date_Label.place(relx=0.691, rely=0.23, relheight=0.049, relwidth=0.122) self.GTo_Date_Label.configure(activebackground="#f9f9f9") self.GTo_Date_Label.configure(font="font10") self.GTo_Date_Label.configure(activeforeground="black") self.GTo_Date_Label.configure(background="#d9d9d9") self.GTo_Date_Label.configure(disabledforeground="#a3a3a3") self.GTo_Date_Label.configure(foreground="#000000") self.GTo_Date_Label.configure(highlightbackground="#d9d9d9") self.GTo_Date_Label.configure(highlightcolor="black") self.GTo_Date_Label.configure(text='''To Date:''') now3 = datetime.datetime.now() self.GFrom_Date_Entry = DateEntry(View_Data_Window, year=now3.year, month=now3.month, day=now3.day) self.GFrom_Date_Entry.place(relx=0.53, rely=0.23, relheight=0.046 , relwidth=0.137) self.GFrom_Date_Entry.configure(background="white") self.GFrom_Date_Entry.configure(date_pattern='y-mm-dd') self.GFrom_Date_Entry.configure(font="-family {Helvetica} -size 10") self.GFrom_Date_Entry.configure(foreground="#000000") self.GFrom_Date_Entry.configure(borderwidth=2) self.GFrom_Date_Entry.configure(width=12) now4 = datetime.datetime.now() self.GTo_Date_Entry = DateEntry(View_Data_Window, year=now4.year, month=now4.month, day=now4.day) self.GTo_Date_Entry.place(relx=0.825, rely=0.23, relheight=0.046 , relwidth=0.137) self.GTo_Date_Entry.configure(background="white") self.GTo_Date_Entry.configure(date_pattern='y-mm-dd') self.GTo_Date_Entry.configure(font="-family {Helvetica} -size 10") self.GTo_Date_Entry.configure(foreground="#000000") self.GTo_Date_Entry.configure(borderwidth=2) self.GTo_Date_Entry.configure(width=12) self.Gen_Graph_Button = tk.Button(View_Data_Window) self.Gen_Graph_Button.place(relx=0.396, rely=0.352, relheight=0.045, relwidth=0.111) self.Gen_Graph_Button.configure(activebackground="#ececec") self.Gen_Graph_Button.configure(font="font10") self.Gen_Graph_Button.configure(activeforeground="#000000") self.Gen_Graph_Button.configure(background="#d9d9d9") self.Gen_Graph_Button.configure(disabledforeground="#a3a3a3") self.Gen_Graph_Button.configure(foreground="#000000") self.Gen_Graph_Button.configure(highlightbackground="#d9d9d9") self.Gen_Graph_Button.configure(highlightcolor="black") self.Gen_Graph_Button.configure(pady="0") self.Gen_Graph_Button.configure(text='''Generate Graph''') self.Gen_Graph_Button.configure(command=self.print_graph) self.Word_Label2 = tk.Label(View_Data_Window) self.Word_Label2.place(relx=0.543, rely=0.487, relheight=0.062, relwidth=0.276) self.Word_Label2.configure(activebackground="#f9f9f9") self.Word_Label2.configure(font="font10") self.Word_Label2.configure(activeforeground="black") self.Word_Label2.configure(background="#d9d9d9") self.Word_Label2.configure(disabledforeground="#a3a3a3") self.Word_Label2.configure(foreground="#000000") self.Word_Label2.configure(highlightbackground="#d9d9d9") self.Word_Label2.configure(highlightcolor="black") self.Word_Label2.configure(relief="raised") self.Word_Label2.configure(text='''Sensus Report''') self.WTable_Name_Drop2 = ttk.Combobox(View_Data_Window) self.WTable_Name_Drop2.place(relx=0.416, rely=0.585, relheight=0.035 , relwidth=0.125) self.WTable_Name_Drop2.configure(textvariable=view_data_window1_support.Wscombox) self.WTable_Name_Drop2.configure(takefocus="") self.WTable_Name_Drop2.configure(values=("All", "Department","Dental Camp", "Turn Over", "Satellite")) self.WFrom_Date_Label2 = tk.Label(View_Data_Window) self.WFrom_Date_Label2.place(relx=0.396, rely=0.65, relheight=0.049, relwidth=0.122) self.WFrom_Date_Label2.configure(activebackground="#f9f9f9") self.WFrom_Date_Label2.configure(font="font10") self.WFrom_Date_Label2.configure(activeforeground="black") self.WFrom_Date_Label2.configure(background="#d9d9d9") self.WFrom_Date_Label2.configure(disabledforeground="#a3a3a3") self.WFrom_Date_Label2.configure(foreground="#000000") self.WFrom_Date_Label2.configure(highlightbackground="#d9d9d9") self.WFrom_Date_Label2.configure(highlightcolor="black") self.WFrom_Date_Label2.configure(text=''' Year:''') self.Date_Entry = tk.Entry(View_Data_Window) self.Date_Entry.place(relx=0.53, rely=0.65, relheight=0.046 , relwidth=0.137) self.Date_Entry.configure(background="#ffffff") self.Date_Entry.configure(font="font10") self.Date_Entry.configure(disabledforeground="#a3a3a3") self.Date_Entry.configure(foreground="#000000") self.Gen_Sensus_Button = tk.Button(View_Data_Window) self.Gen_Sensus_Button.place(relx=0.396, rely=0.785, relheight=0.045, relwidth=0.111) self.Gen_Sensus_Button.configure(activebackground="#ececec") self.Gen_Sensus_Button.configure(font="font10") self.Gen_Sensus_Button.configure(activeforeground="#000000") self.Gen_Sensus_Button.configure(background="#d9d9d9") self.Gen_Sensus_Button.configure(disabledforeground="#a3a3a3") self.Gen_Sensus_Button.configure(foreground="#000000") self.Gen_Sensus_Button.configure(highlightbackground="#d9d9d9") self.Gen_Sensus_Button.configure(highlightcolor="black") self.Gen_Sensus_Button.configure(pady="0") self.Gen_Sensus_Button.configure(text='''Generate Sensus''') self.Gen_Sensus_Button.configure(command=self.print_census)
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("600x450+415+159") top.title("Table") top.configure(background="#a0b8d8") self.Button11 = tk.Button(top) self.Button11.place(relx=0.9, rely=0.933, height=24, width=49) self.Button11.configure(activebackground="#ececec") self.Button11.configure(activeforeground="#000000") self.Button11.configure(background="#d9d9d9") self.Button11.configure(disabledforeground="#a3a3a3") self.Button11.configure(foreground="#000000") self.Button11.configure(highlightbackground="#d9d9d9") self.Button11.configure(highlightcolor="black") self.Button11.configure(pady="0") self.Button11.configure(text='''Logout''') self.Button11.configure(command=self.clicked11) self.Button12 = tk.Button(top) self.Button12.place(relx=0.017, rely=0.022, height=24, width=36) self.Button12.configure(activebackground="#ececec") self.Button12.configure(activeforeground="#000000") self.Button12.configure(background="#82a1d8") self.Button12.configure(disabledforeground="#a3a3a3") self.Button12.configure(foreground="#000000") self.Button12.configure(highlightbackground="#d9d9d9") self.Button12.configure(highlightcolor="black") self.Button12.configure(pady="0") self.Button12.configure(text='''Back''') self.Button12.configure(command=self.clicked12) self.TFrame1 = ttk.Frame(top) self.TFrame1.place(relx=0.05, rely=0.067, relheight=0.856, relwidth=0.875) self.TFrame1.configure(relief='groove') self.TFrame1.configure(borderwidth="2") self.TFrame1.configure(relief="groove") self.TFrame1.configure(width=525) self.TSeparator1 = ttk.Separator(self.TFrame1) self.TSeparator1.place(relx=-0.019, rely=0.104, relwidth=1.029) self.TSeparator1_2 = ttk.Separator(self.TFrame1) self.TSeparator1_2.place(relx=0.0, rely=0.208, relwidth=1.01) self.TSeparator1_3 = ttk.Separator(self.TFrame1) self.TSeparator1_3.place(relx=0.0, rely=0.286, relwidth=1.01) self.TSeparator1_5 = ttk.Separator(self.TFrame1) self.TSeparator1_5.place(relx=-0.01, rely=0.455, relwidth=1.01) self.TSeparator1_6 = ttk.Separator(self.TFrame1) self.TSeparator1_6.place(relx=-0.01, rely=0.545, relwidth=1.048) self.TSeparator2_10 = ttk.Separator(self.TFrame1) self.TSeparator2_10.place(relx=0.324, rely=0.0, relheight=1.143) self.TSeparator2_10.configure(orient="vertical") self.TSeparator2_11 = ttk.Separator(self.TFrame1) self.TSeparator2_11.place(relx=0.552, rely=0.0, relheight=0.987) self.TSeparator2_11.configure(orient="vertical") self.TSeparator2_12 = ttk.Separator(self.TFrame1) self.TSeparator2_12.place(relx=0.762, rely=-0.026, relheight=1.221) self.TSeparator2_12.configure(orient="vertical") self.TLabel1 = ttk.Label(self.TFrame1) self.TLabel1.place(relx=0.019, rely=0.026, height=19, width=32) self.TLabel1.configure(background="#d9d9d9") self.TLabel1.configure(foreground="#000000") self.TLabel1.configure(font="TkDefaultFont") self.TLabel1.configure(relief="flat") self.TLabel1.configure(text='''S.No.''') self.TLabel2 = ttk.Label(self.TFrame1) self.TLabel2.place(relx=0.152, rely=0.026, height=19, width=76) self.TLabel2.configure(background="#d9d9d9") self.TLabel2.configure(foreground="#000000") self.TLabel2.configure(font="TkDefaultFont") self.TLabel2.configure(relief="flat") self.TLabel2.configure(text='''Companies''') self.TLabel2.configure(width=76) self.TLabel3 = ttk.Label(self.TFrame1) self.TLabel3.place(relx=0.4, rely=0.026, height=19, width=30) self.TLabel3.configure(background="#d9d9d9") self.TLabel3.configure(foreground="#000000") self.TLabel3.configure(font="TkDefaultFont") self.TLabel3.configure(relief="flat") self.TLabel3.configure(text='''High''') self.TLabel4 = ttk.Label(self.TFrame1) self.TLabel4.place(relx=0.629, rely=0.026, height=19, width=26) self.TLabel4.configure(background="#d9d9d9") self.TLabel4.configure(foreground="#000000") self.TLabel4.configure(font="TkDefaultFont") self.TLabel4.configure(relief="flat") self.TLabel4.configure(text='''Low''') self.TLabel5 = ttk.Label(self.TFrame1) self.TLabel5.place(relx=0.838, rely=0.026, height=19, width=41) self.TLabel5.configure(background="#d9d9d9") self.TLabel5.configure(foreground="#000000") self.TLabel5.configure(font="TkDefaultFont") self.TLabel5.configure(relief="flat") self.TLabel5.configure(text='''Graphs''') self.TLabel6 = ttk.Label(self.TFrame1) self.TLabel6.place(relx=0.019, rely=0.13, height=19, width=13) self.TLabel6.configure(background="#d9d9d9") self.TLabel6.configure(foreground="#000000") self.TLabel6.configure(font="TkDefaultFont") self.TLabel6.configure(relief="flat") self.TLabel6.configure(text='''1.''') self.TLabel7 = ttk.Label(self.TFrame1) self.TLabel7.place(relx=0.019, rely=0.234, height=19, width=13) self.TLabel7.configure(background="#d9d9d9") self.TLabel7.configure(foreground="#000000") self.TLabel7.configure(font="TkDefaultFont") self.TLabel7.configure(relief="flat") self.TLabel7.configure(text='''2.''') self.TLabel8 = ttk.Label(self.TFrame1) self.TLabel8.place(relx=0.019, rely=0.312, height=19, width=13) self.TLabel8.configure(background="#d9d9d9") self.TLabel8.configure(foreground="#000000") self.TLabel8.configure(font="TkDefaultFont") self.TLabel8.configure(relief="flat") self.TLabel8.configure(text='''3.''') self.TLabel9 = ttk.Label(self.TFrame1) self.TLabel9.place(relx=0.019, rely=0.39, height=19, width=13) self.TLabel9.configure(background="#d9d9d9") self.TLabel9.configure(foreground="#000000") self.TLabel9.configure(font="TkDefaultFont") self.TLabel9.configure(relief="flat") self.TLabel9.configure(text='''4.''') self.TLabel10 = ttk.Label(self.TFrame1) self.TLabel10.place(relx=0.019, rely=0.468, height=19, width=13) self.TLabel10.configure(background="#d9d9d9") self.TLabel10.configure(foreground="#000000") self.TLabel10.configure(font="TkDefaultFont") self.TLabel10.configure(relief="flat") self.TLabel10.configure(text='''5.''') self.TLabel11 = ttk.Label(self.TFrame1) self.TLabel11.place(relx=0.019, rely=0.571, height=19, width=13) self.TLabel11.configure(background="#d9d9d9") self.TLabel11.configure(foreground="#000000") self.TLabel11.configure(font="TkDefaultFont") self.TLabel11.configure(relief="flat") self.TLabel11.configure(text='''6.''') self.TLabel12 = ttk.Label(self.TFrame1) self.TLabel12.place(relx=0.019, rely=0.649, height=19, width=13) self.TLabel12.configure(background="#d9d9d9") self.TLabel12.configure(foreground="#000000") self.TLabel12.configure(font="TkDefaultFont") self.TLabel12.configure(relief="flat") self.TLabel12.configure(text='''7.''') self.TLabel13 = ttk.Label(self.TFrame1) self.TLabel13.place(relx=0.019, rely=0.753, height=19, width=13) self.TLabel13.configure(background="#d9d9d9") self.TLabel13.configure(foreground="#000000") self.TLabel13.configure(font="TkDefaultFont") self.TLabel13.configure(relief="flat") self.TLabel13.configure(text='''8.''') self.TLabel14 = ttk.Label(self.TFrame1) self.TLabel14.place(relx=0.019, rely=0.831, height=19, width=13) self.TLabel14.configure(background="#d9d9d9") self.TLabel14.configure(foreground="#000000") self.TLabel14.configure(font="TkDefaultFont") self.TLabel14.configure(relief="flat") self.TLabel14.configure(text='''9.''') self.TLabel15 = ttk.Label(self.TFrame1) self.TLabel15.place(relx=0.019, rely=0.935, height=19, width=19) self.TLabel15.configure(background="#d9d9d9") self.TLabel15.configure(foreground="#000000") self.TLabel15.configure(font="TkDefaultFont") self.TLabel15.configure(relief="flat") self.TLabel15.configure(text='''10.''') self.TLabel16 = ttk.Label(self.TFrame1) self.TLabel16.place(relx=0.152, rely=0.13, height=19, width=60) self.TLabel16.configure(background="#d9d9d9") self.TLabel16.configure(foreground="#000000") self.TLabel16.configure(font="TkDefaultFont") self.TLabel16.configure(relief="flat") self.TLabel16.configure(text='''Apple''') self.TLabel17 = ttk.Label(self.TFrame1) self.TLabel17.place(relx=0.152, rely=0.234, height=19, width=60) self.TLabel17.configure(background="#d9d9d9") self.TLabel17.configure(foreground="#000000") self.TLabel17.configure(font="TkDefaultFont") self.TLabel17.configure(relief="flat") self.TLabel17.configure(text='''Amazon''') self.TLabel18 = ttk.Label(self.TFrame1) self.TLabel18.place(relx=0.152, rely=0.312, height=19, width=60) self.TLabel18.configure(background="#d9d9d9") self.TLabel18.configure(foreground="#000000") self.TLabel18.configure(font="TkDefaultFont") self.TLabel18.configure(relief="flat") self.TLabel18.configure(text='''Cisco''') self.TLabel19 = ttk.Label(self.TFrame1) self.TLabel19.place(relx=0.152, rely=0.39, height=19, width=60) self.TLabel19.configure(background="#d9d9d9") self.TLabel19.configure(foreground="#000000") self.TLabel19.configure(font="TkDefaultFont") self.TLabel19.configure(relief="flat") self.TLabel19.configure(text='''Facebook''') self.TLabel20 = ttk.Label(self.TFrame1) self.TLabel20.place(relx=0.152, rely=0.468, height=19, width=60) self.TLabel20.configure(background="#d9d9d9") self.TLabel20.configure(foreground="#000000") self.TLabel20.configure(font="TkDefaultFont") self.TLabel20.configure(relief="flat") self.TLabel20.configure(text='''Google''') self.TLabel21 = ttk.Label(self.TFrame1) self.TLabel21.place(relx=0.152, rely=0.571, height=19, width=60) self.TLabel21.configure(background="#d9d9d9") self.TLabel21.configure(foreground="#000000") self.TLabel21.configure(font="TkDefaultFont") self.TLabel21.configure(relief="flat") self.TLabel21.configure(text='''Intel''') self.TLabel22 = ttk.Label(self.TFrame1) self.TLabel22.place(relx=0.152, rely=0.649, height=19, width=60) self.TLabel22.configure(background="#d9d9d9") self.TLabel22.configure(foreground="#000000") self.TLabel22.configure(font="TkDefaultFont") self.TLabel22.configure(relief="flat") self.TLabel22.configure(text='''Microsoft''') self.TLabel23 = ttk.Label(self.TFrame1) self.TLabel23.place(relx=0.152, rely=0.753, height=19, width=60) self.TLabel23.configure(background="#d9d9d9") self.TLabel23.configure(foreground="#000000") self.TLabel23.configure(font="TkDefaultFont") self.TLabel23.configure(relief="flat") self.TLabel23.configure(text='''Oracle''') self.TLabel23.configure(width=43) self.TLabel24 = ttk.Label(self.TFrame1) self.TLabel24.place(relx=0.152, rely=0.831, height=19, width=60) self.TLabel24.configure(background="#d9d9d9") self.TLabel24.configure(foreground="#000000") self.TLabel24.configure(font="TkDefaultFont") self.TLabel24.configure(relief="flat") self.TLabel24.configure(text='''Qualcomm''') self.TLabel25 = ttk.Label(self.TFrame1) self.TLabel25.place(relx=0.152, rely=0.935, height=19, width=60) self.TLabel25.configure(background="#d9d9d9") self.TLabel25.configure(foreground="#000000") self.TLabel25.configure(font="TkDefaultFont") self.TLabel25.configure(relief="flat") self.TLabel25.configure(text='''Tesla''') self.TLabel26 = ttk.Label(self.TFrame1) self.TLabel26.place(relx=0.4, rely=0.13, height=19, width=46) self.TLabel26.configure(background="#d9d9d9") self.TLabel26.configure(foreground="#000000") self.TLabel26.configure(font="TkDefaultFont") self.TLabel26.configure(relief="flat") self.TLabel26.configure(text='''211.84''') self.TLabel27 = ttk.Label(self.TFrame1) self.TLabel27.place(relx=0.4, rely=0.234, height=19, width=46) self.TLabel27.configure(background="#d9d9d9") self.TLabel27.configure(foreground="#000000") self.TLabel27.configure(font="TkDefaultFont") self.TLabel27.configure(relief="flat") self.TLabel27.configure(text='''1964.40''') self.TLabel28 = ttk.Label(self.TFrame1) self.TLabel28.place(relx=0.4, rely=0.312, height=19, width=46) self.TLabel28.configure(background="#d9d9d9") self.TLabel28.configure(foreground="#000000") self.TLabel28.configure(font="TkDefaultFont") self.TLabel28.configure(relief="flat") self.TLabel28.configure(text='''59.99''') self.TLabel29 = ttk.Label(self.TFrame1) self.TLabel29.place(relx=0.4, rely=0.39, height=19, width=46) self.TLabel29.configure(background="#d9d9d9") self.TLabel29.configure(foreground="#000000") self.TLabel29.configure(font="TkDefaultFont") self.TLabel29.configure(relief="flat") self.TLabel29.configure(text='''196.16''') self.TLabel30 = ttk.Label(self.TFrame1) self.TLabel30.place(relx=0.4, rely=0.494, height=19, width=46) self.TLabel30.configure(background="#d9d9d9") self.TLabel30.configure(foreground="#000000") self.TLabel30.configure(font="TkDefaultFont") self.TLabel30.configure(relief="flat") self.TLabel30.configure(text='''1186.80''') self.TLabel31 = ttk.Label(self.TFrame1) self.TLabel31.place(relx=0.4, rely=0.571, height=19, width=46) self.TLabel31.configure(background="#d9d9d9") self.TLabel31.configure(foreground="#000000") self.TLabel31.configure(font="TkDefaultFont") self.TLabel31.configure(relief="flat") self.TLabel31.configure(text='''51.82''') self.TLabel32 = ttk.Label(self.TFrame1) self.TLabel32.place(relx=0.4, rely=0.649, height=19, width=46) self.TLabel32.configure(background="#d9d9d9") self.TLabel32.configure(foreground="#000000") self.TLabel32.configure(font="TkDefaultFont") self.TLabel32.configure(relief="flat") self.TLabel32.configure(text='''129.43''') self.TLabel33 = ttk.Label(self.TFrame1) self.TLabel33.place(relx=0.4, rely=0.753, height=19, width=46) self.TLabel33.configure(background="#d9d9d9") self.TLabel33.configure(foreground="#000000") self.TLabel33.configure(font="TkDefaultFont") self.TLabel33.configure(relief="flat") self.TLabel33.configure(text='''55.02''') self.TLabel34 = ttk.Label(self.TFrame1) self.TLabel34.place(relx=0.4, rely=0.831, height=19, width=46) self.TLabel34.configure(background="#d9d9d9") self.TLabel34.configure(foreground="#000000") self.TLabel34.configure(font="TkDefaultFont") self.TLabel34.configure(relief="flat") self.TLabel34.configure(text='''89.82''') self.TLabel35 = ttk.Label(self.TFrame1) self.TLabel35.place(relx=0.4, rely=0.935, height=19, width=46) self.TLabel35.configure(background="#d9d9d9") self.TLabel35.configure(foreground="#000000") self.TLabel35.configure(font="TkDefaultFont") self.TLabel35.configure(relief="flat") self.TLabel35.configure(text='''256.61''') self.TLabel36 = ttk.Label(self.TFrame1) self.TLabel36.place(relx=0.61, rely=0.13, height=19, width=46) self.TLabel36.configure(background="#d9d9d9") self.TLabel36.configure(foreground="#000000") self.TLabel36.configure(font="TkDefaultFont") self.TLabel36.configure(relief="flat") self.TLabel36.configure(text='''210.23''') self.TLabel37 = ttk.Label(self.TFrame1) self.TLabel37.place(relx=0.61, rely=0.234, height=19, width=46) self.TLabel37.configure(background="#d9d9d9") self.TLabel37.configure(foreground="#000000") self.TLabel37.configure(font="TkDefaultFont") self.TLabel37.configure(relief="flat") self.TLabel37.configure(text='''1936.00''') self.TLabel38 = ttk.Label(self.TFrame1) self.TLabel38.place(relx=0.61, rely=0.312, height=19, width=46) self.TLabel38.configure(background="#d9d9d9") self.TLabel38.configure(foreground="#000000") self.TLabel38.configure(font="TkDefaultFont") self.TLabel38.configure(relief="flat") self.TLabel38.configure(text='''54.18''') self.TLabel39 = ttk.Label(self.TFrame1) self.TLabel39.place(relx=0.61, rely=0.39, height=19, width=46) self.TLabel39.configure(background="#d9d9d9") self.TLabel39.configure(foreground="#000000") self.TLabel39.configure(font="TkDefaultFont") self.TLabel39.configure(relief="flat") self.TLabel39.configure(text='''193.71''') self.TLabel40 = ttk.Label(self.TFrame1) self.TLabel40.place(relx=0.61, rely=0.494, height=19, width=46) self.TLabel40.configure(background="#d9d9d9") self.TLabel40.configure(foreground="#000000") self.TLabel40.configure(font="TkDefaultFont") self.TLabel40.configure(relief="flat") self.TLabel40.configure(text='''1169.00''') self.TLabel41 = ttk.Label(self.TFrame1) self.TLabel41.place(relx=0.61, rely=0.571, height=19, width=46) self.TLabel41.configure(background="#d9d9d9") self.TLabel41.configure(foreground="#000000") self.TLabel41.configure(font="TkDefaultFont") self.TLabel41.configure(relief="flat") self.TLabel41.configure(text='''50.73''') self.TLabel42 = ttk.Label(self.TFrame1) self.TLabel42.place(relx=0.61, rely=0.649, height=19, width=46) self.TLabel42.configure(background="#d9d9d9") self.TLabel42.configure(foreground="#000000") self.TLabel42.configure(font="TkDefaultFont") self.TLabel42.configure(relief="flat") self.TLabel42.configure(text='''127.25''') self.TLabel43 = ttk.Label(self.TFrame1) self.TLabel43.place(relx=0.61, rely=0.753, height=19, width=46) self.TLabel43.configure(background="#d9d9d9") self.TLabel43.configure(foreground="#000000") self.TLabel43.configure(font="TkDefaultFont") self.TLabel43.configure(relief="flat") self.TLabel43.configure(text='''54.67''') self.TLabel44 = ttk.Label(self.TFrame1) self.TLabel44.place(relx=0.61, rely=0.831, height=19, width=46) self.TLabel44.configure(background="#d9d9d9") self.TLabel44.configure(foreground="#000000") self.TLabel44.configure(font="TkDefaultFont") self.TLabel44.configure(relief="flat") self.TLabel44.configure(text='''87.06''') self.TLabel45 = ttk.Label(self.TFrame1) self.TLabel45.place(relx=0.61, rely=0.935, height=19, width=46) self.TLabel45.configure(background="#d9d9d9") self.TLabel45.configure(foreground="#000000") self.TLabel45.configure(font="TkDefaultFont") self.TLabel45.configure(relief="flat") self.TLabel45.configure(text='''247.49''') self.Button1 = tk.Button(self.TFrame1) self.Button1.place(relx=0.819, rely=0.13, height=24, width=80) 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='''Show Graph''') self.Button1.configure(command=self.clicked1) self.Button2 = tk.Button(self.TFrame1) self.Button2.place(relx=0.819, rely=0.234, height=14, width=80) self.Button2.configure(activebackground="#ececec") self.Button2.configure(activeforeground="#000000") self.Button2.configure(background="#d9d9d9") self.Button2.configure(disabledforeground="#a3a3a3") self.Button2.configure(foreground="#000000") self.Button2.configure(highlightbackground="#d9d9d9") self.Button2.configure(highlightcolor="black") self.Button2.configure(pady="0") self.Button2.configure(text='''Show Graph''') self.Button2.configure(width=80) self.Button2.configure(command=self.clicked2) self.Button3 = tk.Button(self.TFrame1) self.Button3.place(relx=0.819, rely=0.312, height=14, width=80) self.Button3.configure(activebackground="#ececec") self.Button3.configure(activeforeground="#000000") self.Button3.configure(background="#d9d9d9") self.Button3.configure(disabledforeground="#a3a3a3") self.Button3.configure(foreground="#000000") self.Button3.configure(highlightbackground="#d9d9d9") self.Button3.configure(highlightcolor="black") self.Button3.configure(pady="0") self.Button3.configure(text='''Show Graph''') self.Button3.configure(width=80) self.Button3.configure(command=self.clicked3) self.Button4 = tk.Button(self.TFrame1) self.Button4.place(relx=0.819, rely=0.39, height=24, width=80) self.Button4.configure(activebackground="#ececec") self.Button4.configure(activeforeground="#000000") self.Button4.configure(background="#d9d9d9") self.Button4.configure(disabledforeground="#a3a3a3") self.Button4.configure(foreground="#000000") self.Button4.configure(highlightbackground="#d9d9d9") self.Button4.configure(highlightcolor="black") self.Button4.configure(pady="0") self.Button4.configure(text='''Show Graph''') self.Button4.configure(command=self.clicked4) self.Button5 = tk.Button(self.TFrame1) self.Button5.place(relx=0.819, rely=0.494, height=14, width=80) self.Button5.configure(activebackground="#ececec") self.Button5.configure(activeforeground="#000000") self.Button5.configure(background="#d9d9d9") self.Button5.configure(disabledforeground="#a3a3a3") self.Button5.configure(foreground="#000000") self.Button5.configure(highlightbackground="#d9d9d9") self.Button5.configure(highlightcolor="black") self.Button5.configure(pady="0") self.Button5.configure(text='''Show Graph''') self.Button5.configure(width=80) self.Button5.configure(command=self.clicked5) self.Button6 = tk.Button(self.TFrame1) self.Button6.place(relx=0.819, rely=0.571, height=14, width=80) self.Button6.configure(activebackground="#ececec") self.Button6.configure(activeforeground="#000000") self.Button6.configure(background="#d9d9d9") self.Button6.configure(disabledforeground="#a3a3a3") self.Button6.configure(foreground="#000000") self.Button6.configure(highlightbackground="#d9d9d9") self.Button6.configure(highlightcolor="black") self.Button6.configure(pady="0") self.Button6.configure(text='''Show Graph''') self.Button6.configure(width=80) self.Button6.configure(command=self.clicked6) self.Button7 = tk.Button(self.TFrame1) self.Button7.place(relx=0.819, rely=0.649, height=24, width=80) self.Button7.configure(activebackground="#ececec") self.Button7.configure(activeforeground="#000000") self.Button7.configure(background="#d9d9d9") self.Button7.configure(disabledforeground="#a3a3a3") self.Button7.configure(foreground="#000000") self.Button7.configure(highlightbackground="#d9d9d9") self.Button7.configure(highlightcolor="black") self.Button7.configure(pady="0") self.Button7.configure(text='''Show Graph''') self.Button7.configure(command=self.clicked7) self.Button8 = tk.Button(self.TFrame1) self.Button8.place(relx=0.819, rely=0.753, height=14, width=80) self.Button8.configure(activebackground="#ececec") self.Button8.configure(activeforeground="#000000") self.Button8.configure(background="#d9d9d9") self.Button8.configure(disabledforeground="#a3a3a3") self.Button8.configure(foreground="#000000") self.Button8.configure(highlightbackground="#d9d9d9") self.Button8.configure(highlightcolor="black") self.Button8.configure(pady="0") self.Button8.configure(text='''Show Graph''') self.Button8.configure(width=80) self.Button8.configure(command=self.clicked8) self.Button9 = tk.Button(self.TFrame1) self.Button9.place(relx=0.819, rely=0.831, height=24, width=80) self.Button9.configure(activebackground="#ececec") self.Button9.configure(activeforeground="#000000") self.Button9.configure(background="#d9d9d9") self.Button9.configure(disabledforeground="#a3a3a3") self.Button9.configure(foreground="#000000") self.Button9.configure(highlightbackground="#d9d9d9") self.Button9.configure(highlightcolor="black") self.Button9.configure(pady="0") self.Button9.configure(text='''Show Graph''') self.Button9.configure(command=self.clicked9) self.Button10 = tk.Button(self.TFrame1) self.Button10.place(relx=0.819, rely=0.935, height=14, width=80) self.Button10.configure(activebackground="#ececec") self.Button10.configure(activeforeground="#000000") self.Button10.configure(background="#d9d9d9") self.Button10.configure(disabledforeground="#a3a3a3") self.Button10.configure(foreground="#000000") self.Button10.configure(highlightbackground="#d9d9d9") self.Button10.configure(highlightcolor="black") self.Button10.configure(pady="0") self.Button10.configure(text='''Show Graph''') self.Button10.configure(width=80) self.Button10.configure(command=self.clicked10) self.TSeparator1_4 = ttk.Separator(top) self.TSeparator1_4.place(relx=0.058, rely=0.378, relwidth=0.867) self.TSeparator1_7 = ttk.Separator(top) self.TSeparator1_7.place(relx=0.042, rely=0.6, relwidth=0.883) self.TSeparator1_8 = ttk.Separator(top) self.TSeparator1_8.place(relx=0.05, rely=0.689, relwidth=0.883) self.TSeparator1_9 = ttk.Separator(top) self.TSeparator1_9.place(relx=0.05, rely=0.756, relwidth=0.883) self.menubar = tk.Menu(top, font="TkMenuFont", bg=_bgcolor, fg=_fgcolor) top.configure(menu=self.menubar) self.TSeparator2 = ttk.Separator(top) self.TSeparator2.place(relx=0.133, rely=0.067, relheight=0.844) self.TSeparator2.configure(orient="vertical") self.TSeparator3 = ttk.Separator(top) self.TSeparator3.place(relx=0.05, rely=0.844, relwidth=0.883)
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("962x624+489+200") top.title("Nmap Finder") top.configure(highlightcolor="black") self.Button1 = tk.Button(top) self.Button1.place(relx=0.395, rely=0.224, height=31, width=72) self.Button1.configure(activebackground="#f9f9f9") self.Button1.configure(command=nmap_interface_support.nmap) self.Button1.configure(text='''Search''') self.Entry1 = tk.Entry(top) self.Entry1.place(relx=0.208, rely=0.144, height=23, relwidth=0.266) self.Entry1.configure(background="white") self.Entry1.configure(font="-family {DejaVu Sans Mono} -size 10") self.Entry1.configure(selectbackground="#c4c4c4") self.Scrolledtext1 = ScrolledText(top) self.Scrolledtext1.place(relx=0.052, rely=0.337, relheight=0.572, relwidth=0.902) self.Scrolledtext1.configure(background="white") self.Scrolledtext1.configure(font="-family {DejaVu Sans} -size 10") self.Scrolledtext1.configure(insertborderwidth="3") self.Scrolledtext1.configure(selectbackground="#c4c4c4") self.Scrolledtext1.configure(width=10) self.Scrolledtext1.configure(wrap="none") self.TSeparator1 = ttk.Separator(top) self.TSeparator1.place(relx=0.509, rely=0.08, relheight=0.208) self.TSeparator1.configure(orient="vertical") self.Label1 = tk.Label(top) self.Label1.place(relx=0.229, rely=0.032, height=21, width=117) self.Label1.configure(activebackground="#f9f9f9") self.Label1.configure(text='''Basic Nmap Scan''') self.TSeparator2 = ttk.Separator(top) self.TSeparator2.place(relx=0.052, rely=0.08, relwidth=0.457) self.TSeparator3 = ttk.Separator(top) self.TSeparator3.place(relx=0.509, rely=0.08, relwidth=0.437) self.Label2 = tk.Label(top) self.Label2.place(relx=0.083, rely=0.144, height=21, width=98) self.Label2.configure(activebackground="#f9f9f9") self.Label2.configure(text='''sudo nmap -A''') self.Label3 = tk.Label(top) self.Label3.place(relx=0.665, rely=0.032, height=21, width=120) self.Label3.configure(activebackground="#f9f9f9") self.Label3.configure(text='''Port Status Finder''') self.Label4 = tk.Label(top) self.Label4.place(relx=0.541, rely=0.112, height=21, width=70) self.Label4.configure(activebackground="#f9f9f9") self.Label4.configure(text='''Find port:''') self.Label5 = tk.Label(top) self.Label5.place(relx=0.541, rely=0.16, height=21, width=128) self.Label5.configure(activebackground="#f9f9f9") self.Label5.configure(text='''Find service name:''') self.Label6 = tk.Label(top) self.Label6.place(relx=0.541, rely=0.208, height=21, width=93) self.Label6.configure(activebackground="#f9f9f9") self.Label6.configure(text='''Find Protocol:''') self.Entry2 = tk.Entry(top) self.Entry2.place(relx=0.707, rely=0.112, height=23, relwidth=0.131) self.Entry2.configure(background="white") self.Entry2.configure(font="-family {DejaVu Sans Mono} -size 10") self.Entry2.configure(selectbackground="#c4c4c4") self.Entry2.configure(state='disabled') self.Entry3 = tk.Entry(top) self.Entry3.place(relx=0.707, rely=0.16, height=23, relwidth=0.131) self.Entry3.configure(background="white") self.Entry3.configure(font="-family {DejaVu Sans Mono} -size 10") self.Entry3.configure(selectbackground="#c4c4c4") self.Entry3.configure(state='disabled') self.Entry4 = tk.Entry(top) self.Entry4.place(relx=0.707, rely=0.208, height=23, relwidth=0.131) self.Entry4.configure(background="white") self.Entry4.configure(font="-family {DejaVu Sans Mono} -size 10") self.Entry4.configure(selectbackground="#c4c4c4") self.Entry4.configure(state='disabled') self.Button2 = tk.Button(top) self.Button2.place(relx=0.873, rely=0.112, height=25, width=46) self.Button2.configure(activebackground="#f9f9f9") self.Button2.configure(command=nmap_interface_support.port) self.Button2.configure(state='disabled') self.Button2.configure(text='''Go''') self.Button3 = tk.Button(top) self.Button3.place(relx=0.873, rely=0.16, height=25, width=46) self.Button3.configure(activebackground="#f9f9f9") self.Button3.configure(command=nmap_interface_support.service) self.Button3.configure(state='disabled') self.Button3.configure(text='''Go''') self.Button4 = tk.Button(top) self.Button4.place(relx=0.873, rely=0.208, height=25, width=46) self.Button4.configure(activebackground="#f9f9f9") self.Button4.configure(command=nmap_interface_support.protocol) self.Button4.configure(state='disabled') self.Button4.configure(text='''Go''') self.Button5 = tk.Button(top) self.Button5.place(relx=0.956, rely=0.016, height=25, width=25) self.Button5.configure(activebackground="#f9f9f9") self.Button5.configure(command=nmap_interface_support.boton) self.Button5.configure(text='''?''') self.Button6 = tk.Button(top) self.Button6.place(relx=0.904, rely=0.929, height=31, width=53) self.Button6.configure(activebackground="#f9f9f9") self.Button6.configure(command=nmap_interface_support.exit) self.Button6.configure(text='''Exit''') self.Button7 = tk.Button(top) self.Button7.place(relx=0.052, rely=0.929, height=31, width=62) self.Button7.configure(activebackground="#f9f9f9") self.Button7.configure(command=nmap_interface_support.clear) self.Button7.configure(text='''Clear''') self.Button8 = tk.Button(top) self.Button8.place(relx=0.541, rely=0.272, height=31, width=79) self.Button8.configure(activebackground="#f9f9f9") self.Button8.configure( command=nmap_interface_support.attackMedusaSimple) self.Button8.configure(text='''Medusa''') self.Label7 = tk.Label(top) self.Label7.place(relx=0.416, rely=0.97, height=17, width=137) self.Label7.configure(activebackground="#f9f9f9") self.Label7.configure(font="-family {DejaVu Sans} -size 8") self.Label7.configure(text='''Created by: Ivan & Kevin''') self.Button8_1 = tk.Button(top) self.Button8_1.place(relx=0.707, rely=0.272, height=31, width=207) self.Button8_1.configure(activebackground="#f9f9f9") self.Button8_1.configure( command=nmap_interface_support.attackMedusaCompo) self.Button8_1.configure(text='''Attack Range from Ports''') self.Button8_1.configure(width=207) self.Button9 = tk.Button(top) self.Button9.place(relx=0.052, rely=0.048, height=21, width=91) self.Button9.configure(command=nmap_interface_support.hardMode) self.Button9.configure(text='''Hard Mode''') self.Button9.configure(width=91)
schema = tk.StringVar() schema_lbl = tk.Label( load_data_frame, text="Files schema:", font=font_standard ) schema_lbl.grid( row=3, column=0, columnspan=2, sticky='E', padx=5, pady=5 ) schema_txt = tk.Entry( load_data_frame, width=40, font=font_standard, textvariable=schema ) schema_txt.grid(row=3, column=2, columnspan=10, sticky="WE", pady=5) sep_paths_classes = ttk.Separator(load_data_frame, orient=tk.HORIZONTAL) sep_paths_classes.grid(row=4, column=1, columnspan=9, sticky='EW', pady=10) # classes (contrasts) get ### # class_00 var_class_00 = tk.StringVar() constrast_00_lbl = tk.Label( load_data_frame, text="Class 00:", font=font_standard ) constrast_00_lbl.grid( row=5, column=0, columnspan=2, sticky='E', padx=5, pady=5 ) constast_00_txt = tk.Entry(
def __geometryManage(self, method, args=[], kwargs={}): # Windowz Mac #box margins 11 10-12 #button spacing 7 12 if self.__no_init: return if method not in ['grid','pack','place']: raise ValueError, "{!r} is not a valid method for ButtonGroup.__geometryManage()".format(method) method = ttk.Frame.grid if (method=='grid') else (ttk.Frame.pack if (method=='pack') else ttk.Frame.place) sects = dict(self.sections) for btyp,wdgt in self.__widgets.items(): if btyp == 'm': for i in wdgt: try: i.destroy() except: pass self.__widgets['m'] = [] else: if wdgt is not None: try: wdgt.destroy() except: pass self.__widgets[btyp] = None if self.__stretcher is not None: try: self.__stretcher.destroy() except: pass self.__stretcher = None widget_row = 1 col_itr = -1 widget_padx = int(self.button_padx/2.0) widget_pady = int(self.button_pady/2.0) #self.__widget_opts #self.__widgets if self.alignment&bJUSTIFIED: if bJUSTIFIED in sects: gridopts = {'row':widget_row,'padx':widget_padx,'pady':widget_pady,'sticky':'ns'} for btyp in sects[bJUSTIFIED]: if not self.__widget_opts[btyp]: continue if btyp == 'm': for opt in self.__widget_opts[btyp]: col_itr += 1 wdgt = ttk.Button(self,**opt) self.__widgets['m'].append(wdgt) wdgt.grid(column=col_itr,**gridopts) ttk.Frame.columnconfigure(self, col_itr, weight=1) else: col_itr += 1 wdgt = ttk.Button(self,**self.__widget_opts[btyp]) if self.default and self.default == btyp: try: wdgt.config(default=tk.ACTIVE) except: pass if self.binder and self.__widget_opts[btyp].get('command'): try: self.binder.bind("<Return>",self.__widget_opts[btyp].get('command')) except: pass if btyp == 'c' and self.binder and self.__widget_opts[btyp]: try: self.binder.bind("<Escape>",self.__widget_opts[btyp].get('command')) except: pass self.__widgets[btyp] = wdgt wdgt.grid(column=col_itr,**gridopts) ttk.Frame.columnconfigure(self, col_itr, weight=1) else: gridopts = {'row':widget_row,'padx':widget_padx,'pady':widget_pady,'sticky':'nsew'} for section in [bLEFT,bCENTER,bRIGHT]: #pre-mapping if not self.alignment§ion: if section == bLEFT: col_itr += 1 ttk.Frame.columnconfigure(self, col_itr, weight=1) continue #parsing for btyp in sects[section]: if not self.__widget_opts[btyp]: continue if btyp == 'm': for opt in self.__widget_opts[btyp]: col_itr += 1 wdgt = ttk.Button(self,**opt) self.__widgets['m'].append(wdgt) wdgt.grid(column=col_itr,**gridopts) ttk.Frame.columnconfigure(self, col_itr, weight=0) else: col_itr += 1 wdgt = ttk.Button(self,**self.__widget_opts[btyp]) if self.default and self.default == btyp: try: wdgt.config(default=tk.ACTIVE) except: pass #if self.binder and self.__widget_opts[btyp].get('command'): # try: # self.binder.bind("<Return>",self.__widget_opts[btyp].get('command')) # except: pass self.__widgets[btyp] = wdgt wdgt.grid(column=col_itr,**gridopts) ttk.Frame.columnconfigure(self, col_itr, weight=0) #post-mapping if section in [bLEFT,bCENTER]: col_itr += 1 ttk.Frame.columnconfigure(self,col_itr, weight=1) elif section in [bRIGHT]: ttk.Frame.columnconfigure(self, col_itr+1, weight=0) col_width = col_itr+1 self.__stretcher = ttk.Separator(self, orient=tk.HORIZONTAL) self.__stretcher.grid(row=int(not widget_row),column=0,columnspan=col_width,sticky='nesw') return method(self, *args, **kwargs)
def __init__(self, title): Tk.__init__(self) self.title(title) # self.geometry('{}x{}'.format(WIDTH, HEIGHT)) self.ideal_companies_csv = None self.test_companies_csv = None self.ideal_company_label = None self.non_ideal_company_label = None self.output_filename = None self.choose_ideal_companies_csv_lbl = ttk.Label( self, text="Choose Ideal Companies CSV File") self.choose_ideal_companies_csv_lbl.grid(row=0, column=0, padx=PAD_X, pady=PAD_Y) self.choose_ideal_companies_csv_btn = ttk.Button( self, text="Choose", command=lambda: self.choose_file( 'ideal_companies_csv', self.chosen_ideal_companies_csv_lbl, title="Choose Ideal Companies CSV File")) self.choose_ideal_companies_csv_btn.grid(row=0, column=1, padx=PAD_Y, pady=PAD_X) self.chosen_ideal_companies_csv_lbl = ttk.Label( self, text="<No File Selected>") self.chosen_ideal_companies_csv_lbl.grid(row=1, column=0, columnspan=2, padx=PAD_X, pady=PAD_Y) ttk.Separator(self).grid(row=2, column=0, columnspan=2, padx=PAD_X, pady=PAD_Y * 1.5, sticky="EW") self.choose_test_companies_csv_lbl = ttk.Label( self, text="Choose Test Companies CSV File") self.choose_test_companies_csv_lbl.grid(row=3, column=0, padx=PAD_X, pady=PAD_Y) self.choose_test_companies_csv_btn = ttk.Button( self, text="Choose", command=lambda: self.choose_file( 'test_companies_csv', self.chosen_test_companies_csv_lbl, title="Choose Non-Ideal Companies CSV File")) self.choose_test_companies_csv_btn.grid(row=3, column=1, padx=PAD_Y, pady=PAD_X) self.chosen_test_companies_csv_lbl = ttk.Label( self, text="<No File Selected>") self.chosen_test_companies_csv_lbl.grid(row=4, column=0, columnspan=2, padx=PAD_X, pady=PAD_Y) ttk.Separator(self).grid(row=5, column=0, columnspan=2, padx=PAD_X, pady=PAD_Y * 1.5, sticky="EW") self.ideal_company_label_lbl = ttk.Label( self, text="Enter Ideal Company Label") self.ideal_company_label_lbl.grid(row=6, column=0, padx=PAD_X, pady=PAD_Y) self.ideal_company_label_entry = ttk.Entry(self) self.ideal_company_label_entry.grid(row=6, column=1, padx=PAD_X, pady=PAD_Y) self.non_ideal_company_label_lbl = ttk.Label( self, text="Enter Non-ideal Company Label") self.non_ideal_company_label_lbl.grid(row=7, column=0, padx=PAD_X, pady=PAD_Y) self.non_ideal_company_label_entry = ttk.Entry(self) self.non_ideal_company_label_entry.grid(row=7, column=1, padx=PAD_X, pady=PAD_Y) self.output_filename_lbl = ttk.Label(self, text="Output File Name") self.output_filename_lbl.grid(row=8, column=0, padx=PAD_X, pady=PAD_Y) self.output_filename_entry = ttk.Entry(self) self.output_filename_entry.grid(row=8, column=1, padx=PAD_X, pady=PAD_Y) ttk.Separator(self).grid(row=9, column=0, columnspan=2, padx=PAD_X, pady=PAD_Y * 1.5, sticky="EW") self.run_btn = ttk.Button(self, text="Run", command=self.run_cosine_similarity) self.run_btn.grid(row=10, column=0, columnspan=2, padx=PAD_Y, pady=PAD_X, sticky="EW")
def init_user_interface(self, rowNum): #rowNum is just a temporary value so the UI knows which row has been chosen self.top = Toplevel(self.parent.root) self.top.geometry('1200x200') self.currRow = rowNum note = ttk.Notebook(self.top) noteFrame = ttk.Frame(note) note.add(noteFrame, text="Track Operations") note.pack(expand=1, fill="both") #note.pack(expand=1, fill="both") #tabControls.append(noteFrame) monty = ttk.LabelFrame(noteFrame, text="Track Operations") monty.grid(column=0, row=0, padx=8, pady=4) Label(monty, text="Settings").grid(row=0, column=self.clm()) Label(monty, text="Inst/Note").grid(row=0, column=self.clm()) self.txtInstrument = Entry(monty) self.txtInstrument.insert(END, str(self.inst_or_note)) self.txtInstrument.grid(row=0, column=self.clm()) Label(monty, text="Channel").grid(row=0, column=self.clm()) self.txtChannel = Entry(monty) self.txtChannel.insert(END, str(self.channel)) self.txtChannel.grid(row=0, column=self.clm()) Label(monty, text="Velocity").grid(row=0, column=self.clm()) self.txtVelocity = Entry(monty) self.txtVelocity.insert(END, str(self.velocity)) self.txtVelocity.grid(row=0, column=self.clm()) muteButton = Button(monty, text="Mute", command=self.btnMuteUnmute) muteButton.grid(row=0, column=self.clm()) self.clm0() #s = Separator(monty, orient=VERTICAL).grid(column=0, row=0, rowspan=10, sticky='ns') ttk.Separator(monty, orient='horizontal').grid(column=0, row=1, rowspan=10, sticky='ew') self.clm() Label(monty, text="Track").grid(row=2, column=self.clm()) copyButton = Button(monty, text="Copy", command=self.btnCopyTrack) copyButton.grid(row=2, column=self.clm()) pasteButton = Button(monty, text="Paste", command=self.btnPasteTrack) pasteButton.grid(row=2, column=self.clm()) duplicateButton = Button(monty, text="Duplicate", command=self.btnDuplicateTrackSection) duplicateButton.grid(row=2, column=self.clm()) transposeButton = Button(monty, text="Transpose", command=self.doPermanentTransposition) transposeButton.grid(row=2, column=self.clm()) self.transposeOffset = StringVar() self.transposeOffset.set('0') # set the default option transposeOffsetDropDown = OptionMenu(monty, self.transposeOffset, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) transposeOffsetDropDown.grid(row=2, column=self.clm()) deleteButton = Button(monty, text="Delete Notes", command=self.delNotes) deleteButton.grid(row=2, column=self.clm()) Label(monty, text="From").grid(row=2, column=self.clm()) self.defaultFrom = StringVar() self.defaultFrom.set('1') # set the default option fromDropDown = OptionMenu(monty, self.defaultFrom, 1, 4, 9, 13, 17, 21, 25, 29) fromDropDown.grid(row=2, column=self.clm()) Label(monty, text="To").grid(row=2, column=self.clm()) self.defaultTo = StringVar() self.defaultTo.set('32') # set the default option toDropDown = OptionMenu(monty, self.defaultTo, 4, 8, 12, 16, 20, 24, 28, 32) toDropDown.grid(row=2, column=self.clm()) self.clm0() b = Button(monty, text="OK", command=self.ok) b.grid(row=3, column=self.clm()) c = Button(monty, text="Cancel", command=self.cancel) c.grid(row=3, column=self.clm()) r = Button(monty, text="Record", command=self.recordPopup) r.grid(row=4, column=self.clm()) noteFrame2 = ttk.Frame(note) note.add(noteFrame2, text="Voice Chooser") note.pack(expand=1, fill="both") monty2 = ttk.LabelFrame(noteFrame2, text="Choose Voice") monty2.grid(column=0, row=0, padx=8, pady=4) colors = [] fcolors = [] for i in range(16): intcol = randint(0, 0xFFFFFF) c = '%06X' % intcol f = 0xFFFFFF - intcol colors.append(c) fcolors.append('%06X' % f) for i in range(4): for j in range(32): total = i * 32 + j col = "#" + str(colors[int(math.floor(total / 8))]) fcol = "#" + str(fcolors[int(math.floor(total / 8))]) btn = Button(monty2, text=str(total + 1), width=3, fg=fcol, bg=col, command=self.parent.playDemoInstrument(total)) btn.grid(column=j, row=i) igroupbasenum = int(math.floor(total / 8)) inststoshow = [] for q in range(total, total + 8): if q > 127: continue inststoshow.append( str(q + 1) + " " + self.instdetails_dict[str(q + 1)]) tip = ListboxToolTip(btn, inststoshow) noteFrame3 = ttk.Frame(note) note.add(noteFrame3, text="Drum Choose") note.pack(expand=1, fill="both") monty3 = ttk.LabelFrame(noteFrame3, text="Choose Voice") monty3.grid(column=0, row=0, padx=8, pady=4) print self.drumdetails_dict for i in range(35, 82, 6): for j in range(8): total = i + j col = "#" + str(colors[int(math.floor((total - 35) / 8))]) fcol = "#" + str(fcolors[int(math.floor((total - 35) / 8))]) caption = str(total + 1) + ":" + self.drumdetails_dict[str(total)] print caption btn = Button(monty3, text=caption, width=15, fg="black", bg="white", command=self.parent.playDemoDrum(total)) roe = (total - 35) / 8 btn.grid(column=j, row=roe)
def __init__(self, parent, callback): tk.Toplevel.__init__(self, parent) self.parent = parent self.callback = callback self.title(platform == 'darwin' and _('Preferences') or _('Settings')) if parent.winfo_viewable(): self.transient(parent) # position over parent if platform != 'darwin' or parent.winfo_rooty( ) > 0: # http://core.tcl.tk/tk/tktview/c84f660833546b1b84e7 self.geometry("+%d+%d" % (parent.winfo_rootx(), parent.winfo_rooty())) # remove decoration if platform == 'win32': self.attributes('-toolwindow', tk.TRUE) elif platform == 'darwin': # http://wiki.tcl.tk/13428 parent.call('tk::unsupported::MacWindowStyle', 'style', self, 'utility') self.resizable(tk.FALSE, tk.FALSE) self.cmdr = False # Note if Cmdr changes in the Journal self.is_beta = False # Note if Beta status changes in the Journal self.cmdrchanged_alarm = None frame = ttk.Frame(self) frame.grid(sticky=tk.NSEW) notebook = nb.Notebook(frame) notebook.bind('<<NotebookTabChanged>>', self.tabchanged) # Recompute on tab change PADX = 10 BUTTONX = 12 # indent Checkbuttons and Radiobuttons PADY = 2 # close spacing outframe = nb.Frame(notebook) outframe.columnconfigure(0, weight=1) output = config.getint('output') or config.OUT_SHIP # default settings self.out_label = nb.Label(outframe, text=_('Please choose what data to save')) self.out_label.grid(columnspan=2, padx=PADX, sticky=tk.W) self.out_csv = tk.IntVar(value=(output & config.OUT_MKT_CSV) and 1) self.out_csv_button = nb.Checkbutton( outframe, text=_('Market data in CSV format file'), variable=self.out_csv, command=self.outvarchanged) self.out_csv_button.grid(columnspan=2, padx=BUTTONX, sticky=tk.W) self.out_td = tk.IntVar(value=(output & config.OUT_MKT_TD) and 1) self.out_td_button = nb.Checkbutton( outframe, text=_('Market data in Trade Dangerous format file'), variable=self.out_td, command=self.outvarchanged) self.out_td_button.grid(columnspan=2, padx=BUTTONX, sticky=tk.W) self.out_ship = tk.IntVar(value=(output & config.OUT_SHIP and 1)) self.out_ship_button = nb.Checkbutton( outframe, text=_('Ship loadout'), variable=self.out_ship, command=self.outvarchanged) # Output setting self.out_ship_button.grid(columnspan=2, padx=BUTTONX, pady=(5, 0), sticky=tk.W) self.out_auto = tk.IntVar(value=0 if output & config.OUT_MKT_MANUAL else 1) # inverted self.out_auto_button = nb.Checkbutton( outframe, text=_('Automatically update on docking'), variable=self.out_auto, command=self.outvarchanged) # Output setting self.out_auto_button.grid(columnspan=2, padx=BUTTONX, pady=(5, 0), sticky=tk.W) self.outdir = tk.StringVar() self.outdir.set(config.get('outdir')) self.outdir_label = nb.Label(outframe, text=_('File location') + ':') # Section heading in settings self.outdir_label.grid(padx=PADX, pady=(5, 0), sticky=tk.W) self.outdir_entry = nb.Entry(outframe, takefocus=False) self.outdir_entry.grid(columnspan=2, padx=PADX, pady=(0, PADY), sticky=tk.EW) self.outbutton = nb.Button( outframe, text=( platform == 'darwin' and _('Change...') or # Folder selection button on OSX _('Browse...')), # Folder selection button on Windows command=lambda: self.filebrowse(_('File location'), self.outdir)) self.outbutton.grid(column=1, padx=PADX, pady=PADY, sticky=tk.NSEW) nb.Frame(outframe).grid(pady=5) # bottom spacer notebook.add(outframe, text=_('Output')) # Tab heading in settings # build plugin prefs tabs for plugin in plug.PLUGINS: plugframe = plugin.get_prefs(notebook, monitor.cmdr, monitor.is_beta) if plugframe: notebook.add(plugframe, text=plugin.name) configframe = nb.Frame(notebook) configframe.columnconfigure(1, weight=1) self.logdir = tk.StringVar() self.logdir.set( config.get('journaldir') or config.default_journal_dir or '') self.logdir_entry = nb.Entry(configframe, takefocus=False) nb.Label(configframe, text=_('E:D journal file location') + ':').grid( columnspan=4, padx=PADX, sticky=tk.W) # Location of the new Journal file in E:D 2.2 self.logdir_entry.grid(columnspan=4, padx=PADX, pady=(0, PADY), sticky=tk.EW) self.logbutton = nb.Button( configframe, text=( platform == 'darwin' and _('Change...') or # Folder selection button on OSX _('Browse...')), # Folder selection button on Windows command=lambda: self.filebrowse(_('E:D journal file location'), self.logdir)) self.logbutton.grid(row=10, column=3, padx=PADX, pady=PADY, sticky=tk.EW) if config.default_journal_dir: nb.Button( configframe, text=_('Default'), command=self.logdir_reset, state=config.get('journaldir') and tk.NORMAL or tk.DISABLED).grid( row=10, column=2, pady=PADY, sticky=tk.EW) # Appearance theme and language setting if platform in ['darwin', 'win32']: ttk.Separator(configframe, orient=tk.HORIZONTAL).grid(columnspan=4, padx=PADX, pady=PADY * 4, sticky=tk.EW) self.hotkey_code = config.getint('hotkey_code') self.hotkey_mods = config.getint('hotkey_mods') self.hotkey_only = tk.IntVar( value=not config.getint('hotkey_always')) self.hotkey_play = tk.IntVar( value=not config.getint('hotkey_mute')) nb.Label( configframe, text=platform == 'darwin' and _('Keyboard shortcut') or # Hotkey/Shortcut settings prompt on OSX _('Hotkey') # Hotkey/Shortcut settings prompt on Windows ).grid(row=20, padx=PADX, sticky=tk.W) if platform == 'darwin' and not was_accessible_at_launch: if AXIsProcessTrusted(): nb.Label( configframe, text=_('Re-start {APP} to use shortcuts').format( APP=applongname), foreground='firebrick').grid( padx=PADX, sticky=tk.W) # Shortcut settings prompt on OSX else: nb.Label( configframe, text=_('{APP} needs permission to use shortcuts' ).format(APP=applongname), foreground='firebrick').grid( columnspan=4, padx=PADX, sticky=tk.W) # Shortcut settings prompt on OSX nb.Button( configframe, text=_('Open System Preferences'), command=self.enableshortcuts).grid( padx=PADX, sticky=tk.E) # Shortcut settings button on OSX else: self.hotkey_text = nb.Entry(configframe, width=(platform == 'darwin' and 20 or 30), justify=tk.CENTER) self.hotkey_text.insert( 0, self.hotkey_code and hotkeymgr.display(self.hotkey_code, self.hotkey_mods) or _('None')) # No hotkey/shortcut currently defined self.hotkey_text.bind('<FocusIn>', self.hotkeystart) self.hotkey_text.bind('<FocusOut>', self.hotkeyend) self.hotkey_text.grid(row=20, column=1, columnspan=2, pady=(5, 0), sticky=tk.W) self.hotkey_only_btn = nb.Checkbutton( configframe, text=_('Only when Elite: Dangerous is the active app'), variable=self.hotkey_only, state=self.hotkey_code and tk.NORMAL or tk.DISABLED) # Hotkey/Shortcut setting self.hotkey_only_btn.grid(columnspan=4, padx=PADX, pady=(5, 0), sticky=tk.W) self.hotkey_play_btn = nb.Checkbutton( configframe, text=_('Play sound'), variable=self.hotkey_play, state=self.hotkey_code and tk.NORMAL or tk.DISABLED) # Hotkey/Shortcut setting self.hotkey_play_btn.grid(columnspan=4, padx=PADX, sticky=tk.W) # Option to disabled Automatic Check For Updates whilst in-game ttk.Separator(configframe, orient=tk.HORIZONTAL).grid(columnspan=4, padx=PADX, pady=PADY * 4, sticky=tk.EW) self.disable_autoappupdatecheckingame = tk.IntVar( value=config.getint('disable_autoappupdatecheckingame')) self.disable_autoappupdatecheckingame_btn = nb.Checkbutton( configframe, text=_('Disable Automatic Application Updates Check when in-game'), variable=self.disable_autoappupdatecheckingame, command=self.disable_autoappupdatecheckingame_changed) self.disable_autoappupdatecheckingame_btn.grid(columnspan=4, padx=PADX, sticky=tk.W) ttk.Separator(configframe, orient=tk.HORIZONTAL).grid(columnspan=4, padx=PADX, pady=PADY * 4, sticky=tk.EW) nb.Label(configframe, text=_('Preferred websites')).grid( row=30, columnspan=4, padx=PADX, sticky=tk.W ) # Settings prompt for preferred ship loadout, system and station info websites self.shipyard_provider = tk.StringVar( value=config.get('shipyard_provider') in plug.provides( 'shipyard_url') and config.get('shipyard_provider') or 'EDSY') nb.Label(configframe, text=_('Shipyard')).grid( row=31, padx=PADX, pady=2 * PADY, sticky=tk.W ) # Setting to decide which ship outfitting website to link to - either E:D Shipyard or Coriolis self.shipyard_button = nb.OptionMenu(configframe, self.shipyard_provider, self.shipyard_provider.get(), *plug.provides('shipyard_url')) self.shipyard_button.configure(width=15) self.shipyard_button.grid(row=31, column=1, sticky=tk.W) self.system_provider = tk.StringVar( value=config.get('system_provider') in plug.provides('system_url') and config.get('system_provider') or 'EDSM') nb.Label(configframe, text=_('System')).grid(row=32, padx=PADX, pady=2 * PADY, sticky=tk.W) self.system_button = nb.OptionMenu(configframe, self.system_provider, self.system_provider.get(), *plug.provides('system_url')) self.system_button.configure(width=15) self.system_button.grid(row=32, column=1, sticky=tk.W) self.station_provider = tk.StringVar( value=config.get('station_provider') in plug.provides( 'station_url') and config.get('station_provider') or 'eddb') nb.Label(configframe, text=_('Station')).grid(row=33, padx=PADX, pady=2 * PADY, sticky=tk.W) self.station_button = nb.OptionMenu(configframe, self.station_provider, self.station_provider.get(), *plug.provides('station_url')) self.station_button.configure(width=15) self.station_button.grid(row=33, column=1, sticky=tk.W) nb.Label(configframe).grid(sticky=tk.W) # big spacer notebook.add(configframe, text=_('Configuration')) # Tab heading in settings self.languages = Translations.available_names() self.lang = tk.StringVar(value=self.languages.get( config.get('language'), _('Default'))) # Appearance theme and language setting self.always_ontop = tk.BooleanVar(value=config.getint('always_ontop')) self.theme = tk.IntVar(value=config.getint('theme')) self.theme_colors = [ config.get('dark_text'), config.get('dark_highlight') ] self.theme_prompts = [ _('Normal text'), # Dark theme color setting _('Highlighted text'), # Dark theme color setting ] themeframe = nb.Frame(notebook) themeframe.columnconfigure(2, weight=1) nb.Label(themeframe, text=_('Language')).grid( row=10, padx=PADX, sticky=tk.W) # Appearance setting prompt self.lang_button = nb.OptionMenu(themeframe, self.lang, self.lang.get(), *self.languages.values()) self.lang_button.grid(row=10, column=1, columnspan=2, padx=PADX, sticky=tk.W) ttk.Separator(themeframe, orient=tk.HORIZONTAL).grid(columnspan=3, padx=PADX, pady=PADY * 4, sticky=tk.EW) nb.Label(themeframe, text=_('Theme')).grid(columnspan=3, padx=PADX, sticky=tk.W) # Appearance setting nb.Radiobutton( themeframe, text=_('Default'), variable=self.theme, value=0, command=self.themevarchanged).grid( columnspan=3, padx=BUTTONX, sticky=tk.W) # Appearance theme and language setting nb.Radiobutton(themeframe, text=_('Dark'), variable=self.theme, value=1, command=self.themevarchanged).grid( columnspan=3, padx=BUTTONX, sticky=tk.W) # Appearance theme setting if platform == 'win32': nb.Radiobutton(themeframe, text=_('Transparent'), variable=self.theme, value=2, command=self.themevarchanged).grid( columnspan=3, padx=BUTTONX, sticky=tk.W) # Appearance theme setting self.theme_label_0 = nb.Label(themeframe, text=self.theme_prompts[0]) self.theme_label_0.grid(row=20, padx=PADX, sticky=tk.W) self.theme_button_0 = nb.ColoredButton( themeframe, text=_('Station'), background='grey4', command=lambda: self.themecolorbrowse(0)) # Main window self.theme_button_0.grid(row=20, column=1, padx=PADX, pady=PADY, sticky=tk.NSEW) self.theme_label_1 = nb.Label(themeframe, text=self.theme_prompts[1]) self.theme_label_1.grid(row=21, padx=PADX, sticky=tk.W) self.theme_button_1 = nb.ColoredButton( themeframe, text=' Hutton Orbital ', background='grey4', command=lambda: self.themecolorbrowse(1)) # Do not translate self.theme_button_1.grid(row=21, column=1, padx=PADX, pady=PADY, sticky=tk.NSEW) ttk.Separator(themeframe, orient=tk.HORIZONTAL).grid(columnspan=3, padx=PADX, pady=PADY * 4, sticky=tk.EW) self.ontop_button = nb.Checkbutton(themeframe, text=_('Always on top'), variable=self.always_ontop, command=self.themevarchanged) self.ontop_button.grid(columnspan=3, padx=BUTTONX, sticky=tk.W) # Appearance setting nb.Label(themeframe).grid(sticky=tk.W) # big spacer notebook.add(themeframe, text=_('Appearance')) # Tab heading in settings # Plugin settings and info plugsframe = nb.Frame(notebook) plugsframe.columnconfigure(0, weight=1) plugdir = tk.StringVar() plugdir.set(config.plugin_dir) nb.Label(plugsframe, text=_('Plugins folder') + ':').grid( padx=PADX, sticky=tk.W) # Section heading in settings plugdirentry = nb.Entry(plugsframe, justify=tk.LEFT) self.displaypath(plugdir, plugdirentry) plugdirentry.grid(row=10, padx=PADX, sticky=tk.EW) nb.Button( plugsframe, text=_('Open'), # Button that opens a folder in Explorer/Finder command=lambda: webbrowser.open('file:///%s' % plugdir.get()) ).grid(row=10, column=1, padx=(0, PADX), sticky=tk.NSEW) nb.Label( plugsframe, text= _("Tip: You can disable a plugin by{CR}adding '{EXT}' to its folder name" ).format(EXT='.disabled')).grid( # Help text in settings columnspan=2, padx=PADX, pady=10, sticky=tk.NSEW) enabled_plugins = [x for x in plug.PLUGINS if x.folder and x.module] if len(enabled_plugins): ttk.Separator(plugsframe, orient=tk.HORIZONTAL).grid(columnspan=3, padx=PADX, pady=PADY * 8, sticky=tk.EW) nb.Label(plugsframe, text=_('Enabled Plugins') + ':').grid( padx=PADX, sticky=tk.W) # List of plugins in settings for plugin in enabled_plugins: if plugin.name == plugin.folder: label = nb.Label(plugsframe, text=plugin.name) else: label = nb.Label(plugsframe, text='%s (%s)' % (plugin.folder, plugin.name)) label.grid(columnspan=2, padx=PADX * 2, sticky=tk.W) ############################################################ # Show which plugins don't have Python 3.x support ############################################################ if len(plug.PLUGINS_not_py3): ttk.Separator(plugsframe, orient=tk.HORIZONTAL).grid(columnspan=3, padx=PADX, pady=PADY * 8, sticky=tk.EW) nb.Label(plugsframe, text=_('Plugins Without Python 3.x Support:') + ':').grid( padx=PADX, sticky=tk.W) for plugin in plug.PLUGINS_not_py3: if plugin.folder: # 'system' ones have this set to None to suppress listing in Plugins prefs tab nb.Label(plugsframe, text=plugin.name).grid(columnspan=2, padx=PADX * 2, sticky=tk.W) HyperlinkLabel( plugsframe, text=_('Information on migrating plugins'), background=nb.Label().cget('background'), url= 'https://github.com/EDCD/EDMarketConnector/blob/master/PLUGINS.md#migration-to-python-37', underline=True).grid(columnspan=2, padx=PADX, sticky=tk.W) ############################################################ disabled_plugins = [ x for x in plug.PLUGINS if x.folder and not x.module ] if len(disabled_plugins): ttk.Separator(plugsframe, orient=tk.HORIZONTAL).grid(columnspan=3, padx=PADX, pady=PADY * 8, sticky=tk.EW) nb.Label(plugsframe, text=_('Disabled Plugins') + ':').grid( padx=PADX, sticky=tk.W) # List of plugins in settings for plugin in disabled_plugins: nb.Label(plugsframe, text=plugin.name).grid(columnspan=2, padx=PADX * 2, sticky=tk.W) notebook.add(plugsframe, text=_('Plugins')) # Tab heading in settings if platform == 'darwin': self.protocol("WM_DELETE_WINDOW", self.apply) # close button applies changes else: buttonframe = ttk.Frame(frame) buttonframe.grid(padx=PADX, pady=PADX, sticky=tk.NSEW) buttonframe.columnconfigure(0, weight=1) ttk.Label(buttonframe).grid(row=0, column=0) # spacer button = ttk.Button(buttonframe, text=_('OK'), command=self.apply) button.grid(row=0, column=1, sticky=tk.E) button.bind("<Return>", lambda event: self.apply()) self.protocol("WM_DELETE_WINDOW", self._destroy) # Selectively disable buttons depending on output settings self.cmdrchanged() self.themevarchanged() # disable hotkey for the duration hotkeymgr.unregister() # wait for window to appear on screen before calling grab_set self.parent.update_idletasks() self.parent.wm_attributes( '-topmost', 0) # needed for dialog to appear ontop of parent on OSX & Linux self.wait_visibility() self.grab_set() # Ensure fully on-screen if platform == 'win32' and CalculatePopupWindowPosition: position = RECT() GetWindowRect(GetParent(self.winfo_id()), position) if CalculatePopupWindowPosition( POINT(parent.winfo_rootx(), parent.winfo_rooty()), SIZE(position.right - position.left, position.bottom - position.top), 0x10000, None, position): self.geometry("+%d+%d" % (position.left, position.top))
def plugin_prefs(parent): PADX = 5 frame = nb.Frame(parent) frame.columnconfigure(0, weight=1) nb.Checkbutton( frame, variable=this.edsmBodyCheck, text="Display number of bodies known to EDSM in current system").grid( padx=PADX, sticky=tk.W) # enable projects ttk.Separator(frame, orient=tk.HORIZONTAL).grid(padx=PADX * 2, pady=8, sticky=tk.EW) nb.Label(frame, text="Please choose which projects to enable").grid(padx=PADX, sticky=tk.W) for rseProject in this.rseData.projectsDict.values(): invertedFlag = not (this.rseData.ignoredProjectsFlags & rseProject.projectId == rseProject.projectId) variable = this.ignoredProjectsCheckboxes.setdefault( rseProject.projectId, tk.BooleanVar(value=invertedFlag)) text = rseProject.name if not rseProject.enabled: text += " (globally disabled)" nb.Checkbutton(frame, variable=variable, text=text).grid(padx=PADX, sticky=tk.W) nb.Label(frame, text=rseProject.explanation).grid(padx=PADX * 4, sticky=tk.W) # overwrite disabled state when EDDN/EDSM is off in EDMC ttk.Separator(frame, orient=tk.HORIZONTAL).grid(padx=PADX * 2, pady=8, sticky=tk.EW) nb.Checkbutton(frame, variable=this.clipboard, text="Copy system name to clipboard after jump").grid( padx=PADX, sticky=tk.W) nb.Checkbutton( frame, variable=this.overwrite, text="I use another tool to transmit data to EDSM/EDDN").grid( padx=PADX, sticky=tk.W) # clear caches ttk.Separator(frame, orient=tk.HORIZONTAL).grid(padx=PADX * 2, pady=8, sticky=tk.EW) nb.Label(frame, text="Clear caches").grid(padx=PADX, sticky=tk.W) clearCachesFrame = nb.Frame(frame) clearCachesFrame.grid(padx=PADX * 2, pady=8, sticky=tk.EW) frame.columnconfigure(2, weight=1) nb.Button(clearCachesFrame, text="Fully scanned systems", command=lambda: clearScannedSystemsCacheCallback(RseData.CACHE_FULLY_SCANNED_BODIES, "fully scanned systems"))\ .grid(padx=PADX, sticky=tk.W, row=0, column=0) nb.Button(clearCachesFrame, text="Ignored systems", command=lambda: clearScannedSystemsCacheCallback(RseData.CACHE_IGNORED_SYSTEMS, "ignored systems")) \ .grid(padx=PADX, sticky=tk.W, row=0, column=1) # links ttk.Separator(frame, orient=tk.HORIZONTAL).grid(padx=PADX * 2, pady=8, sticky=tk.EW) nb.Label(frame, text="Plugin Version: {}".format(RseData.VERSION)).grid( padx=PADX, sticky=tk.W) HyperlinkLabel(frame, text="Open the Github page for this plugin", background=nb.Label().cget("background"), url="https://github.com/Thurion/EDSM-RSE-for-EDMC", underline=True).grid(padx=PADX, sticky=tk.W) HyperlinkLabel(frame, text="A big thanks to EDTS for providing the coordinates.", background=nb.Label().cget("background"), url="http://edts.thargoid.space/", underline=True).grid(padx=PADX, sticky=tk.W) return frame
def __init__(self, *args, **kwargs): Page.__init__(self, *args, **kwargs) # --------------------------------------------- # TG # --------------------------------------------- self.tg_label = tk.Label(self, text="Task Graph Type:") self.available_tgs = [ 'RandomDependent', 'RandomIndependent', 'Manual', 'FromDOTFile' ] self.tg_type = tk.StringVar(self) self.tg_type.set('RandomDependent') self.tg_type_option = tk.OptionMenu(self, self.tg_type, *self.available_tgs, command=self._tg_type_cont) self.tg_type_option.config(width=self.option_menu_width) self.num_of_tasks_label = tk.Label(self, text="Number of Tasks:") self.num_of_tasks = tk.Entry(self, width=self.entry_width) self.num_of_crit_tasks_label = tk.Label( self, text="Number of Critical Tasks:") self.num_of_crit_tasks = tk.Entry(self, width=self.entry_width) self.num_of_edge_label = tk.Label(self, text="Number TG Edges:") self.num_of_edge = tk.Entry(self, width=self.entry_width) self.wcet_range_label = tk.Label(self, text="WCET Range:") self.wcet_range = tk.Entry(self, width=self.entry_width) self.edge_weight_range_label = tk.Label(self, text="Edge Weight Range:") self.edge_weight_range = tk.Entry(self, width=self.entry_width) self.release_range_label = tk.Label(self, text="Task Release Range:") self.release_range = tk.Entry(self, width=self.entry_width) self.tg_browse = tk.Entry(self, bg='gray') self.tg_browse.insert(0, "TG File Path...") self.tg_browse_button = tk.Button(self, text="Browse", command=self._get_tg_file) tk.Label(self, text="Task Graph Settings", font="-weight bold").grid(column=self.tg_starting_col, row=self.tg_starting_row, columnspan=2) self.tg_label.grid(column=self.tg_starting_col, row=self.tg_starting_row + 1, sticky='w') self.tg_type_option.grid(column=self.tg_starting_col + 1, row=self.tg_starting_row + 1, sticky='w') self.num_of_tasks_label.grid(column=self.tg_starting_col, row=self.tg_starting_row + 2, sticky='w') self.num_of_tasks.grid(column=self.tg_starting_col + 1, row=self.tg_starting_row + 2, sticky='w') self.num_of_tasks.insert(0, '35') self.num_of_crit_tasks_label.grid(column=self.tg_starting_col, row=self.tg_starting_row + 3, sticky='w') self.num_of_crit_tasks.grid(column=self.tg_starting_col + 1, row=self.tg_starting_row + 3, sticky='w') self.num_of_crit_tasks.insert(0, '0') self.num_of_edge_label.grid(column=self.tg_starting_col, row=self.tg_starting_row + 4, sticky='w') self.num_of_edge.grid(column=self.tg_starting_col + 1, row=self.tg_starting_row + 4, sticky='w') self.num_of_edge.insert(0, '20') self.wcet_range_label.grid(column=self.tg_starting_col, row=self.tg_starting_row + 5, sticky='w') self.wcet_range.grid(column=self.tg_starting_col + 1, row=self.tg_starting_row + 5, sticky='w') self.wcet_range.insert(0, '15') self.edge_weight_range_label.grid(column=self.tg_starting_col, row=self.tg_starting_row + 6, sticky='w') self.edge_weight_range.grid(column=self.tg_starting_col + 1, row=self.tg_starting_row + 6, sticky='w') self.edge_weight_range.insert(0, '7') self.release_range_label.grid(column=self.tg_starting_col, row=self.tg_starting_row + 7, sticky='w') self.release_range.grid(column=self.tg_starting_col + 1, row=self.tg_starting_row + 7, sticky='w') self.release_range.insert(0, '5') ttk.Separator(self, orient='vertical').grid(column=self.tg_starting_col + 3, row=self.tg_starting_row, rowspan=12, sticky="ns") # --------------------------------------------- # Clustering # --------------------------------------------- self.clustering_opt_var = tk.BooleanVar(self) self.clustering_opt_enable = tk.Checkbutton( self, text="Clustering Optimization", variable=self.clustering_opt_var, command=self._clustering_cont) self.clustering_iter_label = tk.Label(self, text="Clustering Iterations:") self.clustering_iterations = tk.Entry(self, width=self.entry_width) self.clustering_cost_label = tk.Label(self, text="Cost Function Type:") available_costs = [ 'SD', 'SD+MAX', 'MAX', 'SUMCOM', 'AVGUTIL', 'MAXCOM' ] self.clustering_cost = tk.StringVar(self) self.clustering_cost.set('SD+MAX') self.clustering_costOpt = tk.OptionMenu(self, self.clustering_cost, *available_costs) self.clustering_costOpt.config(width=self.option_menu_width) tk.Label(self, text="Clustering Settings", font="-weight bold").grid(column=self.cl_opt_start_col, row=self.cl_opt_start_row, columnspan=2) self.clustering_opt_var.set('False') self.clustering_iterations.insert(0, '1000') self.clustering_opt_enable.grid(column=self.cl_opt_start_col, row=self.cl_opt_start_row + 1)
note.add(tab3, text='Setup') note.add(tab4, text='Help') note.add(tab5, text='About') note.pack() #tab1 The Patient details #Name forenameval = StringVar() ttkforenameval = ttk.Entry(tab1, textvariable=forenameval).grid(column=1, row=0) forenameLabel=ttk.Label(tab1, text="Forename").grid(column=0, row=0) surnameval = Tkinter.StringVar() ttksurnameval = ttk.Entry(tab1, textvariable=surnameval).grid(column=1, row=1) surnameLabel=ttk.Label(tab1, text="Surname").grid(column=0, row=1) s1=ttk.Separator(tab1, orient=HORIZONTAL).grid(row=2, columnspan=3, stick="ew", pady=5, padx=5) #gender details genderlabel=ttk.Label(tab1, text="Gender").grid(column=0, row=3) genderval=StringVar() genderMale=ttk.Radiobutton(tab1, text='Male', variable=genderval, value='M').grid(column=1,row=3) genderFemale=ttk.Radiobutton(tab1, text='Female', variable=genderval, value='F').grid(column=2,row=3) s2=ttk.Separator(tab1, orient=HORIZONTAL).grid(row=4, columnspan=3, stick="ew", pady=5, padx=5) dateofbirthlabel=ttk.Label(tab1, text="Date of Birth").grid(column=0, row=5) dateofbirthlabelD=ttk.Label(tab1, text="Day").grid(column=0, row=6) dateofbirthD=StringVar() ttkdateofbirthD = Spinbox(tab1,from_=1.0, to=31, textvariable=dateofbirthD).grid(column=1, row=6) dateofbirthlabelM=ttk.Label(tab1, text="Month").grid(column=0, row=7) dateofbirthM=StringVar()
#l.bind("<B1-Motion>", OnMotion) text = "Hello" text = StringVar() #c = Canvas(root, width = 100, height = 30, background = "#E4E4E4") #id = c.create_text(focus = 'normal', text = text) #c.grid(row = 0, columnspan = 3) lbl = ttk.Label(root, text = "", background = "#E4E4E4") lbl.grid(row = 0, columnspan = 3, sticky = 'e', padx = 1) update_clock() seph = ttk.Separator(root, orient='horizontal', ) # sep.pack(side = BOTTOM)e seph.grid(row=1, column=0, sticky='n,w,e,s', columnspan=4, ipadx=1, ipady=1, padx=1, pady=1) #=============================This is for our calculator=============================== Cal_cu = StringVar() calus = ttk.LabelFrame(root, text = "", height = 208, width = 10, labelanchor = "n", relief = "sunken", takefocus = 1) calus.grid(sticky='n,w,e,s', row = 2, columnspan = 4, column = 0, padx = 5, pady = 10) text_Input = StringVar() mal_Input = StringVar() operator = "" current_operator = None history = ("")
def __init__(self, master): Frame.__init__(self, master, background="#00629B") self.grid(row = 0, column = 0) self.speed = 0 self.button0 = Button(self, text="Stop", width=15, highlightbackground="#f00", bg="red") self.button0.grid(row = 1, column = 1, padx=(10, 0), pady=(10, 0)) self.button0.bind("<ButtonRelease>", self.stop) self.button1 = Button(self, text="Forward", width=15, highlightbackground="#00629B") self.button1.grid(row = 0, column = 1, padx=(10, 0), pady=(10, 0)) self.button1.bind("<ButtonPress>", self.forward) self.button1.bind("<ButtonRelease>", self.stop) self.button2 = Button(self, text="Forward Right", width=15, highlightbackground="#00629B") self.button2.grid(row = 0, column = 2, padx=(10, 10), pady=(10, 0)) self.button2.bind("<ButtonPress>", self.forwardRight) self.button2.bind("<ButtonRelease>", self.stop) self.button3 = Button(self, text="Right", width=15, highlightbackground="#00629B") self.button3.grid(row = 1, column = 2, padx=(10, 10), pady=(10, 0)) self.button3.bind("<ButtonPress>", self.right) self.button3.bind("<ButtonRelease>", self.stop) self.button4 = Button(self, text="Backward Right", width=15, highlightbackground="#00629B") self.button4.grid(row = 2, column = 2, padx=(10, 10), pady=(10, 0)) self.button4.bind("<ButtonPress>", self.backwardRight) self.button4.bind("<ButtonRelease>", self.stop) self.button5 = Button(self, text="Backward", width=15, highlightbackground="#00629B") self.button5.grid(row = 2, column = 1, padx=(10, 0), pady=(10, 0)) self.button5.bind("<ButtonPress>", self.backward) self.button5.bind("<ButtonRelease>", self.stop) self.button6 = Button(self, text="Backward Left", width=15, highlightbackground="#00629B") self.button6.grid(row = 2, column = 0, padx=(10, 0), pady=(10, 0)) self.button6.bind("<ButtonPress>", self.backwardLeft) self.button6.bind("<ButtonRelease>", self.stop) self.button7 = Button(self, text="Left", width=15, highlightbackground="#00629B") self.button7.grid(row = 1, column = 0, padx=(10, 0), pady=(10, 0)) self.button7.bind("<ButtonPress>", self.left) self.button7.bind("<ButtonRelease>", self.stop) self.button8 = Button(self, text="Forward Left", width=15, highlightbackground="#00629B") self.button8.grid(row = 0, column = 0, padx=(10, 0), pady=(10, 0)) self.button8.bind("<ButtonPress>", self.forwardLeft) self.button8.bind("<ButtonRelease>", self.stop) self.separator0 = ttk.Separator(self, orient="horizontal") self.separator0.grid(row = 3, column = 0) self.button9 = Button(self, text="Clockwise", width=15, highlightbackground="#00629B") self.button9.grid(row = 4, column = 0, padx=(10, 0), pady=(10, 0)) self.button9.bind("<ButtonPress>", self.clockwise) self.button9.bind("<ButtonRelease>", self.stop) self.button10 = Button(self, text="Counter Clockwise", width=15, highlightbackground="#00629B") self.button10.grid(row = 4, column = 1, padx=(10, 0), pady=(10, 0)) self.button10.bind("<ButtonPress>", self.counterClockwise) self.button10.bind("<ButtonRelease>", self.stop) self.entry0 = Entry(self, text="Speed", width=15, highlightbackground="#00629B") self.entry0.grid(row = 6, column = 0, padx=(10, 0), pady=(10, 0)) self.button11 = Button(self, text="Speed", width=15, highlightbackground="#00629B") self.button11.grid(row = 6, column = 1, padx=(10, 0), pady=(10, 0)) self.button11["command"] = self.speedInput self.text = Text(self, width=60, height=6) self.vsb = Scrollbar(self, command=self.text.yview) self.text.configure(yscrollcommand=self.vsb.set) #self.vsb.pack(side="right", fill="y") self.text.grid(row = 7, columnspan=3, padx=(10, 10), pady=(10, 10))