예제 #1
0
    def __init__(self, master, model, text):
        ttk.Labelframe.__init__(self, master=master, text=text)
        self.master = master
        self.model = model
        chromFrame = ttk.Labelframe(self, text="Precursor Chromatogram")
        chromFrame.grid(row=0, column=0, sticky="NWES")
        chromFrame.rowconfigure(0, weight=1)
        chromFrame.columnconfigure(0, weight=1)

        chromView = ChromatogramView.ChromatogramView(chromFrame, model)
        chromView.grid(row=0, column=0, sticky="NWES")

        msFrame = ttk.Labelframe(self, text="Precursorspectrum")
        msFrame.grid(row=0, column=1, sticky="NWES")
        msFrame.rowconfigure(0, weight=1)
        msFrame.columnconfigure(0, weight=1)

        msView = PrecursorView.PrecursorView(msFrame, model)
        msView.grid(row=0, column=0, sticky="NWES")

        msmsFrame = ttk.Labelframe(self, text="MS/MS Spectrum")
        msmsFrame.grid(row=1, column=0, columnspan=2, sticky="NWES")
        msmsFrame.rowconfigure(0, weight=1)
        msmsFrame.columnconfigure(0, weight=1)

        msmsView = SpectrumView2.SpectrumView(msmsFrame, model)
        msmsView.grid(row=0, column=0, sticky="NWES")

        self.rowconfigure(0, weight=1)
        self.rowconfigure(1, weight=1)
        self.columnconfigure(0, weight=1)
        self.columnconfigure(1, weight=1)
예제 #2
0
    def __init__(self, nbparent):
        tki.Frame.__init__(self, nbparent)

        self._notebook = nbparent

        lfopen = ttk.Labelframe(self,
                                text=' ' + lang[lng.txtSelectExisting] + ' ')
        lfopen.grid(row=0, column=0, padx=10, pady=10, sticky=tki.W + tki.E)

        b = tki.Button(lfopen,
                       text=lang[lng.txtOpen] + '...',
                       command=self._ehOpen)
        b.grid(padx=10, pady=10)

        lfnew = ttk.Labelframe(self, text=' ' + lang[lng.txtCreateNew] + ' ')
        lfnew.grid(row=1, column=0, padx=10, pady=10, sticky=tki.W + tki.E)

        cb = ttk.Combobox(lfnew, values=displaytypes, state="readonly")
        self._cb = cb
        cb.set(displaytypes[0])
        cb.grid(row=0, column=0, padx=10, pady=10)
        b = tki.Button(lfnew,
                       text=lang[lng.txtSelectName] + '...',
                       command=self._ehNew)
        b.grid(row=0, column=1, padx=10, pady=10)
    def __init__(self, master, model):
        Tkinter.Toplevel.__init__(self, master=master)
        #self.minsize(600, 300)
        self.master = master
        self.title("Define Modification")
        self.config(bg="#d9d9d9")
        self.columnconfigure(0, weight=1)
        self.columnconfigure(1, weight=0)
        self.rowconfigure(0, weight=0)
        self.rowconfigure(1, weight=1)
        self.rowconfigure(2, weight=0)

        self.elements = ["C", "H", "O", "N", "S", "P", "Na", "K", "Mg"]
        elementFrame = ttk.Labelframe(self, text="Elements")
        elementFrame.grid(row=0, column=0, columnspan=2, sticky="NWES")
        columns = 5
        self.content = {}
        for i in range(0,len(self.elements)):
            row = i/columns
            col = i%columns
            elementFrame.columnconfigure(col, weight=1)
            elementFrame.rowconfigure(row, weight=1)
            e = ElementBox(elementFrame, self.elements[i], update = self.updateComposition)
            e.grid(row=row, column=col, sticky="NWES")
            self.content[self.elements[i]] = e

        nameFrame = ttk.Labelframe(self, text="Composition")
        nameFrame.grid(row=1, column=0, sticky="NWES")
        nameFrame.columnconfigure(0, weight=1)
        nameFrame.rowconfigure(0, weight=1)

        self.compositionVar = Tkinter.StringVar()
        labelCompositon = Tkinter.Label(nameFrame, textvariable = self.compositionVar, anchor="w", justify="left")
        labelCompositon.grid(row=0, column=0, sticky="NWES")

        massFrame = ttk.Labelframe(self, text="Mass")
        massFrame.grid(row=1, column=1, sticky="NWES")
        massFrame.columnconfigure(0, weight=1)
        massFrame.rowconfigure(0, weight=1)

        self.massVar = Tkinter.StringVar()
        labelMass = Tkinter.Label(massFrame, textvariable = self.massVar, width=15)
        labelMass.grid(row=0, column=0, sticky="NWES")

        okFrame = ttk.Frame(self)
        okFrame.grid(row=2, column=0, columnspan=2, sticky="NWES")


        saveButton = Tkinter.Button(okFrame, text="Add Modification", command=self.addModification)
        cancelButton = Tkinter.Button(okFrame, text="Cancel", command=self.cancel)

        saveButton.grid(row=0, column=0, sticky="NWES")
        cancelButton.grid(row=0, column=1, sticky="NWES")
