PEATDB/Ekin/Ekin_main.py
def createMenuBar(self):
        """Create the menu bar for the application. """
        self.menu=Menu(self.ekin_win)
        self.file_menu={ '01New':{'cmd':self.newProject},
                         '02Open':{'cmd':self.openProject},
                         '03Close':{'cmd':self.closeProject},
                         '04Save':{'cmd':self.saveProject},
                         '05Save As':{'cmd':self.save_as_project},
                         '06Append':{'cmd':self.appendProject},
                         '06Quit':{'cmd':self.quit}}

        self.file_menu=self.create_pulldown(self.menu,self.file_menu)
        self.menu.add_cascade(label='File',menu=self.file_menu['var'])

        self.data_menu={'01Open dataset':{'cmd':self.read_dataset},
                        '02Save dataset':{'cmd':self.saveDataset},
                        '03sep':{None:None},
                        '04Add New Dataset':{'cmd':self.addDataset},
                        '05Rename Dataset':{'cmd':self.renameDataset},
                        '06Copy Dataset':{'cmd':self.copy_dataset},
                        '07Delete Dataset':{'cmd':self.deleteDataset},
                        '08Delete All':{'cmd':self.deleteAll},
                        '09Batch Rename':{'cmd':self.batchRename},
                        '10sep':{None:None},
                        '11Adjust Data':{'cmd':self.adjustDataDialog}}

        self.data_menu=self.create_pulldown(self.menu,self.data_menu)
        self.menu.add_cascade(label='Data',menu=self.data_menu['var'])

        self.IE_menu={  '01Import from CSV file':{'cmd':self.import_csv},
                        '02Export Dataset':{'cmd':self.exportDataset},
                        '03Export All':{'cmd':self.exportAll},
                        '04Import Sparky peak files':{'cmd':self.import_chem_shift},
                        '05Import CcpNmr file':{'cmd':self.import_ccpnmr},
                        '06sep':{None:None},
                        '07Import CD temperature scan':{'cmd':self.import_CD_tempscan},
                        '08Analyse temp dependence of CD data':{'cmd':self.insert_CD_temp_datatab}
                        }

        self.IE_menu=self.create_pulldown(self.menu,self.IE_menu)
        self.menu.add_cascade(label='Import/Export',menu=self.IE_menu['var'])

        #set up mode menu
        self.mode_menu=Menu(self.menu,tearoff=0)
        self.doModeMenu()
        self.menu.add_cascade(label='Mode',menu=self.mode_menu)

        # Annotate/Map menu
        #
        self.annotate_menu={'01Edit meta data':{'cmd':self.editMetaData},
                            #'02View all meta data':{'cmd':self.viewMetaData},
                            '02Map dataset to structure':{'cmd':self.map_datatab2structure}}
        self.annotate_menu=self.create_pulldown(self.menu,self.annotate_menu)
        self.menu.add_cascade(label='Annotate/Map',menu=self.annotate_menu['var'])

        # Plot menu
        self.plot_menu=Menu(self.menu,tearoff=0)

        self.plot_menu.add_command(label='Plot options',
                                       command=self.plotframe.plotOptions)
        self.plot_menu.add_checkbutton(label='Show multiple plots',
                                       command=self.multiplePlotsOption,
                                       variable=self.display_multiple,onvalue=1,offvalue=0)
        self.plot_menu.add_checkbutton(label='Show all',
                                       command=self.redrawGraph,
                                       variable=self.display_all,onvalue=1,offvalue=0)
        self.plot_menu.add_checkbutton(label='Compare plots',
                                       command=self.compareAllDialog,
                                       variable=self.compare_multiple,onvalue=1,offvalue=0)
        self.plot_menu.add_checkbutton(label='Overlay view',
                                       command=self.redrawGraph,
                                       variable=self.overlayPlots,onvalue=3,offvalue=2)
        self.plot_menu.add('separator')
        self.plot_menu.add_command(label='Disable selected',
                                       command=self.disableSelected)
        self.plot_menu.add_command(label='Enable selected',
                                        command=lambda: self.disableSelected(1))
        self.plot_menu.add_command(label='Delete selected',
                                        command=lambda: self.deleteSelected(1))
        self.menu.add_cascade(label='Plot',menu=self.plot_menu)

        # Fit menu
        self.fit_menu=Menu(self.menu,tearoff=0)
        self.fit_menu={ '01Find best model':{'cmd':self.fitframe.showBestModelDialog},
                         '02Fit all datasets':{'cmd':self.fitAll},
                         '03Model Designer':{'cmd':self.modelDesigner},
                         '04Load models file':{'cmd':self.loadModelsFile}}
        self.fit_menu=self.create_pulldown(self.menu,self.fit_menu)
        self.menu.add_cascade(label='Fitting',menu=self.fit_menu['var'])

        self.view_menu=Menu(self.menu,tearoff=0)
        self.view_menu.add_checkbutton(label='Show fit panel',command=self.updateView,
                                       variable=self.showfitpanel,onvalue=1,offvalue=0)
        self.view_menu.add_checkbutton(label='Show datasets in table',command=self.showDatasetsTable,
                                       variable=self.showdatasetstable,onvalue=1,offvalue=0)
        self.menu.add_cascade(label='View',menu=self.view_menu)

        # Help menu
        self.help_menu={'01Online Help':{'cmd':self.online_documentation},
                        '02About':{'cmd':self.about}}
        self.help_menu=self.create_pulldown(self.menu,self.help_menu)
        self.menu.add_cascade(label='Help',menu=self.help_menu['var'])
        self.ekin_win.config(menu=self.menu)

        return
