Example #1
0
  def makeCcpNmrMenu(self):

    try:
      from ccpnmr.analysis.AnalysisPopup import AnalysisPopup
      haveAnalysis = True
    except ImportError:
      haveAnalysis = False

    try:
      from ccpnmr.format.gui.FormatConverter import FormatConverter
      from ccpnmr.format.gui.DataShifter import DataShifter
      haveFormatConv = True
    except ImportError:
      haveFormatConv = False
  
    menu = Menu(self.mainMenu, tearoff=0)
    
    if haveAnalysis:
      menu.add_command(label='Analysis',     shortcut='A', command=self.ccpNmrAnalysis)
    else:
      menu.add_command(label='Analysis ** NOT INSTALLED **',     shortcut='A', command=None)
    
    if haveFormatConv:
      menu.add_command(label='Format Converter',  shortcut='F', command=self.ccpNmrFormatConverter)
      menu.add_command(label='Data Shifter',    shortcut='D', command=self.ccpNmrDataShifter)
    else:
      menu.add_command(label='Format Converter ** NOT INSTALLED **',  shortcut='F', command=None)
      menu.add_command(label='Data Shifter ** NOT INSTALLED **',    shortcut='D', command=None)
 
    self.mainMenu.add_cascade(label='CcpNmr', shortcut='C', menu=menu)

    menu.options = ['Analysis','Format Converter','Data Shifter']  
    return menu
Example #2
0
  def makeProjectMenu(self):

    importsMenu = Menu(self.mainMenu, tearoff=False)
    importsMenu.add_command(label='Fasta Sequence',command=self.importFastaSeq)
    importsMenu.add_command(label='NMR-STAR 2.1.1', command=self.importNmrStar211)
    importsMenu.add_command(label='NMR-STAR 3.1', command=self.importNmrStar31)
    importsMenu.add_command(label='PDB 3.20',command=self.importPdb)
    importsMenu.add_command(label='PDB Coords',command=self.importPdbCoords)
    #importsMenu.add_command(label='CNS Distance Restraints',command=self.importCnsDistance)

    exportsMenu = Menu(self.mainMenu, tearoff=False)
    exportsMenu.add_command(label='NMR-STAR 3.1', command=self.eciFrame.exportNmrStar31)
    exportsMenu.add_command(label='PDB Coords',command=self.eciFrame.exportPdb)
    #exportsMenu.add_command(label='CNS Distance Restraints',command=self.eciFrame.exportCnsDistance)

    # Submenu of the min menu
    menu = Menu(self.mainMenu, tearoff=0)
    # Add various options to the menu and state the functions they call
    menu.add_command(label='New',     shortcut='N', command=self.newProject)
    menu.add_command(label='Open',    shortcut='O', command=self.openProject)
    menu.add_command(label='Close',   shortcut='C', command=self.closeProject)
    menu.add_command(label='Save',    shortcut='S', command=self.saveProject)
    menu.add_command(label='Save As', shortcut='A', command=self.saveAsProject)
    menu.add_cascade(label='Import',  shortcut='I', menu=importsMenu)
    menu.add_cascade(label='Export',  shortcut='E', menu=exportsMenu)
    menu.add_command(label='Quit',    shortcut='Q', command=self.quit)
    menu.add_command(label='Version', shortcut='V', command=self.showVersion)
    self.mainMenu.add_cascade(label='Project', shortcut='P', menu=menu)

    menu.options = ['New','Open','Close','Save','Save As','Import','Export','Quit','Version']  
    return menu
Example #3
0
  def viewFileMenu(self):

    # Submenu of the min menu
    menu = Menu(self.mainMenu, tearoff=0)
    # Add various options to the menu and state the functions they call
    menu.add_command(label='Prediction Graph', shortcut='G', command=self.viewGraph,
                     tipText='Show a graphical view of the poredicted backbone dihedral angles')
    self.mainMenu.add_cascade(label='View', shortcut='V', menu=menu)

    menu.options = ['Prediction Graph']  
    return menu
Example #4
0
  def makeOtherMenu(self):
    
    # The fonts menu is a pre-created widget
    fontsMenu = FontMenu(self.mainMenu, self.setFont, sizes=(8,10,12),
                         doItalic=0, doBoldItalic=0, tearoff=0)

    # Submenu of the min menu
    menu = Menu(self.mainMenu, tearoff=0)
    # Only Fonts option so far
    menu.add_cascade(label='Fonts',          shortcut='F', menu=fontsMenu)
    self.mainMenu.add_cascade(label='Options', shortcut='O', menu=menu)

    menu.options = ['Fonts',]
    return menu