예제 #4
0
    def _setup_Display_Frame_Widgets(self):

        self.Display_Disp_Frame = ttk.Labelframe(self.parent,
                                                 text="Display",
                                                 relief=tk.GROOVE,
                                                 borderwidth=1)

        self.Display_Disp_Frame.pack(padx=10,
                                     pady=0,
                                     fill=tk.BOTH,
                                     expand=True)

        self.Display_Disp_volts_In_Frame = ttk.Labelframe(
            self.Display_Disp_Frame, text="Volts In")
        self.Display_Disp_volts_In_Frame.pack(
            side=tk.LEFT,
            padx=10,
        )
        self.eb_Display_Volts_In = ttk.Entry(self.Display_Disp_volts_In_Frame,
                                             font=('Arial', 24, 'bold'),
                                             width=8)
        self.eb_Display_Volts_In.pack()

        self.Display_Disp_volts_Out_Frame = ttk.Labelframe(
            self.Display_Disp_Frame, text="Volts Out")
        self.Display_Disp_volts_Out_Frame.pack(
            side=tk.LEFT,
            padx=10,
        )
        self.eb_Display_Volts_Out = ttk.Entry(
            self.Display_Disp_volts_Out_Frame,
            font=('Arial', 24, 'bold'),
            width=8)
        self.eb_Display_Volts_Out.pack()

        self.Display_Disp_Current_Frame = ttk.Labelframe(
            self.Display_Disp_Frame, text="Current")
        self.Display_Disp_Current_Frame.pack(
            side=tk.LEFT,
            padx=10,
        )
        self.eb_Display_Current = ttk.Entry(self.Display_Disp_Current_Frame,
                                            font=('Arial', 24, 'bold'),
                                            width=8)
        self.eb_Display_Current.pack()

        self.Output_Enable_IntVar = tk.IntVar()
        self.rb_Output_On = ttk.Radiobutton(self.Display_Disp_Frame,
                                            text="Enable Output",
                                            variable=self.Output_Enable_IntVar,
                                            value=1)
        self.rb_Output_On.pack(side=tk.LEFT, padx=10)
        self.rb_Output_On.state(["disabled"])
예제 #5
0
  def __init__(self, master=None, xscroll=False, yscroll=False, 
               label="", style="", **kw):
    Tkinter.Canvas.__init__(self, master, **kw)
    scrollbars = {
      "v": AutoScrollbar(master, grid_row=0, grid_column=1, sticky="ns"),
      "h": AutoScrollbar(master, grid_row=1, grid_column=0, sticky="ew"),
    }
    scrollbars["h"].config(orient=Tkinter.HORIZONTAL)

    print "(x,y) scroll:", xscroll, yscroll
    if(xscroll):
      self.config(xscrollcommand=scrollbars["h"].set)
      scrollbars["h"].config(command=self.xview)
    if(yscroll):
      self.config(yscrollcommand=scrollbars["v"].set)
      scrollbars["v"].config(command=self.yview)

    # make the canvas expandable
    master.grid_rowconfigure(0, weight=1)
    master.grid_columnconfigure(0, weight=1)

    # Create a frame for the contents
    if(label):
      self.frame = ttk.Labelframe(self, text=label, style=style)
    else:
      self.frame = ttk.Frame(self, style=style)
    self.frame.rowconfigure(0, weight=1)
    self.frame.columnconfigure(0, weight=1)

    # Anchor the frame to the NW corner of the canvas
    self.create_window(0, 0, anchor="nw", window=self.frame)
예제 #6
0
  def _setup_search_types_frame(self):
    frame = ttk.Labelframe(self.inner_frame, text="Search Types")
    frame["padding"] = (5,5)

    labs = [ ttk.Label(frame, text="List of Lore Structure Names:") ]
    labs.append( ttk.Label(frame, text="Lore Structures Subset:") )

    self.vars["probe_pdblist"] = Tkinter.StringVar()
    self.vars["searchabletablename"] = Tkinter.StringVar()

    entries = [ ttk.Entry(frame, textvariable=self.vars["probe_pdblist"]) ]
    entries[0].configure(width=30)
    entries.append( 
      ttk.Combobox(frame, textvariable=self.vars["searchabletablename"]) )
    #tmp = [ row["name"] for row in self.searchable ]
    entries[1]["values"] = [ row["name"] for row in self.searchable ]
    self.vars["searchabletablename"].set("All")
    print entries[1].configure()

    #print tmp

    for i in range(2):
      labs[i].grid(row=i, column=0, padx=2, pady=2, sticky="w")
      entries[i].grid(row=i, column=1, padx=2, pady=2, sticky="w")

    return frame