Create the menu bar for the application. 
Create the menu bar for the application.
Create the menu bar for the application .
def createMenuBar(self):
        self.menu=Menu(self.ekin_win)
        self.file_menu={ '01New':{'cmd':self.newProject},
                         '02Open':{'cmd':self.openProject},
                         '03Close':{'cmd':self.closeProject},
                         '04Save':{'cmd':self.saveProject},
                         '05Save As':{'cmd':self.save_as_project},
                         '06Append':{'cmd':self.appendProject},
                         '06Quit':{'cmd':self.quit}}
        self.file_menu=self.create_pulldown(self.menu,self.file_menu)
        self.menu.add_cascade(label='File',menu=self.file_menu['var'])
        self.data_menu={'01Open dataset':{'cmd':self.read_dataset},
                        '02Save dataset':{'cmd':self.saveDataset},
                        '03sep':{None:None},
                        '04Add New Dataset':{'cmd':self.addDataset},
                        '05Rename Dataset':{'cmd':self.renameDataset},
                        '06Copy Dataset':{'cmd':self.copy_dataset},
                        '07Delete Dataset':{'cmd':self.deleteDataset},
                        '08Delete All':{'cmd':self.deleteAll},
                        '09Batch Rename':{'cmd':self.batchRename},
                        '10sep':{None:None},
                        '11Adjust Data':{'cmd':self.adjustDataDialog}}
        self.data_menu=self.create_pulldown(self.menu,self.data_menu)
        self.menu.add_cascade(label='Data',menu=self.data_menu['var'])
        self.IE_menu={  '01Import from CSV file':{'cmd':self.import_csv},
                        '02Export Dataset':{'cmd':self.exportDataset},
                        '03Export All':{'cmd':self.exportAll},
                        '04Import Sparky peak files':{'cmd':self.import_chem_shift},
                        '05Import CcpNmr file':{'cmd':self.import_ccpnmr},
                        '06sep':{None:None},
                        '07Import CD temperature scan':{'cmd':self.import_CD_tempscan},
                        '08Analyse temp dependence of CD data':{'cmd':self.insert_CD_temp_datatab}
                        }
        self.IE_menu=self.create_pulldown(self.menu,self.IE_menu)
        self.menu.add_cascade(label='Import/Export',menu=self.IE_menu['var'])
        self.mode_menu=Menu(self.menu,tearoff=0)
        self.doModeMenu()
        self.menu.add_cascade(label='Mode',menu=self.mode_menu)
        self.annotate_menu={'01Edit meta data':{'cmd':self.editMetaData},
                            '02View all meta data':{'cmd':self.viewMetaData},
                            '02Map dataset to structure':{'cmd':self.map_datatab2structure}}
        self.annotate_menu=self.create_pulldown(self.menu,self.annotate_menu)
        self.menu.add_cascade(label='Annotate/Map',menu=self.annotate_menu['var'])
         Plot menu
        self.plot_menu=Menu(self.menu,tearoff=0)
        self.plot_menu.add_command(label='Plot options',
                                       command=self.plotframe.plotOptions)
        self.plot_menu.add_checkbutton(label='Show multiple plots',
                                       command=self.multiplePlotsOption,
                                       variable=self.display_multiple,onvalue=1,offvalue=0)
        self.plot_menu.add_checkbutton(label='Show all',
                                       command=self.redrawGraph,
                                       variable=self.display_all,onvalue=1,offvalue=0)
        self.plot_menu.add_checkbutton(label='Compare plots',
                                       command=self.compareAllDialog,
                                       variable=self.compare_multiple,onvalue=1,offvalue=0)
        self.plot_menu.add_checkbutton(label='Overlay view',
                                       command=self.redrawGraph,
                                       variable=self.overlayPlots,onvalue=3,offvalue=2)
        self.plot_menu.add('separator')
        self.plot_menu.add_command(label='Disable selected',
                                       command=self.disableSelected)
        self.plot_menu.add_command(label='Enable selected',
                                        command=lambda: self.disableSelected(1))
        self.plot_menu.add_command(label='Delete selected',
                                        command=lambda: self.deleteSelected(1))
        self.menu.add_cascade(label='Plot',menu=self.plot_menu)
         Fit menu
        self.fit_menu=Menu(self.menu,tearoff=0)
        self.fit_menu={ '01Find best model':{'cmd':self.fitframe.showBestModelDialog},
                         '02Fit all datasets':{'cmd':self.fitAll},
                         '03Model Designer':{'cmd':self.modelDesigner},
                         '04Load models file':{'cmd':self.loadModelsFile}}
        self.fit_menu=self.create_pulldown(self.menu,self.fit_menu)
        self.menu.add_cascade(label='Fitting',menu=self.fit_menu['var'])
        self.view_menu=Menu(self.menu,tearoff=0)
        self.view_menu.add_checkbutton(label='Show fit panel',command=self.updateView,
                                       variable=self.showfitpanel,onvalue=1,offvalue=0)
        self.view_menu.add_checkbutton(label='Show datasets in table',command=self.showDatasetsTable,
                                       variable=self.showdatasetstable,onvalue=1,offvalue=0)
        self.menu.add_cascade(label='View',menu=self.view_menu)
         Help menu
        self.help_menu={'01Online Help':{'cmd':self.online_documentation},
                        '02About':{'cmd':self.about}}
        self.help_menu=self.create_pulldown(self.menu,self.help_menu)
        self.menu.add_cascade(label='Help',menu=self.help_menu['var'])
        self.ekin_win.config(menu=self.menu)
        return
