def __init__(self, parent=None, model=None, parentapp=None): if parentapp != None: self.parentapp = parentapp TableCanvas.__init__(self, parent, model) self.sortcol = 0 self.grid_color = '#8996ab' self.rowselectedcolor = '#f6fcd1' self.peatactions = {'PDB' : {"Save PDB file":'save_structure', "View Structure": 'displayStructure', "View PDB Text": 'viewStructureText'}, 'Notes' : {"Edit notes": 'edit_notes' }, 'Link' : {"Edit Link" : 'edit_link', "Open link" : 'open_link'}, 'File' : {"View File" : 'display_file', "Add File" : 'add_file', "Save File" : 'save_file'}, 'Table' : {"Edit Table" : 'startLabbook' }, 'Ekintype' : {"Open Ekin" : 'startEkin' }, 'Sequence' : {"Show sequence" : 'display_sequence'}, 'Project' : {"Open Project" : 'openProjectfromTable', "Edit Link to Project" : 'editProjectLink'}, } self.ekin_actions={'NMR titration':'NMR titration', 'Protein Stability':'Protein Stability', 'pH Activity profile':'Enzyme pH-activity', 'Michaelis-Menten kinetics':'Simple enzyme kinetic', 'pH stability profile':'pH-stability', 'Amyloid formation':'Amyloid formation', 'General':'General'} self.fileicons = {'txt': 'txticon','img':'imageicon','pdf':'pdficon', 'other':'blankicon','zip':'zipicon','doc':'docicon', 'xls':'ssheeticon'} self.thumbsize = 200 return
def createTable(model): t = Toplevel() app = App(t) master = app.main table = TableCanvas(master, model, rowheaderwidth=50) table.createTableFrame() return table
def createTable(model): t=Toplevel() app = App(t) master = app.main table = TableCanvas(master, model,rowheaderwidth=50) table.createTableFrame() return table
def __init__(self, parent=None, model=None): TableCanvas.__init__(self, parent, model) self.cellbackgr = '#FFFAF0' self.entrybackgr = 'white' self.selectedcolor = 'yellow' self.rowselectedcolor = '#B0E0E6' self.multipleselectioncolor = '#ECD672' return
def __init__(self, parent=None, model=None): TableCanvas.__init__(self, parent, model) self.cellbackgr = "#FFFAF0" self.entrybackgr = "white" self.selectedcolor = "yellow" self.rowselectedcolor = "#B0E0E6" self.multipleselectioncolor = "#ECD672" return
def test5(): """frame placement""" import Pmw t = Toplevel() app = App(t) master = app.main w = Pmw.Group(master, tag_text='Show/Hide') w.pack(fill=BOTH) f = Frame(master) f.pack(fill=BOTH) table = TableCanvas(w) table.createTableFrame() return
def test5(): """frame placement""" import Pmw t = Toplevel() app = App(t) master = app.main w = Pmw.Group(master, tag_text="Show/Hide") w.pack(fill=BOTH) f = Frame(master) f.pack(fill=BOTH) table = TableCanvas(w) table.createTableFrame() return
def __init__(self, parent=None, model=None, newdict=None, width=None, height=None, **kwargs): TableCanvas.__init__(self, parent=parent, model=model, newdict=newdict, width=width, height=width, **kwargs) return
def test2(): """Multuple tables in one window""" t=Toplevel() app = App(t) master = app.main c=0; r=1 for i in range(12): model = TableModel() data = createData(50) model.importDict(data) fr = Frame(master) if c%3==0: c=0; r+=1 fr.grid(row=r,column=c,sticky='nws') table = TableCanvas(fr, model, width=250,height=150,rowheaderwidth=0) table.createTableFrame() c+=1 return
def __init__(self, parent=None, model=None, sheetname=None, peat=None, peatinfo=None): TableCanvas.__init__(self, parent, model) if sheetname != None: self.sheetname = sheetname if parent != None: self.parent = parent else: self.parent = None #inside peat? if peat != None: self.peatapp = peat self.peatinfo = peatinfo self.DB = peat.DB else: self.peatapp = None self.peatinfo = None self.DB = None self.cellbackgr = '#FFFAF0' self.entrybackgr = 'white' self.selectedcolor = 'yellow' self.rowselectedcolor = '#B0E0E6' self.multipleselectioncolor = '#ECD672' self.fileicons = { 'txt': 'txticon', 'img': 'imageicon', 'pdf': 'pdficon', 'other': 'blankicon', 'zip': 'zipicon', 'doc': 'docicon', 'xls': 'ssheeticon' } self.columnactions['File'] = { "Add File": 'addFile' } # , "View File" : 'displayFile' } self.columnactions['Table'] = {"Edit Table": 'edit_Table'} self.columnactions['Ekin'] = {"Open Ekin": 'open_Ekin'} return
def test2(): """Multuple tables in one window""" t = Toplevel() app = App(t) master = app.main c = 0 r = 1 for i in range(12): model = TableModel() data = createData(50) model.importDict(data) fr = Frame(master) if c % 3 == 0: c = 0 r += 1 fr.grid(row=r, column=c, sticky='nws') table = TableCanvas(fr, model, width=250, height=150, rowheaderwidth=0) table.createTableFrame() c += 1 return
class App: def __init__(self, master): tframe = Frame(master) tframe.pack(fill=BOTH) d = {1: {'date': 1189774539.345525, 'message': 'Commiting project ', 'author': 'damien'}, 2: {'date': 1189776100.545814, 'message': 'tommytest1', 'author': 'tc'}, 3: {'date': 1189776148.873471, 'message': 'test', 'author': 'elisa'}, 4: {'date': 1189776217.082571, 'message': "barbara's wt and mutant", 'author': 'btconnolly'}, 5: {'date': 1189776969.9782951, 'message': 'Adding a column', 'author': 'nielsen'}, 6: {'date': 1189777126.719934, 'message': 'fergal_test', 'author': 'fomeara'}, 7: {'date': 1189777948.4796059, 'message': 'TEST', 'author': 'elisa'}, 8: {'date': 1189778073.3868899, 'message': 'Adding 7TLN and deleting damen wt', 'author': 'nielsen'}, 9: {'date': 1189778472.5035281, 'message': 'Adding exp. data', 'author': 'nielsen'}, 10: {'date': 1189778553.6663699, 'message': 'Adding NMR tirtaion curve', 'author': 'nielsen'}, 11: {'date': 1189778701.032536, 'message': 'blaah', 'author': 'nielsen'}} self.tmodel = TableModel() self.tmodel.importDict(d,None,columns = ['date','message','author']) self.table = TableCanvas(tframe, self.tmodel,upperColumnHeaders=None) self.table.createTableFrame() return
def test1(root): """Setup a table and populate it with data""" app = App(root) master = app.main model = TableModel() data = createData(40) #import after model created #print data model.importDict(data) table = TableCanvas(master, model, cellwidth=60, cellbackgr='#e3f698', thefont=('Arial',12),rowheight=18, rowheaderwidth=30, rowselectedcolor='yellow', editable=True) table.createTableFrame() #table.sortTable(columnName='label') #remove cols model.deleteColumns([0]) model.deleteRows(range(0,2)) #table.redrawTable() #add rows and cols table.addRow(1,label='aaazzz') table.addRow(label='bbb') table.addRow(**{'label':'www'}) table.addColumn('col6') model.data[1]['col6']='TEST' #table.redrawTable() #change col labels model.columnlabels['col6'] = 'new label' #set and get selections table.setSelectedRow(2) table.setSelectedCol(1) table.setSelectedCells(1,80,2,4) #print table.getSelectionValues() #table.plotSelected(graphtype='XY') #save data #table.addRows(50000) model.save('test.table') #load new data table.load('test.table') #root.after(2000, root.quit) return
def test1(root): """Setup a table and populate it with data""" app = App(root) master = app.main model = TableModel() data = createData(40) # import after model created # print data model.importDict(data) table = TableCanvas( master, model, cellwidth=60, cellbackgr="#e3f698", thefont=("Arial", 12), rowheight=18, rowheaderwidth=30, rowselectedcolor="yellow", editable=True, ) table.createTableFrame() # table.sortTable(columnName='label') # remove cols model.deleteColumns([0]) model.deleteRows(range(0, 2)) # table.redrawTable() # add rows and cols table.addRow(1, label="aaazzz") table.addRow(label="bbb") table.addRow(**{"label": "www"}) table.addColumn("col6") model.data[1]["col6"] = "TEST" # table.redrawTable() # change col labels model.columnlabels["col6"] = "new label" # set and get selections table.setSelectedRow(2) table.setSelectedCol(1) table.setSelectedCells(1, 80, 2, 4) # print table.getSelectionValues() # table.plotSelected(graphtype='XY') # save data # table.addRows(50000) model.save("test.table") # load new data table.load("test.table") # root.after(2000, root.quit) return
def test1(root): """Setup a table and populate it with data""" app = App(root) master = app.main model = TableModel() data = createData(40) #import after model created #print data model.importDict(data) table = TableCanvas(master, model, cellwidth=60, cellbackgr='#e3f698', thefont=('Arial', 12), rowheight=18, rowheaderwidth=30, rowselectedcolor='yellow', editable=True) table.createTableFrame() #table.sortTable(columnName='label') #remove cols model.deleteColumns([0]) model.deleteRows(range(0, 2)) #table.redrawTable() #add rows and cols table.addRow(1, label='aaazzz') table.addRow(label='bbb') table.addRow(**{'label': 'www'}) table.addColumn('col6') model.data[1]['col6'] = 'TEST' #table.redrawTable() #change col labels model.columnlabels['col6'] = 'new label' #set and get selections table.setSelectedRow(2) table.setSelectedCol(1) table.setSelectedCells(1, 80, 2, 4) #print table.getSelectionValues() #table.plotSelected(graphtype='XY') #save data #table.addRows(50000) model.save('test.table') #load new data table.load('test.table') #root.after(2000, root.quit) return