예제 #7
0
    def __init__(self, parent, filename, *args, **kwargs):
        tk.Toplevel.__init__(self, parent, *args, **kwargs)
        if not CUPSAVAILABLE:
            tkMessageBox.showerror('CUPS Not Available!', 'CUPS is necessary to print. Please install!',
                                   parent=self)
            self.destroy()
            return
        self.parent = parent
        self.filename = filename
        self.grab_set()
        self.wm_title("Print Code...")


        self.conn = cups.Connection()
        printerDictRef = self.conn.getPrinters()

        self.printerListFrame = ttk.Labelframe(self, text="Printers")
        self.printerList = extrawidgets.ScrollListbox(self.printerListFrame)
        for key in printerDictRef.keys():
            self.printerList.Listbox.insert(tk.END, key)
        self.printerList.pack(expand=1, fill=tk.BOTH)
        self.printerListFrame.grid(row=0, column=0, columnspan=2, sticky="NSEW")
        self.grid_columnconfigure(0, weight=1)
        self.grid_rowconfigure(0, weight=1)

        self.printButton = tk.Button(self, text="Print", command=self.sendToPrinter,
                                     width=self.BUTTONWIDTH)
        self.printButton.grid(row=1, column=0)

        self.cancelButton = tk.Button(self, text="Cancel", command=self.destroy,
                                      width=self.BUTTONWIDTH)
        self.cancelButton.grid(row=1, column=1)

        self.getPrinterSelected()
예제 #8
0
 def __init__(self, parent):
     ttk.Frame.__init__(self, parent)
     self.parent = parent
     self['padding'] = '4'
     
     self.TKvariables = {}
     
     #Read in the defaults
     for key in defaults:
         
         if key[0:5] == 'graph' or key.find('ylims') >= 0:
             self.TKvariables.update({key:[]})
             
             for val in range(len(defaults[key])):
                 self.TKvariables[key].append(tk.StringVar(value=defaults[key][val]))
                 
         else:
             self.TKvariables.update({key:tk.StringVar(value=defaults[key])})      
     
     num_vars = int(self.TKvariables['datalength'].get())
     self.datalist = list(range(1,num_vars+1))
     
     #Create a combobox containing the available COM ports        
     comlst = self.get_comlst()
     self.COMbox = ttk.Labelframe(self, text='COM port to source data from')
     self.COMcombo = ttk.Combobox(self.COMbox,  width=60, values=comlst, \
         state='readonly', textvariable=self.TKvariables['COMport'],\
         postcommand=self.updateCOMbox )
     self.COMbox.grid(row = 0, column = 0, columnspan = 5)
     self.COMcombo.grid()
     
     #Create an "about" text box
     ABOUTframe = ttk.LabelFrame(self, text = 'What it does')
     ABOUTlabel = ttk.Label(ABOUTframe, text= \
         'Graphs data coming in over the serial port in a comma '
         'seperated variable string. Hover over each option to get ' 
         'a description of what the setting does', wraplength = 140)
     ABOUTframe.grid(row=1, column = 0, rowspan = 2, columnspan = 2, \
         sticky = 'nw, se', padx= 3, pady = 5)
     CreateToolTip(ABOUTlabel,\
     "The default values can be changed by opening defaults.py with a text "
     "editor and changing the values")
     ABOUTlabel.pack()        
     
     #Create a Graph! and About buttons
     GObut = ttk.Button(self, text='Go!', command=self.goButton)
     GObut.grid(row=6, column = 0, sticky = 'we')
     ABOUTbut = ttk.Button(self, text='About', command=self.aboutButton) 
     ABOUTbut.grid(row = 6, column = 1, sticky = 'we')
     
     #Create an instance of the class for the config panel
     notebook = ConfigNotebook(self, self)
     
     #Update the state of the graphs based on the defaults and grid
     notebook.updateGraphs()     
     notebook.grid(row=1, column=3, columnspan=2, rowspan=6, sticky = 'nsew', \
             padx = 5, pady = 5)
     
     #Bind the enter key to start the program
     self.parent.bind("<Return>", lambda event:self.goButton())
예제 #9
0
    def _setup_Current_Frame_Widgets(self):

        self.Current_Disp_Frame = ttk.Labelframe(self.parent,
                                                 text="Current",
                                                 relief=tk.GROOVE,
                                                 borderwidth=1)

        self.Current_Disp_Frame.pack(padx=10,
                                     pady=0,
                                     fill=tk.BOTH,
                                     expand=True)

        self.eb_Current = ttk.Entry(self.Current_Disp_Frame,
                                    font=('Arial', 24, 'bold'),
                                    width=5)
        self.eb_Current.pack(padx=10, pady=5, side=tk.LEFT)

        self.sc_Current = tk.Scale(self.Current_Disp_Frame,
                                   from_=0,
                                   to=24,
                                   tickinterval=2,
                                   orient=tk.HORIZONTAL)
        self.sc_Current.pack(padx=10,
                             pady=5,
                             side=tk.LEFT,
                             fill=tk.X,
                             expand=True)

        self.bt_Set_Current = ttk.Button(self.Current_Disp_Frame,
                                         text="Set Current",
                                         command=self.On_bt_Set_Current_Click)
        self.bt_Set_Current.pack(padx=10, pady=10, side=tk.LEFT)
