def addworksheet(self, options, default=None): """ Adds a new Worksheet frame Adds a frame which contains: a button, which calls self.destroyworksheet a combobox (called worksheet) that has: "options" as values "default" selected (if not None) binds <<ComboboxSelected>> to self.updateoptions. Returns the Worksheet frame. """ ## Memo, this could be replaced with an independent class, but I do not see the need for that at the moment f = smarttkinter.ttk.SmartFrame(self.worksheetframe) tk.Button(f, text="[X]", command=lambda: self.destroyworksheet(f)) ttk.Label(f, text="Worksheet") f.worksheet = ttk.Combobox(f, values=options) f.worksheet.options = options f.worksheet.state([ "readonly", ]) f.worksheet.bind("<<ComboboxSelected>>", self.updateoptions, "+") self.updateoptions() if default and (default is True or default in options): if default is True: default = options[0] f.worksheet.current(options.index(default)) smarttkinter.masspack(f, side='left', padx=2) f.pack() self.updateoptions() return f
def __init__(self, parent, **kw): super().__init__(parent, **kw) ttk.Label(self, text="Select Input Files", style='Title.TLabel') f = smarttkinter.ttk.SmartFrame(self) ttk.Label(f, text="Database", style='Bold.TLabel') self.databasebutton = ttk.Button(f, text="...") self.databaseentry = ttk.Entry(f) smarttkinter.masspack(f, side='left', padx=2) f = smarttkinter.ttk.SmartFrame(self) ttk.Label(f, text="Quickbooks Excel File", style='Bold.TLabel') self.quickbooksbutton = ttk.Button(f, text="...") self.quickbooksentry = ttk.Entry(f) smarttkinter.masspack(f, side='left', padx=2) f = smarttkinter.ttk.SmartFrame(self) ttk.Label(f, text="Output File", style='Bold.TLabel') self.outputbutton = ttk.Button(f, text="...") self.outputentry = ttk.Entry(f) smarttkinter.masspack(f, side='left', padx=2) bf = smarttkinter.ttk.SmartFrame(self) self.continuebutton = ttk.Button(bf, text="Continue") self.cancelbutton = ttk.Button(bf, text="Cancel") smarttkinter.masspack(bf, side='left', padx=3) smarttkinter.masspack(self)
def __init__(self,parent,**kw): super().__init__(parent,**kw) self.notebook = ttk.Notebook(self) self.continuebutton = ttk.Button(self,text="Continue") smarttkinter.masspack(self)
def __init__(self, parent, padding=10, **kw): super().__init__(parent, padding=padding, **kw) ttk.Label(self, text="SQL Explorer", style="Title.TLabel") self.loadbutton = ttk.Button(self, text="Load Database") self.quitbutton = ttk.Button(self, text="Quit") smarttkinter.masspack(self)
def __init__(self, parent, **kw): super().__init__(parent, **kw) self.title = ttk.Label(self, style="Title.TLabel") self.output = tkscrolledtext.ScrolledText(self) self.continuebutton = ttk.Button(self, text="Continue") smarttkinter.masspack(self)
def addmessage(self,tab,title,message): f = ttk.Frame(self.notebook) ttk.Label(f,text=title,style="Title.TLabel") infotext = tkscrolledtext.ScrolledText(f) infotext.insert(0.0,message) smarttkinter.masspack(f) infotext.pack_configure(fill='both',expand=True) self.notebook.add(f,text=tab)
def __init__(self, parent, **kw): super().__init__(parent, **kw) ttk.Label(self, text="Quickbooks", style="Title.TLabel") self.costsbutton = ttk.Button(self, text="Costs") self.quantitiesbutton = ttk.Button(self, text="Inventory") self.cancelbutton = ttk.Button(self, text="Cancel") smarttkinter.masspack(self)
def __init__(self, parent, **kw): super().__init__(parent, **kw) ttk.Label(self, text="Quickbooks", style="Title.TLabel") self.costbutton = ttk.Button(self, text="Cost from Report") self.vendorbutton = ttk.Button(self, text="Vendor from Item List") self.cancelbutton = ttk.Button(self, text="Cancel") smarttkinter.masspack(self)
def __init__(self,parent,**kw): super().__init__(parent,**kw) ttk.Label(self,text="Inventory",style="Title.TLabel") self.inventorybutton = ttk.Button(self,text="Import Inventory") self.quickbooksbutton = ttk.Button(self,text="Quickbooks Conversions") self.fudgeitbutton = ttk.Button(self,text="Fudge-it Module") self.cancelbutton = ttk.Button(self,text="Cancel") smarttkinter.masspack(self)
def __init__(self, parent, **kw): super().__init__(parent, **kw) self.box = scrolledtext.ScrolledText(self) ttk.Label(self, text="Replacements") self.replacements = scrolledtext.ScrolledText(self, height=4) f = smarttkinter.ttk.SmartFrame(self) self.executebutton = ttk.Button(f, text="Execute") smarttkinter.masspack(f, side='left') smarttkinter.masspack(self) self.box.pack_configure(fill='both', expand=True)
def __init__(self, parent, **kw): super().__init__(parent, **kw) ttk.Label(self, text="BRD Services Test Module", style="Title.TLabel") self.runtestsbutton = ttk.Button(self, text="Run Tests", style='Main.TButton') self.quitbutton = ttk.Button(self, text="Quit", style='Main.TButton') smarttkinter.masspack(self)
def __init__(self, parent, **kw): super().__init__(parent, **kw) ttk.Label(self, text="Results", style="Title.TLabel").pack() self.notebook = ttk.Notebook(self) self.notebook.pack(fill='both', expand=True) bf = smarttkinter.ttk.SmartFrame(self) bf.pack() self.continuebutton = ttk.Button(bf, text="Continue") self.cancelbutton = ttk.Button(bf, text="Cancel") smarttkinter.masspack(bf, side='left', padx=3)
def __init__(self, master=None, **kw): super().__init__(master, **kw) self.transient() f = self.mainframe = smarttkinter.ttk.SmartFrame(self) ttk.Label(f, text="Passed Tests", style='Subtitle.TLabel') self.treeview = smarttkinter.ttk.SmartTreeview(f, columns=("Name", )) self.searchbar = None self.quitbutton = ttk.Button(f, text="Close") smarttkinter.masspack(f) self.treeview.pack_configure(fill='both', expand=True) smarttkinter.masspack(self) f.pack_configure(fill='both', expand=True)
def __init__(self,parent,title, style = "", **kw): super().__init__(parent, **kw) self.title = ttk.Label(self, text = title, style = 'Subtitle.TLabel') tbf = ttk.Frame(self, style = style) self.deletebutton = ttk.Button(tbf, text="Delete Selected") self.deleteallbutton = ttk.Button(tbf, text="Delete All") smarttkinter.masspack(tbf,side='left',padx = 3) self.filelist = smarttkinter.ttk.SmartTreeview(self,columns = ["File",]) self.removefolderbutton = ttk.Button(self,text = "Close Folder") smarttkinter.masspack(self) self.filelist.pack_configure(fill='both',expand=True)
def __init__(self,parent,style = "", **kw): super().__init__(parent,style = style, **kw) f = ttk.Frame(self,style = style) ttk.Label(f,text="Searching for Files:",style = "TItle.TLabel").pack() self.progressbar = ttk.Progressbar(f, mode = "indeterminate") self.completionlabel = ttk.Label(f,text="Complete", style = "Complete.TLabel") self.foldernotebook = ttk.Notebook(self) bf = ttk.Frame(self, style = style) self.refreshbutton = ttk.Button(bf,text="Refresh") self.quitbutton = ttk.Button(bf, text = "Quit") smarttkinter.masspack(bf,side='left',padx=3) smarttkinter.masspack(self) self.foldernotebook.pack_configure(fill='both',expand = True)
def __init__(self, parent, **kw): super().__init__(parent, **kw) ttk.Label(self, text="Results", style="Title.TLabel") self.passlabel = ttk.Label(self, style='Italics.Subtitle.TLabel') self.faillabel = ttk.Label(self, style='Italics.Subtitle.TLabel') self.resultnotebook = ttk.Notebook(self) f = smarttkinter.ttk.SmartFrame(self) self.passedbutton = ttk.Button(f, text="Show Passed") self.continuebutton = ttk.Button(f, text="Quit") smarttkinter.masspack(f, side='left', padx=3) smarttkinter.masspack(self) self.resultnotebook.pack_configure(fill='both', expand=True)
def __init__(self, parent, **kw): super().__init__(parent, **kw) ## Used to lock out updateoptions to prevent recursion self.updateflag = False f = smarttkinter.ttk.SmartFrame(self) f.pack() self.removebutton = tk.Button(f, text="[X]") self.getworkbookbutton = ttk.Button(f, text="Workbook") self.workbookentry = ttk.Entry(f) smarttkinter.masspack(f, side='left') f = smarttkinter.ttk.SmartFrame(self) f.pack(fill='x') self.addworksheetbutton = ttk.Button(f, text="Add Worksheet") self.worksheetframe = ttk.LabelFrame(self, text="Worksheets") self.worksheetframe.pack(fill='both', expand=True, padx=3)
def __init__(self, parent, **kw): super().__init__(parent, **kw) ttk.Label(self, text="Worksheet Selection", style="Title.TLabel").pack() self.addworkbookbutton = ttk.Button(self, text="Add Workbook") self.addworkbookbutton.pack() self.worksheetselectionframe = ttk.LabelFrame(self, text="Workbooks") self.worksheetselectionframe.pack(fill='both', expand=True, padx=3, pady=10) bf = smarttkinter.ttk.SmartFrame(self) bf.pack() self.continuebutton = ttk.Button(bf, text='Continue') self.cancelbutton = ttk.Button(bf, text='Cancel') smarttkinter.masspack(bf, side='left')
def __init__(self, parent, **kw): super().__init__(parent, **kw) f = smarttkinter.ttk.SmartFrame(self) self.loadingmessage = ttk.Label(f, text="Running Tests", style="Subtitle.TLabel") self.loadingmessage.pack() self.loadingbar = ttk.Progressbar(self) ff = smarttkinter.ttk.SmartFrame(self) self.currentmessage = ttk.Label(ff, style="Italics.TLabel", justify='right') self.currentmessage.pack(side='right') self.cancelbutton = ttk.Button(self, text="Cancel") smarttkinter.masspack(self) ff.pack_configure(fill='x')
def __init__(self, master=None, **kw): super().__init__(master, **kw) self.transient() f = self.mainframe = smarttkinter.ttk.SmartFrame(self) self.titlelabel = ttk.Label(f, style="Subtitle.TLabel") ff = smarttkinter.ttk.SmartFrame(f) self.goodbadvar = tk.IntVar() tk.Radiobutton(ff, text="Invalid", variable=self.goodbadvar, value=0, indicatoron=False) tk.Radiobutton(ff, text="Valid", variable=self.goodbadvar, value=1, indicatoron=False) tk.Radiobutton(ff, text="Both", variable=self.goodbadvar, value=-1, indicatoron=False) smarttkinter.masspack(ff, side='left') self.chartframe = smarttkinter.ttk.SmartFrame(f) ff = smarttkinter.ttk.SmartFrame(f) self.toggleoptionsbutton = ttk.Button(ff, text="Show", command=self.toggleoptions) self.toggleoptionsbutton.pack() self.optionsframe = smarttkinter.ttk.SmartFrame(ff) self.closebutton = ttk.Button(f, text="Close", command=self.destroy) smarttkinter.masspack(f) f.pack(fill='both', expand=True)
def __init__(self, parent, testname="Test", **kw): super().__init__(parent, **kw) self.result = None self.testname = testname self.titlelabel = ttk.Label(self, style="Subtitle.TLabel") self.failurecountlabel = ttk.Label(self, style="Italics.TLabel") self.failurelisttreeview = smarttkinter.ttk.SmartTreeview( self, columns=TESTHEADERS) f = smarttkinter.ttk.SmartFrame(self) ff = smarttkinter.ttk.SmartFrame(f) ttk.Label(ff, text="Door:", style="Bold.TLabel") self.selecteddoor = ttk.Label(ff) ff.masspack(side='left') self.showchartbutton = smarttkinter.ttk.SmartButton(f, text="Show Chart") f.masspack(side='left') smarttkinter.masspack(self) self.failurelisttreeview.pack_configure(fill='both', expand=True)
def __init__(self,parent,itemid,item,table,**kw): super().__init__(parent,**kw) self.itemid=itemid self.item = item self.table=table self.result=None ttk.Label(self,text=f"Find Match for {item.itemid}",style="Subtitle.TLabel") ttk.Label(self,text=item.memo,style="Italics.TLabel") self.searchvar = tk.StringVar() self.searchvar.trace('w',self.search) self.searchentry = ttk.Entry(self,textvariable = self.searchvar) self.treeview = smarttkinter.ttk.SmartTreeview(self,columns=["ItemID","Description"]) self.treeview.bind("<Double-Button-1>",self.getreturn) bf = smarttkinter.ttk.SmartFrame(self) self.continuebutton = ttk.Button(bf,text="Select",command=self.getreturn) self.cancelbutton = ttk.Button(bf,text="Cancel",command=self.returntoparent) smarttkinter.masspack(bf,side='left',padx=3) smarttkinter.masspack(self) self.treeview.pack_configure(fill='both',expand=True)
def __init__(self,parent,style = "",**kw): super().__init__(parent,style = style, **kw) ttk.Label(self,text="Select Diretory to Search", style = "Title.TLabel") f = ttk.Frame(self,style = style) ttk.Label(f,text="Directory",style = "Bold.TLabel") self.directorybutton = ttk.Button(f,text="...") self.directoryentry = ttk.Entry(f) smarttkinter.masspack(f,side='left') bf = ttk.Frame(self,style = style) self.continuebutton = ttk.Button(bf,text="Continue") smarttkinter.masspack(bf,side='left', padx = 3) smarttkinter.masspack(self) self.directoryentry.state(["readonly",])
def __init__(self, parent, **kw): super().__init__(parent, **kw) ttk.Label(self, text="Select Datbase and Month", style="Subtitle.TLabel") f = smarttkinter.ttk.SmartFrame(self) ttk.Label(f, text="Database File", style="Bold.TLabel") self.browsedatabasebutton = ttk.Button(f, text="...") self.databasefileentry = ttk.Entry(f) smarttkinter.masspack(f, side='left') f = smarttkinter.ttk.SmartFrame(self) self.monthcombo = ttk.Combobox(f, values=list(calendar.month_name)) self.yearspinbox = tk.Spinbox(f, from_=1970, to=2100) smarttkinter.masspack(f, side='left') bf = smarttkinter.ttk.SmartFrame(self) self.continuebutton = ttk.Button(bf, text="Continue") self.cancelbutton = ttk.Button(bf, text="Cancel") smarttkinter.masspack(bf, side='left', padx=3) smarttkinter.masspack(self)
def __init__(self, master, **kw): super().__init__(master, **kw) ttk.Label(self, text="Database Scratch Pad") bf = ttk.Frame(self, **kw) self.recreatebutton = ttk.Button(bf, text="Recreate") self.rollbackbutton = ttk.Button(bf, text="Rollback") self.createbutton = ttk.Button(bf, text="Create Database") self.closebutton = ttk.Button(bf, text="Close Database") self.loadbutton = ttk.Button(bf, text="Load Existing Database") self.loadsamplebutton = ttk.Button(bf, text="Load Sample Database") self.samplecombo = ttk.Combobox(bf) smarttkinter.masspack(bf, side='left', padx=3) f = ttk.PanedWindow(self, orient="horizontal", **kw) ff = self.leftwindow = ttk.PanedWindow(f, **kw) tff = ttk.Frame(ff) self.inputbox = tkscrolledtext.ScrolledText(tff) self.inputbox.pack(fill='both', expand=True) bff = ttk.Frame(tff, **kw) bff.pack(fill='x') self.showreplacebutton = smarttkinter.ttk.SequenceButton(bff) self.showreplacebutton.pack(side='left') self.replacebox = tkscrolledtext.ScrolledText(ff, height=3) ff.add(tff) self.outputbox = tkscrolledtext.ScrolledText(f, state='disabled') f.add(self.leftwindow) f.add(self.outputbox) bf = ttk.Frame(self, **kw) self.executebutton = ttk.Button(bf, text='Execute') self.clearinputbutton = ttk.Button(bf, text='Clear\nInput') self.clearoutputbutton = ttk.Button(bf, text='Clear\nOutput') smarttkinter.masspack(bf, side='left', padx=3) smarttkinter.masspack(self) f.pack_configure(fill='both', expand=True)
def __init__(self, parent, **kw): super().__init__(parent, **kw) self.titlelabel = ttk.Label(self, style="Title.TLabel") f = smarttkinter.ttk.SmartFrame(self) ttk.Label(f, text="Current Amount:", style="Subtitle.TLabel").grid(row=0, column=0, sticky='w') self.totallabel = ttk.Label(f, style="Subtitle.TLabel") self.totallabel.grid(row=0, column=1, sticky='e') ttk.Label(f, text="Target", style="Subtitle.TLabel").grid(row=1, column=0, sticky='w') callback = self.register(lambda text: not bool(NUMERICRE.search(text))) self.targetentry = ttk.Entry(f, validate="key", validatecommand=(callback, '%P')) self.targetentry.grid(row=1, column=1, sticky='e') ttk.Label(f, text="Difference", style="Subtitle.TLabel").grid(row=2, column=0, sticky="w") self.differencelabel = ttk.Label(f, style="Italics.Subtitile.TLabel") self.differencelabel.grid(row=2, column=1, sticky='e') f = smarttkinter.ttk.SmartFrame(self) self.togglelockbutton = ttk.Button(f, text="Lock Selected") self.togglelockallbutton = ttk.Button(f, text="Lock All") smarttkinter.masspack(f, side='left', padx=3) self.treeview = smarttkinter.ttk.SmartTreeview( self, columns=['Item', "Quantity", 'Original', 'Modified', "Subtotal"], plugins=[ smarttkinter.ttk.SmartTreeviewDisablePlugin, ]) bf = smarttkinter.ttk.SmartFrame(self) self.continuebutton = ttk.Button(bf, text="Save") self.cancelbutton = ttk.Button(bf, text="Cancel") smarttkinter.masspack(bf, side='left', padx=3) smarttkinter.masspack(self) self.treeview.pack_configure(fill='both', expand=True)
def __init__(self,parent,**kw): super().__init__(parent,**kw) ttk.Label(self,text="Items",style="Title.TLabel") ttk.Label(self,text="Items without a Database ID will not be included",style="Italics.Subtitle.TLabel") f = smarttkinter.ttk.SmartFrame(self) self.matchitembutton = ttk.Button(f,text="Find Selected") ttk.Label(f,text="Search:") self.searchvar = tk.StringVar() self.searchentry = ttk.Entry(f,textvariable= self.searchvar) self.searchentry.bind("<Escape>",lambda *event: smarttkinter.setentry(self.searchentry,"")) smarttkinter.masspack(f,side='left',padx=3) self.treeview = smarttkinter.ttk.SmartTreeview(self,columns = ["Date","Item","Item Descript","DB ID"]) bf = smarttkinter.ttk.SmartFrame(self) self.continuebutton = ttk.Button(bf,text="Continue") self.cancelbutton = ttk.Button(bf,text="Cancel") smarttkinter.masspack(bf,side='left',padx=3) smarttkinter.masspack(self) self.treeview.pack_configure(fill='both',expand = True)
def __init__(self, parent, **kw): super().__init__(parent, **kw) self.homebutton = ttk.Button(self, text="Close DB") smarttkinter.masspack(self, side='left')
def __init__(self, parent, **kw): super().__init__(parent, **kw) self.exportvar = tk.StringVar() ttk.Label(self, text="Export Options") f = smarttkinter.ttk.SmartFrame(self) self.csvradio = ttk.Radiobutton(f, text="CSV", variable=self.exportvar, value="csv", style="Subtitle.TRadiobutton") ff = smarttkinter.ttk.SmartFrame(f) ttk.Label(ff, text="Output File", style="Bold.TLabel") self.csvbutton = ttk.Button(ff, text="...") self.csventry = ttk.Entry(ff) smarttkinter.masspack(ff, side="left", padx=2) smarttkinter.masspack(f) f = smarttkinter.ttk.SmartFrame(self) self.dbradio = ttk.Radiobutton(f, text="Database", variable=self.exportvar, value="db", style="Subtitle.TRadiobutton") ff = smarttkinter.ttk.SmartFrame(f) ttk.Label(ff, text="Database File", style="Bold.TLabel") self.dbbutton = ttk.Button(ff, text="...") self.dbentry = ttk.Entry(ff) smarttkinter.masspack(ff, side="left", padx=2) smarttkinter.masspack(f) bf = smarttkinter.ttk.SmartFrame(self) self.continuebutton = ttk.Button(bf, text="Continue") self.cancelbutton = ttk.Button(bf, text="Cancel") smarttkinter.masspack(bf, side="left", padx=3) smarttkinter.masspack(self)