PEATDB/PEATTables.py
def add_defaultcommands():
                """now add general actions for all cells"""
                order = [ "Set Fill Color","Set Text Color","Edit","Copy","Paste","Fill Down","Fill Right", "Clear Data",
                         "View Record", "Select All",
                         "Plot Selected","Plot Options"]
                defaultactions={"Edit" : lambda: self.draw_cellentry(row,col),
                                "Set Fill Color" : lambda : self.setcellColor(rows,cols,key='bg'),
                                "Set Text Color" : lambda : self.setcellColor(rows,cols,key='fg'),
                                "Copy" : lambda : self.copyCell(rows, cols),
                                "Paste" : lambda : self.pasteCell(rows, cols),                                
                                "Fill Down" : lambda : self.fill_down(rows, cols),
                                "Fill Right" : lambda : self.fill_across(cols, rows),
                                "View Record" : lambda : self.getRecordInfo(row),
                                "Clear Data" : lambda : self.delete_Cells(rows, cols),
                                "Select All" : self.select_All,
                                "Plot Selected" : self.plot_Selected,
                                "Plot Options" : self.plotSetup }
                for action in order:
                    if action == 'Fill Down' and (rows == None or len(rows) <= 1):
                        continue
                    if action == 'Fill Right' and (cols == None or len(cols) <= 1):
                        continue
                    else:
                        popupmenu.add_command(label=action, command=defaultactions[action])
                return
now add general actions for all cells
now add general actions for all cells
now add general actions for all cells
def add_defaultcommands():
                order = [ "Set Fill Color","Set Text Color","Edit","Copy","Paste","Fill Down","Fill Right", "Clear Data",
                         "View Record", "Select All",
                         "Plot Selected","Plot Options"]
                defaultactions={"Edit" : lambda: self.draw_cellentry(row,col),
                                "Set Fill Color" : lambda : self.setcellColor(rows,cols,key='bg'),
                                "Set Text Color" : lambda : self.setcellColor(rows,cols,key='fg'),
                                "Copy" : lambda : self.copyCell(rows, cols),
                                "Paste" : lambda : self.pasteCell(rows, cols),                                
                                "Fill Down" : lambda : self.fill_down(rows, cols),
                                "Fill Right" : lambda : self.fill_across(cols, rows),
                                "View Record" : lambda : self.getRecordInfo(row),
                                "Clear Data" : lambda : self.delete_Cells(rows, cols),
                                "Select All" : self.select_All,
                                "Plot Selected" : self.plot_Selected,
                                "Plot Options" : self.plotSetup }
                for action in order:
                    if action == 'Fill Down' and (rows == None or len(rows) <= 1):
                        continue
                    if action == 'Fill Right' and (cols == None or len(cols) <= 1):
                        continue
                    else:
                        popupmenu.add_command(label=action, command=defaultactions[action])
                return
def add_defaultcommands ( ) : order = [ "Set Fill Color" , "Set Text Color" , "Edit" , "Copy" , "Paste" , "Fill Down" , "Fill Right" , "Clear Data" , "View Record" , "Select All" , "Plot Selected" , "Plot Options" ] defaultactions = { "Edit" : lambda : self . draw_cellentry ( row , col ) , "Set Fill Color" : lambda : self . setcellColor ( rows , cols , key = 'bg' ) , "Set Text Color" : lambda : self . setcellColor ( rows , cols , key = 'fg' ) , "Copy" : lambda : self . copyCell ( rows , cols ) , "Paste" : lambda : self . pasteCell ( rows , cols ) , "Fill Down" : lambda : self . fill_down ( rows , cols ) , "Fill Right" : lambda : self . fill_across ( cols , rows ) , "View Record" : lambda : self . getRecordInfo ( row ) , "Clear Data" : lambda : self . delete_Cells ( rows , cols ) , "Select All" : self . select_All , "Plot Selected" : self . plot_Selected , "Plot Options" : self . plotSetup } for action in order : if action == 'Fill Down' and ( rows == None or len ( rows ) <= 1 ) : continue if action == 'Fill Right' and ( cols == None or len ( cols ) <= 1 ) : continue else : popupmenu . add_command ( label = action , command = defaultactions [ action ] ) return
now add general actions for all cells
now add general actions for all cells
"""now add general actions for all cells"""