예제 #10
0
    def _setup_Volts_Frame_Widgets(self):

        self.Volts_Disp_Frame = ttk.Labelframe(self.parent,
                                               text="Volts",
                                               relief=tk.GROOVE,
                                               borderwidth=1)

        self.Volts_Disp_Frame.pack(padx=10, pady=0, fill=tk.BOTH, expand=True)

        self.eb_Volts = ttk.Entry(self.Volts_Disp_Frame,
                                  font=('Arial', 24, 'bold'),
                                  width=5)
        self.eb_Volts.pack(padx=10, pady=5, side=tk.LEFT)

        self.sc_Volts = tk.Scale(self.Volts_Disp_Frame,
                                 from_=0.0,
                                 to=24.0,
                                 resolution=0.01,
                                 tickinterval=24 / 5,
                                 orient=tk.HORIZONTAL)
        self.sc_Volts.pack(padx=10,
                           pady=5,
                           side=tk.LEFT,
                           fill=tk.X,
                           expand=True)

        self.bt_Set_Volts = ttk.Button(self.Volts_Disp_Frame,
                                       text="Set Volts",
                                       command=self.On_bt_Set_Volts_Click)
        self.bt_Set_Volts.pack(padx=10, pady=10, side=tk.LEFT)
예제 #11
0
    def _setup_Ctrl_Frame_Widgets(self):

        self.Ctrl_Frame = ttk.Labelframe(self.parent,
                                         text="Ctrl",
                                         relief=tk.GROOVE,
                                         borderwidth=1)

        self.Ctrl_Frame.pack(padx=10, pady=(0, 10), fill=tk.BOTH, expand=True)

        self.bt_On = ttk.Button(self.Ctrl_Frame,
                                text="ON",
                                command=self.On_bt_On_Click)
        self.bt_On.pack(padx=10, pady=10, side=tk.RIGHT)
        self.Output_Enable_IntVar.set(1)

        self.bt_Off = ttk.Button(self.Ctrl_Frame,
                                 text="OFF",
                                 command=self.On_bt_Off_Click)
        self.bt_Off.pack(padx=10, pady=10, side=tk.RIGHT)
        self.Output_Enable_IntVar.set(0)

        self.bt_Query = ttk.Button(self.Ctrl_Frame,
                                   text="Query",
                                   command=self.On_bt_Query_Click)
        self.bt_Query.pack(padx=10, pady=10, side=tk.RIGHT)

        self.bt_Ping = ttk.Button(self.Ctrl_Frame,
                                  text="Ping",
                                  command=self.On_bt_Ping_Click)
        self.bt_Ping.pack(padx=10, pady=10, side=tk.RIGHT)

        self.lb_Status_String_Var = tk.StringVar()
        self.lb_Status = ttk.Label(self.Ctrl_Frame,
                                   textvariable=self.lb_Status_String_Var)
        self.lb_Status.pack(padx=20, pady=10, side=tk.LEFT)
예제 #12
0
 def addLabelFrame(self, text):
     frame = ttk.Labelframe(self, text=text)
     frame.grid(row=self.i, column=0, columnspan=3, sticky="NSEW")
     self.i += 1
     frame.row = 0
     self.frames[text] = frame
     return frame
예제 #13
0
 def __init__(self,name,th,test=False):
     Tkinter.Toplevel.__init__(self)
     self.grab_set()
     self.focus_set()
     self.resizable(0,0)
     icon(self)
     
     self.t =th
     self.test=test
     self.title("Making report ...")
     
     
     self.font_normal=tkFont.Font(family='sans-serif',size=9)
     self.font_active=tkFont.Font(family='sans-serif',size=9,weight="bold")
     
     
     lf = ttk.Labelframe(self, text=name)
     lf.pack(padx=5,pady=5)
     
     self.s1 = Tkinter.Label(lf, text="Parsing mission file")
     self.s1.pack(padx=4,pady=4, anchor=Tkinter.W)
     self.s2 = Tkinter.Label(lf, text="Exporting Tree Object and counting")
     self.s2.pack(padx=4,pady=4, anchor=Tkinter.W)
     self.s3 = Tkinter.Label(lf, text="Writing report")
     self.s3.pack(padx=4,pady=4, anchor=Tkinter.W)
     
     self.t.start()
     if self.test:
         self.after(2000,self.refresh)
     else:
         self.after(200,self.refresh)
         
     self.protocol('WM_DELETE_WINDOW', self.close_checker)