Example #5
0
    def makeProjectMenu(self):

        # Submenu of the min menu
        menu = Menu(self.mainMenu, tearoff=0)
        menu.add_command(label='Save', shortcut='S', command=self.saveProject)
        menu.add_command(label='Save As',
                         shortcut='A',
                         command=self.saveAsProject)
        menu.add_command(label='Quit', shortcut='Q', command=self.quit)
        menu.add_command(label='Version',
                         shortcut='V',
                         command=self.showVersion)
        self.mainMenu.add_cascade(label='Project', shortcut='P', menu=menu)

        menu.options = ['Save', 'Save As', 'Quit', 'Version']
        return menu
Example #6
0
  def makeProjectMenu(self):

    # Submenu of the min menu
    menu = Menu(self.mainMenu, tearoff=0)
    # Add various options to the menu and state the functions they call
    menu.add_command(label='New',     shortcut='N', command=self.newProject)
    menu.add_command(label='Open',    shortcut='O', command=self.openProject)
    menu.add_command(label='Close',   shortcut='C', command=self.closeProject)
    menu.add_command(label='Save',    shortcut='S', command=self.saveProject)
    menu.add_command(label='Save As', shortcut='A', command=self.saveAsProject)
    menu.add_command(label='Quit',    shortcut='Q', command=self.quit)
    menu.add_command(label='Version', shortcut='V', command=self.showVersion)
    self.mainMenu.add_cascade(label='Project', shortcut='P', menu=menu)

    menu.options = ['New','Open','Close','Save','Save As','Quit','Version']  
    return menu
Example #7
0
  def makeAppearanceMenu(self):
    
    # The fonts menu is a pre-created widget
    fontsMenu = FontMenu(self.mainMenu, self.setFont, sizes=(8,10,12),
                         doItalic=0, doBoldItalic=0, tearoff=0)

    # Plot color schemes
    colorMenu = Menu(self.mainMenu, tearoff=0)
    colorMenu.add_radiobutton(label='Red', command=self.colorSchemeRed,)
    colorMenu.add_radiobutton(label='Rainbow', command=self.colorSchemeRainbow,)
    #colorMenu.add_radiobutton(label='Black',   shortcut='B', command=self.colorSchemeBlack)
    #colorMenu.add_radiobutton(label='White',   shortcut='W', command=self.colorSchemeWhite)

    # Submenu of the main menu
    menu = Menu(self.mainMenu, tearoff=0)
    # Only Fonts option so far
    menu.add_cascade(label='Plot Colour Scheme',shortcut='C', menu=colorMenu)
    menu.add_cascade(label='Fonts',             shortcut='F', menu=fontsMenu)
    self.mainMenu.add_cascade(label='Appearance', shortcut='A', menu=menu)

    menu.options = ['Plot Colour Scheme','Fonts']
    return menu
Example #8
0
  def makeProjectMenu(self):

    # Submenu of the min menu
    menu = Menu(self.mainMenu, tearoff=0)
    # Add various options to the menu and state the functions they call
    menu.add_command(label='New',     shortcut='N', command=self.newProject,
                     tipText='Make a new, blank CCPN project. Closes any existing project')
    menu.add_command(label='Open',    shortcut='O', command=self.openProject,
                     tipText='Open a new CCPN project from disk, closing any existing project')
    menu.add_command(label='Close',   shortcut='C', command=self.closeProject,
                     tipText='Close the current CCPN project')
    menu.add_command(label='Save',    shortcut='S', command=self.saveProject,
                     tipText='Save the current CCPN prjoject at its pre-specified location')
    menu.add_command(label='Save As', shortcut='A', command=self.saveAsProject,
                     tipText='Save the current CCPN project at a new location')
    menu.add_command(label='Quit',    shortcut='Q', command=self.quit,
                     tipText='Exit from the DANGLE program')
    menu.add_command(label='Version', shortcut='V', command=self.showVersion)
    self.mainMenu.add_cascade(label='Project', shortcut='P', menu=menu)

    menu.options = ['New','Open','Close','Save','Save As','Quit','Version']  
    return menu
Example #9
0
 def makeUserMenu(self):
     menu = Menu(self.mainMenu, tearoff=0)
     menu.add_command(label='Log In',
                      shortcut='I',
                      command=self.openLoginPopup)
     menu.add_command(label='Log Out', shortcut='O', command=self.logout)
     menu.add_command(label='Save Profile',
                      shortcut='S',
                      command=self.tmpCall)
     menu.add_command(label='View Profile',
                      shortcut='V',
                      command=self.tmpCall)
     menu.add_command(label='Create Profile',
                      shortcut='C',
                      command=self.tmpCall)
     menu.add_command(label='Edit Profile',
                      shortcut='E',
                      command=self.tmpCall)
     self.mainMenu.add_cascade(label='User', shortcut='U', menu=menu)
     menu.options = [
         'Log In', 'Log Out', 'Save Profile', 'View Profile',
         'Create Profile', 'Edit Profile'
     ]
     return menu