def fillInUI(self, parent): if not chimera.openModels.list(): print 'No models opened' return self.selection = tkoptions.StringOption(parent, 0, 'Midas Selection', '', None) self.setupOptions(parent, row=1)
def createReportPanel(self): self.createTitle(1, "Provide Information") self.createExplanation( 1, "The information included in the Gathered Information area" " below may be insufficient to diagnose the problem." " So please provide a description of how the problem" " occurred and an email address that can used to contact" " your for more information.", height=5, width=60) ## consider using htmltext here instead of fields - no need for them, ## since they can't be changed..... self.entry_widgets = {} self.entryFrame = Tkinter.Frame(self.pInterior(1)) self.name_entry = tkoptions.StringOption(self.entryFrame, 0, 'Contact Name', None, None, balloon="Your name") self.entry_widgets['name'] = self.name_entry self.email_entry = tkoptions.StringOption( self.entryFrame, 1, 'E-mail Address', None, None, balloon= "Who to notify when the bug is fixed or to ask for additional information" ) self.entry_widgets['email'] = self.email_entry desc_label = Tkinter.Label(self.entryFrame, text="Description:", justify='right') desc_label.grid(row=2, column=0, sticky=Tkinter.E, pady=10) self.description_text = Pmw.ScrolledText(self.entryFrame, text_pyclass=HtmlText, text_relief='sunken', text_height=6, text_width=50, text_wrap='word') self.description_text.grid(row=2, column=1, sticky='news', pady=10) self.entry_widgets['description'] = self.description_text self.entryFrame.rowconfigure(2, weight=1) from chimera import help help.register(self.description_text, balloon=BugReport.ADDL_INFO) info_label = Tkinter.Label(self.entryFrame, text="Gathered \nInformation:", justify='right') info_label.grid(row=3, column=0, sticky=Tkinter.E, pady=10) self.gathered_info = Pmw.ScrolledText(self.entryFrame, text_pyclass=HtmlText, text_relief='sunken', text_height=4, text_width=50, text_wrap='word') self.gathered_info.grid(row=3, column=1, sticky='news', pady=10) self.entry_widgets['info'] = self.gathered_info help.register(self.gathered_info, balloon="Chimera-supplied information") self.file_chooser = tkoptions.InputFileOption( self.entryFrame, 4, 'File Attachment', None, None, balloon='Choose a file to upload') self.entry_widgets['filename'] = self.file_chooser self.platform_entry = tkoptions.StringOption( self.entryFrame, 5, 'Platform*', None, None, balloon="Your operating system and windowing system") self.entry_widgets['platform'] = self.platform_entry self.version_entry = tkoptions.StringOption( self.entryFrame, 6, 'Chimera Version*', None, None, balloon="Specific version of chimera") self.entry_widgets['version'] = self.version_entry self.include_model_info = Tkinter.IntVar(self.entryFrame) self.include_model_info.set(True) Tkinter.Checkbutton( self.entryFrame, variable=self.include_model_info, text="Include open model names in bug report").grid(row=7, column=0, columnspan=2) self.entryFrame.columnconfigure(1, weight=1) self.entryFrame.pack(side='top', fill='both', expand=True)
def populateGlobalFrame(self): #self.gOptionsFrame = Tkinter.Frame(self.pInfoFrame) ## autodelay, autorun, image, bgcolor self.globalOptionsLabel = Tkinter.Label(self.gOptionsFrame, text="") self.globalOptionsLabel.grid(row=0, column=0, sticky='w', padx=5, pady=20) self.gTitleOption = tkoptions.StringOption(self.gOptionsFrame, 1, 'Demo title', '', self.updateWindowTitle, balloon="Demo title", borderwidth=1) self.gDataDirOption = tkoptions.InputFileOption( self.gOptionsFrame, 2, 'Data directory', None, None, balloon='Directory containing data files', dirsOnly=True) self.gAutoDelayOption = tkoptions.StringOption( self.gOptionsFrame, 3, 'Default delay', '5', None, balloon="Time to wait before advancing to next panel", borderwidth=1) self.gAutoRunOption = tkoptions.BooleanOption( self.gOptionsFrame, 4, 'AutoRun on start', False, None, balloon="Demo starts in AutoRun mode") self.gImageOption = tkoptions.InputFileOption( self.gOptionsFrame, 5, 'Image', None, None, balloon='Image to appear in Demo window') self.gBgColorOption = tkoptions.ColorOption( self.gOptionsFrame, 6, 'Image background color', None, None, balloon="Color to appear behind image") self.gOptionsFrame.rowconfigure(7, weight=1) self.gOptionsFrame.columnconfigure(0, weight=1) self.gOptionsFrame.columnconfigure(1, weight=8) self.gOptionsFrame.columnconfigure(2, weight=2)
def populateInfoFrame(self): self.panelNB = Pmw.NoteBook(self.pInfoFrame) self.panelNB.grid(row=0, column=0, sticky='nsew') self.pInfoFrame.rowconfigure(0, weight=1) self.pInfoFrame.columnconfigure(0, weight=1) self.panelNB.add('content', tab_text='Panel Content') self.panelNB.add('options', tab_text='Panel Options') self.panelNB.add('global', tab_text='Demo Options') self.pContentFrame = self.panelNB.page('content') self.pOptionsFrame = self.panelNB.page('options') self.gOptionsFrame = self.panelNB.page('global') self.pOptionsLabel = Tkinter.Label(self.pOptionsFrame, text="") self.pOptionsLabel.grid(row=0, column=0, sticky='ew', pady=20) self.pDelayOption = tkoptions.StringOption(self.pOptionsFrame, 1, 'Panel delay', '', None, balloon = "Time to wait before advancing to next " \ "panel (overrides default delay)", borderwidth=1 ) #self.delayEntry = Pmw.EntryField(self.pOptionsFrame, labelpos='w', # labelmargin=5, # label_text = "Delay", # validate='numeric') # #self.delayEntry.grid(row=0,column=0,sticky='w') self.pOptionsFrame.rowconfigure(2, weight=1) self.pOptionsFrame.columnconfigure(0, weight=1) self.pOptionsFrame.columnconfigure(1, weight=8) self.pOptionsFrame.columnconfigure(2, weight=2) self.panelNameFrame = Tkinter.Frame(self.pContentFrame, relief=Tkinter.RIDGE) self.panelNameFrame.grid(row=0, sticky='ew', padx=10, pady=5) self.panelNameTitle = Tkinter.Label( self.panelNameFrame, text="Panel title: ", ) self.panelNameEntry = Tkinter.Entry( self.panelNameFrame, font="helvetica -14 bold", relief=Tkinter.SUNKEN, #bd=2, width=30) self.panelNameEntry.bind("<Return>", self.processPanelName) self.panelNameEntry.grid(row=0, column=1, sticky='w') #self.panelNameLabel = Tkinter.Label(self.panelNameFrame, # font="helvetica -14 bold", # relief=Tkinter.FLAT # #bd=2,) # ) #self.panelNameLabel.grid(row=0,column=1,sticky='w') #self.panelNameLabel.bind("<Double-Button-1>", self.showPanelEntry) #help.register(self.panelNameLabel, balloon="Double-click to change panel title") self.minorPane = Pmw.PanedWidget(self.pContentFrame, orient='vertical') self.minorPane.grid(row=1, column=0, columnspan=2, sticky='nsew') self.panelNameFrame.columnconfigure(0, weight=1) self.panelNameFrame.columnconfigure(1, weight=50) self.pContentFrame.rowconfigure(0, weight=1) self.pContentFrame.rowconfigure(1, weight=20) self.pContentFrame.columnconfigure(0, weight=1) self.minorPane.add('textframe', size=.5) self.minorPane.add('cmdsframe', size=.5) self.textFrame = self.minorPane.pane('textframe') self.cmdsFrame = self.minorPane.pane('cmdsframe') self.populateTextFrame() self.populateCmdsFrame()
def fillInUI(self, parent): self.receptor = tkoptions.StringOption(parent, 0, 'Receptor', '', None) self.ligands = tkoptions.StringOption(parent, 1, 'Ligands', '', None) self.setupOptions(parent, row=2)