예제 #14
0
    def create_input_widget(self, target_content_area):
        self.options_container = ttk.Labelframe(target_content_area)
        self.options_container.pack(side=tk.BOTTOM, fill=tk.X, padx=10)

        for index, option_name in enumerate(self.item_names):
            frame = ttk.Frame(self.options_container)
            frame.pack(fill=tk.X)
            radiobutton = ttk.Radiobutton(frame,
                                          text=option_name,
                                          variable=self.ttk_radio_button_value,
                                          command=self.on_clicked,
                                          value=self.item_values[index])
            radiobutton.bind("<ButtonRelease-3>",
                             lambda event: self.set_default_value(
                             ))  # bind right-click -> default value
            radiobutton.pack(side=LEFT)

            try:
                if self.item_descriptions[index]:
                    lbl_checkbox_desc = tk.Label(frame,
                                                 text="(%s)" %
                                                 self.item_descriptions[index],
                                                 font="-slant italic -size 9")
                    lbl_checkbox_desc.pack(side=LEFT)
            except:
                pass
    def initUI(self):
        '''
        Crea y empaqueta los windgets de la ventana, tambien se establecen las propiedades
        de la ventana 
        '''
        self.geometry('350x100+300+100')
        self.protocol("WM_DELETE_WINDOW", "onexit")
        self.resizable(0, 0)

        frmClases = ttk.Labelframe(self, text="Cracion de una clase")

        ttk.Label(frmClases, text='Nombre de la nueva clase: ').grid(row=0,
                                                                     column=0,
                                                                     pady=10)
        self.strVarNomNvaClase = tk.StringVar()
        ttk.Entry(frmClases,
                  textvariable=self.strVarNomNvaClase).grid(row=0,
                                                            column=1,
                                                            pady=10)

        frmSur = ttk.Frame(frmClases)

        ttk.Button(frmSur, text='Crear Clase',
                   command=self.comandoCrearClase).pack(side=tk.LEFT, padx=5)

        ttk.Button(frmSur, text='Cancelar',
                   command=self.hide).pack(side=tk.LEFT, padx=5)

        frmSur.grid(row=1, column=0, columnspan=2, pady=10)

        frmClases.pack(fill=tk.BOTH)
예제 #16
0
    def __init__(self, parent, controller, config, dbvar=None):
        self.widget_name = "analysispage"
        super().__init__(parent, controller, config, dbvar)
        self.engine = AnalysisPageEngine()

        self.graph_table_notebook = ttk.Notebook(self)
        self.graph_table_notebook.grid(row=0,
                                       rowspan=1,
                                       column=0,
                                       sticky="news")

        self.graph_frame = graphframe.GraphFrame(self.graph_table_notebook,
                                                 self, config)
        self.datatable = datatable.DataTable(self.graph_table_notebook, self,
                                             config)

        self.graph_table_notebook.add(self.graph_frame, text="Graph")
        self.graph_table_notebook.add(self.datatable, text="Table")

        self.query_panel = querypanel.QueryPanel(self, self, config)
        self.query_panel.grid(row=0, column=1, sticky="nw", rowspan=2)

        self.menu_pane = ttk.Labelframe(self, text="Controls")
        self.menu_pane.grid(row=1, column=0, sticky="NW")
        self.b_menu_pane()

        self.columnconfigure(0, weight=0)
        self.columnconfigure(1, weight=1)

        self.config_chain.append(self.query_panel)
예제 #17
0
    def create_input_widget(self, target_content_area): 
        self.options_container = ttk.Labelframe(target_content_area)
        self.options_container.pack(side=tk.BOTTOM, fill=tk.X, padx=10)
        
        value_list = self.prev_valid_value.split(',')
        for index, option_name in enumerate(self.item_names):
            ttk_checkbox_value = StringVar()
            
            for value in value_list:
                if value == option_name:
                    ttk_checkbox_value.set(option_name)
                    break

            frame = ttk.Frame(self.options_container)
            frame.pack(fill=tk.X)
        
            checkbox = ttk.Checkbutton(frame, variable=ttk_checkbox_value, onvalue=self.item_values[index], offvalue="")
            checkbox.config(command=self.on_clicked)
            checkbox.bind("<ButtonRelease-3>", lambda event: self.set_default_value()) # bind right-click -> default value
            checkbox.pack(side=LEFT)
            
            lbl_checkbox = tk.Label(frame, text=option_name, font = "-weight bold -size 10")
            lbl_checkbox.pack(side=LEFT)
            
            if self.item_descriptions[index]:
                lbl_checkbox_desc = tk.Label(frame, text="(%s)" % self.item_descriptions[index], font = "-slant italic -size 9")
                lbl_checkbox_desc.pack(side=LEFT)
        
            self.checkbox_value_list[option_name] = ttk_checkbox_value
예제 #18
0
    def varcaller(self):
        self.vc = ttk.Labelframe(self.inwin, text='Variant Caller')
        self.vc.place(x=self.x0, y=self.y0 + 215, height=150, width=600)
        vlabel = ["Aligner"]
        valv = ["bwa mem"]
        aligner, self.vstr, vref = [0] * 2, [0] * 2, [0] * 2
        xvl, xrl = 5, 70
        for i in range(len(valv)):
            aligner[i] = Label(self.vc, text=vlabel[i])
            aligner[i].place(x=xvl, y=10)
            self.vstr[i] = StringVar(self.vc)
            self.vstr[i].set(valv[i])  # default value
            vref[i] = OptionMenu(self.vc, self.vstr[i], valv[i])
            vref[i].place(x=xrl, y=5)
            xvl += 190
            xrl += 195

        self.sam = Label(self.vc, text="Samtools")
        self.sam.place(x=5, y=70)

        self.sam_entry = Text(self.vc)
        self.sam_entry.place(x=70, y=55, height=50, width=450)
        self.sam_entry.insert(
            END,
            'samtools mpileup -uBg --max-depth 100000 --min-MQ minMappingQuality --min-BQ minBaseQuality -f RefGenome $1.sorted.bam|bcftools call --ploidy 1 --skip-variants indels --multiallelic-caller > $1_caller.vcf'
        )
        self.sam_entry.configure(state='disabled', wrap='word')