def createMenuBar ( self ) : self . menu = Menu ( self . ekin_win ) self . file_menu = { '01New' : { 'cmd' : self . newProject } , '02Open' : { 'cmd' : self . openProject } , '03Close' : { 'cmd' : self . closeProject } , '04Save' : { 'cmd' : self . saveProject } , '05Save As' : { 'cmd' : self . save_as_project } , '06Append' : { 'cmd' : self . appendProject } , '06Quit' : { 'cmd' : self . quit } } self . file_menu = self . create_pulldown ( self . menu , self . file_menu ) self . menu . add_cascade ( label = 'File' , menu = self . file_menu [ 'var' ] ) self . data_menu = { '01Open dataset' : { 'cmd' : self . read_dataset } , '02Save dataset' : { 'cmd' : self . saveDataset } , '03sep' : { None : None } , '04Add New Dataset' : { 'cmd' : self . addDataset } , '05Rename Dataset' : { 'cmd' : self . renameDataset } , '06Copy Dataset' : { 'cmd' : self . copy_dataset } , '07Delete Dataset' : { 'cmd' : self . deleteDataset } , '08Delete All' : { 'cmd' : self . deleteAll } , '09Batch Rename' : { 'cmd' : self . batchRename } , '10sep' : { None : None } , '11Adjust Data' : { 'cmd' : self . adjustDataDialog } } self . data_menu = self . create_pulldown ( self . menu , self . data_menu ) self . menu . add_cascade ( label = 'Data' , menu = self . data_menu [ 'var' ] ) self . IE_menu = { '01Import from CSV file' : { 'cmd' : self . import_csv } , '02Export Dataset' : { 'cmd' : self . exportDataset } , '03Export All' : { 'cmd' : self . exportAll } , '04Import Sparky peak files' : { 'cmd' : self . import_chem_shift } , '05Import CcpNmr file' : { 'cmd' : self . import_ccpnmr } , '06sep' : { None : None } , '07Import CD temperature scan' : { 'cmd' : self . import_CD_tempscan } , '08Analyse temp dependence of CD data' : { 'cmd' : self . insert_CD_temp_datatab } } self . IE_menu = self . create_pulldown ( self . menu , self . IE_menu ) self . menu . add_cascade ( label = 'Import/Export' , menu = self . IE_menu [ 'var' ] ) self . mode_menu = Menu ( self . menu , tearoff = 0 ) self . doModeMenu ( ) self . menu . add_cascade ( label = 'Mode' , menu = self . mode_menu ) self . annotate_menu = { '01Edit meta data' : { 'cmd' : self . editMetaData } , '02Map dataset to structure' : { 'cmd' : self . map_datatab2structure } } self . annotate_menu = self . create_pulldown ( self . menu , self . annotate_menu ) self . menu . add_cascade ( label = 'Annotate/Map' , menu = self . annotate_menu [ 'var' ] ) self . plot_menu = Menu ( self . menu , tearoff = 0 ) self . plot_menu . add_command ( label = 'Plot options' , command = self . plotframe . plotOptions ) self . plot_menu . add_checkbutton ( label = 'Show multiple plots' , command = self . multiplePlotsOption , variable = self . display_multiple , onvalue = 1 , offvalue = 0 ) self . plot_menu . add_checkbutton ( label = 'Show all' , command = self . redrawGraph , variable = self . display_all , onvalue = 1 , offvalue = 0 ) self . plot_menu . add_checkbutton ( label = 'Compare plots' , command = self . compareAllDialog , variable = self . compare_multiple , onvalue = 1 , offvalue = 0 ) self . plot_menu . add_checkbutton ( label = 'Overlay view' , command = self . redrawGraph , variable = self . overlayPlots , onvalue = 3 , offvalue = 2 ) self . plot_menu . add ( 'separator' ) self . plot_menu . add_command ( label = 'Disable selected' , command = self . disableSelected ) self . plot_menu . add_command ( label = 'Enable selected' , command = lambda : self . disableSelected ( 1 ) ) self . plot_menu . add_command ( label = 'Delete selected' , command = lambda : self . deleteSelected ( 1 ) ) self . menu . add_cascade ( label = 'Plot' , menu = self . plot_menu ) self . fit_menu = Menu ( self . menu , tearoff = 0 ) self . fit_menu = { '01Find best model' : { 'cmd' : self . fitframe . showBestModelDialog } , '02Fit all datasets' : { 'cmd' : self . fitAll } , '03Model Designer' : { 'cmd' : self . modelDesigner } , '04Load models file' : { 'cmd' : self . loadModelsFile } } self . fit_menu = self . create_pulldown ( self . menu , self . fit_menu ) self . menu . add_cascade ( label = 'Fitting' , menu = self . fit_menu [ 'var' ] ) self . view_menu = Menu ( self . menu , tearoff = 0 ) self . view_menu . add_checkbutton ( label = 'Show fit panel' , command = self . updateView , variable = self . showfitpanel , onvalue = 1 , offvalue = 0 ) self . view_menu . add_checkbutton ( label = 'Show datasets in table' , command = self . showDatasetsTable , variable = self . showdatasetstable , onvalue = 1 , offvalue = 0 ) self . menu . add_cascade ( label = 'View' , menu = self . view_menu ) self . help_menu = { '01Online Help' : { 'cmd' : self . online_documentation } , '02About' : { 'cmd' : self . about } } self . help_menu = self . create_pulldown ( self . menu , self . help_menu ) self . menu . add_cascade ( label = 'Help' , menu = self . help_menu [ 'var' ] ) self . ekin_win . config ( menu = self . menu ) return
Create the menu bar for the application.
Create the menu bar for the application .
"""Create the menu bar for the application. """ #set up mode menu # Annotate/Map menu # #'02View all meta data':{'cmd':self.viewMetaData}, # Plot menu # Fit menu # Help menu
self