예제 #19
0
    def __init__(self, master, model, text):
        ttk.Labelframe.__init__(self, master=master, text=text)
        self.master = master
        self.model = model

        twoDFrame = ttk.Labelframe(self, text="Feature Map")
        twoDFrame.grid(row=0, column=0, sticky="NWES")
        twoDFrame.columnconfigure(0, weight=1)
        twoDFrame.rowconfigure(0, weight=1)

        twoDView = TwoDView.TwoDView(twoDFrame, model)
        twoDView.grid(row=0, column=0, sticky="NWES")

        self.notebook = ttk.Notebook(self)
        self.notebook.grid(row=1, column=0, sticky="NWES")
        self.n1 = Notebook1(self.notebook, self.model)
        self.n2 = Notebook2(self.notebook, self.model)
        self.n3 = Notebook3(self.notebook, self.model)

        self.notebook.add(self.n1, text='Feature')
        self.notebook.add(self.n2, text='Fragment Spectrum')
        self.notebook.add(self.n3, text='Consensus Spectrum')

        self.columnconfigure(0, weight=1)
        self.rowconfigure(0, weight=1)
        self.rowconfigure(1, weight=1)
예제 #20
0
    def __init__(self, top=None):
        '''This class configures and populates the toplevel window.
           top is the toplevel containing window.'''
        _bgcolor = '#d9d9d9'  # X11 color: 'gray85'
        _fgcolor = '#000000'  # X11 color: 'black'
        _compcolor = '#d9d9d9'  # X11 color: 'gray85'
        _ana1color = '#d9d9d9'  # X11 color: 'gray85'
        _ana2color = '#ececec'  # Closest X11 color: 'gray92'
        self.style = ttk.Style()
        if sys.platform == "win32":
            self.style.theme_use('winnative')
        self.style.configure('.', background=_bgcolor)
        self.style.configure('.', foreground=_fgcolor)
        self.style.configure('.', font="TkDefaultFont")
        self.style.map('.',
                       background=[('selected', _compcolor),
                                   ('active', _ana2color)])

        top.geometry("600x450+547+130")
        top.title("New Toplevel")
        top.configure(borderwidth="3")
        top.configure(background="#d9d9d9")
        top.configure(highlightbackground="#9e9e9e")

        self.NF = ttk.Labelframe(top)
        self.NF.place(relx=0.05, rely=0.067, relheight=0.818, relwidth=0.613)
        self.NF.configure(relief='raised')
        self.NF.configure(text='''NumberField''')
        self.NF.configure(borderwidth="1")
        self.NF.configure(relief='raised')
        self.NF.configure(width=180)
        self.NF.configure(cursor="arrow")
예제 #21
0
 def multi(self):
     multi = ttk.Labelframe(self.inwin, text='Multiprocess')
     multi.place(x=self.x0 + 200, y=self.y0 + 40, height=125, width=200)
     self.Threadlabel = Label(multi, text="Num. of Threads ")
     self.Threadlabel.place(x=15, y=40)
     self.T_entry = Entry(multi)
     self.T_entry.place(x=135, y=40, height=25, width=50)
     self.T_entry.insert(END, '8')
예제 #22
0
    def buttonbox(self):
        '''
        Initializes most of the GUI components. Called by the constructor.
        '''
        self.title("Collimator")
        self.box = Frame(self)
        self.box.grid(column=0,row=0)
        self.plateHeight = 0.0
        self.collimatorBlank = 0.0
        self.collimatorBlankShape = "Circle"
        
        shapeSelectFrame=ttk.Labelframe(self.box,text="Select apperature shape")
        shapeSelectFrame.grid(row=0,column=0,padx=5,pady=5,columnspan=3)
        self.shape = StringVar()
        self.shape.set(HeightSelector.CIRCLE)
        circle = ttk.Radiobutton(shapeSelectFrame, text='Circle', variable=self.shape, value=HeightSelector.CIRCLE,command=self.selection)
        square = ttk.Radiobutton(shapeSelectFrame, text='Square', variable=self.shape, value=HeightSelector.SQUARE,command=self.selection)
        rectangle = ttk.Radiobutton(shapeSelectFrame, text='Rectangle', variable=self.shape, value=HeightSelector.RECTANGLE,command=self.selection)
        circle.grid(row=0,column=0)
        square.grid(row=0,column=1)
        rectangle.grid(row=0,column=2)
        
        self.dimensionLabel=ttk.Label(self.box,text="Diameter: ")
        self.dimensionLabel.grid(row=1,column=0)
        self.dimensionVariable=StringVar()
        self.dimensionEntry=Entry(self.box,textvariable=self.dimensionVariable)
        self.dimensionEntry.config(highlightcolor="GOLD", bd=2, highlightthickness=1, relief=GROOVE)
        self.dimensionEntry.grid(column=1,row=1)
        dimensionUnits=ttk.Label(self.box,text="mm")
        dimensionUnits.grid(row=1,column=2)
        
        self.circleImg=PhotoImage(file="circle.gif")
        self.rectangleImg=PhotoImage(file="rectangle.gif")
        self.squareImg=PhotoImage(file="square.gif")
        self.imageLabel=ttk.Label(self.box,image=self.circleImg)
        self.imageLabel.grid(row=2,column=0,columnspan=3,pady=5)

        buttonFrame=ttk.Frame(self.box)
        buttonFrame.grid(column=0,row=3,columnspan=3)
        
        w = ttk.Button(buttonFrame, text="OK", width=10, 
         command=self.ok, default=ACTIVE)
        w.grid(column=0,row=0, padx=5, pady=5,sticky=(E))
        w = ttk.Button(buttonFrame, text="cancel", width=10, 
         command=self.cancel)
        w.grid(column=1,row=0, padx=5, pady=5,sticky=(W))
        self.bind("<Return>", self.ok)
        self.bind("<Escape>", self.cancel)
        self.height = 564.5
        self.bottomLimit = 423.0
        self.topLimit = 203.7
        self.topRatio = self.height/self.topLimit
        self.bottomRatio = self.height/self.bottomLimit 
        self.squareSizes = [24.0,14.0,9.0,5.0,3.0]  #size of the square blanks in descending size
        self.circleSizes = [8.0,4.0,2.0,1.6,1.0,0.5]  #size of the circle blanks in descending size
        self.rectangleSizes = [6.0,3.0] #side of the rectangle blanks in descending size
        self.message = ""
예제 #23
0
    def __init__(self, master, model, tagparents,updateTagsView):
        Tkinter.Toplevel.__init__(self, master=master)
        self.master = master
        self.title("Edit Tags")
        self.config(bg="#d9d9d9")
        self.model = model
        self.updateTagsView = updateTagsView

        self.tagContainer = {}
        for tagparent in tagparents:
            self.tagContainer[tagparent] = set(tagparent.tags)
        self.allTags = set(self.model.currentAnalysis.analysis.all_tags)
        self.tagVars = {}
        self.editedTags = set()
        w = 600
        h = 300
        #self.minsize(w,h)

        self.maxCol = 5

        # collect tags
        self.tagCopy = {}


        frameAddTag = ttk.Labelframe(self, text="Add Tag")
        self.frameTags = ttk.Labelframe(self, text="Tags")
        frameButtons = Tkinter.Frame(self)
        frameAddTag.grid(row=0, column=0, sticky="NSEW")
        self.frameTags.grid(row=1, column=0, sticky="NSEW")
        frameButtons.grid(row=2, column=0, sticky="NSEW")

        self.entryContent = Tkinter.StringVar()
        entry = Tkinter.Entry(frameAddTag,textvariable=self.entryContent)
        entry.config(bg="white")
        buttonEntry = Tkinter.Button(frameAddTag, text="Add", command=self.addTag)
        entry.grid(row=0, column=0, sticky="NSEW")
        buttonEntry.grid(row=0, column=1)

        buttonCancel = Tkinter.Button(frameButtons, text="Cancel",command=self.pressedCancel)
        buttonOK = Tkinter.Button(frameButtons, text="OK",command=self.pressedOK)
        buttonCancel.grid(row=0, column=0)
        buttonOK.grid(row=0, column=1)
        self.paintTags()
예제 #24
0
    def __init__(self, mainWindow):

        self.colorList = []
        self.mainWindow = mainWindow

        menu = Menu(mainWindow)
        fileList = Menu(menu)

        dropDownList = menu.add_command(label="Open file dialog",
                                        command=self.openFileDialog)

        mainWin.config(menu=menu)

        self.graphFrame = Frame(mainWindow)
        self.graphFrame.pack(expand=0)
        self.TreeSelector = WidgetTreeViewTk.WidgetTreeViewTk(self)

        self.mainNote = ttk.Notebook(self.graphFrame, style="BW.TLabel")
        self.mainNote.pack(fill=BOTH, expand=1)

        # Create the several graph
        self.frame1 = ttk.Labelframe(self.mainNote,
                                     text='Power',
                                     width=100,
                                     height=100)

        self.frame2 = ttk.Labelframe(self.mainNote,
                                     text='Advanced Plot',
                                     width=100,
                                     height=100)
        self.mainNote.add(self.frame1, text="power")
        self.mainNote.add(self.frame2, text="Advanced Plot")
        self.frame2 = ttk.Frame(self.mainNote)
        self.mainNote.insert("end", self.frame2)

        self.graph = PlotGraph.PlotGraph(self.frame1)

        self.toggleFrame = Frame(self.graphFrame, width=25, height=10)
        self.toggleFrame.grid_propagate(0)
        self.toggleFrame.pack(fill=X, expand=1)

        self.graph.handleResize()
예제 #25
0
 def __init__(self, master, model):
     ttk.Frame.__init__(self, master=master)
     self.master = master
     self.model = model
     self.columnconfigure(0, weight=1)
     self.rowconfigure(0, weight=1)
     msmsFrame = ttk.Labelframe(self, text="MS/MS Spectrum")
     msmsFrame.grid(row=0, column=0, sticky="NWES")
     msmsFrame.columnconfigure(0, weight=1)
     msmsFrame.rowconfigure(0, weight=1)
     msmsView = FeatureSpectrumView.FeatureSpectrumView(msmsFrame, model)
     msmsView.grid(row=0, column=0, sticky="NWES")
예제 #26
0
 def __init__(self, master, model):
     ttk.Frame.__init__(self, master=master)
     self.master = master
     self.model = model
     self.columnconfigure(0, weight=1)
     self.rowconfigure(0, weight=1)
     consFrame = ttk.Labelframe(self, text="Consensusspectrum")
     consFrame.grid(row=0, column=0, sticky="NWES")
     consFrame.columnconfigure(0, weight=1)
     consFrame.rowconfigure(0, weight=1)
     consView = ConsensusSpectrumFrame2.ConsensusSpectrumFrame(consFrame, model)
     consView.grid(row=0, column=0, sticky="NWES")
예제 #27
0
    def __init__(self, master, model):
        ttk.Frame.__init__(self, master=master)
        self.master = master
        self.model = model

        self.columnconfigure(0, weight=1)
        self.columnconfigure(1, weight=1)
        self.rowconfigure(0, weight=1)

        chromFrame = ttk.Labelframe(self, text="Precursor Chromatogram")
        chromFrame.grid(row=0, column=0, sticky="NWES")
        chromView = FeatureChromatogramView.FeatureChromatogramView(chromFrame, model)
        chromView.grid(row=0, column=0, sticky="NWES")
        chromFrame.columnconfigure(0, weight=1)
        chromFrame.rowconfigure(0, weight=1)

        msFrame = ttk.Labelframe(self, text="Precursorspectrum")
        msFrame.grid(row=0, column=1, sticky="NWES")
        msView = FeaturePrecursorView.PrecursorView(msFrame, model)
        msView.grid(row=0, column=0, sticky="NWES")
        msFrame.columnconfigure(0, weight=1)
        msFrame.rowconfigure(0, weight=1)
예제 #28
0
    def add_option_widget(self, option_name, group_box_name=None):
        if not group_box_name:
            group_box_name = self.get_group_box_name(option_name)

        group_box = self.group_boxes.get(group_box_name, None)

        if not group_box:
            group_box = ttk.Frame(self.content_area)
            group_box = ttk.Labelframe(self.content_area, text=group_box_name)
            group_box.pack(anchor=tk.W, fill=tk.BOTH)
            self.group_boxes[group_box_name] = group_box

        self.create_option_widget(option_name, group_box)
    def __init__(self, master, model, text):
        ttk.Labelframe.__init__(self, master=master, text=text)
        self.master = master
        self.model = model

        panedWindow = Tkinter.PanedWindow(self, orient="vertical")
        panedWindow.pack(fill="both", expand=1)
        panedWindow.config(sashwidth=10)
        panedWindow.config(opaqueresize=False)
        panedWindow.config(sashrelief="raised")
        panedWindow.columnconfigure(0, weight=1)
        panedWindow.rowconfigure(0, weight=1)
        panedWindow.rowconfigure(1, weight=0)
        panedWindow.rowconfigure(2, weight=1)

        errorFrame = ttk.Labelframe(panedWindow, text="Identification errors")
        errorView = IdentificationStatsFrame.IdentificationStatsFrame(
            errorFrame, model)
        errorView.pack(expand=True, fill="both")

        peptideFrame = ttk.Labelframe(panedWindow, text="Peptide")
        peptideView = PeptideCoverageFrame.PeptideCoverageFrame(
            peptideFrame, model)
        peptideView.pack(expand=True, fill="both")

        consensusFrame = ttk.Labelframe(panedWindow, text="Consensus-Spectrum")
        consensusView = ConsensusSpectrumFrame.ConsensusSpectrumFrame(
            consensusFrame, model)
        consensusView.pack(expand=True, fill="both")

        # add panels to panedWindow
        panedWindow.add(errorFrame)
        panedWindow.add(peptideFrame)
        panedWindow.add(consensusFrame)

        panedWindow.paneconfigure(errorFrame, stretch="last")
        panedWindow.paneconfigure(peptideFrame, stretch="middle")
        panedWindow.paneconfigure(consensusFrame, stretch="first")
예제 #30
0
  def _setup_match_params(self, frame_label, labels, var_names, desc, 
                          padding=(5,5)):
    frame = ttk.Labelframe(self.inner_frame, text=frame_label)
    frame["padding"] = padding

    for i in range(len(labels)):
      my_row = self.Labelentry(
        frame, varname=var_names[i], label=labels[i], width=30)
      my_row += (ttk.Label(frame, text=desc[i]),)

      for j,el in enumerate(my_row):
        el.grid(row=i, column=j, padx=2, pady=2, sticky='W')

    return frame