Example #1
0
    def __init__(self, szulo, kon):
        self._kon = kon
        super().__init__(szulo)

        self._erkezett = StringVar()
        self._hatarido = StringVar()
        self._megjegyzes = StringVar()

        self._kontakt_valaszto = Valaszto("ajánlatkérő", self._kontaktszemelyek(), self)
        self._kontakt_valaszto.pack(ipadx=2, ipady=2)
        self._jelleg_valaszto = Valaszto("projekt", self._jellegek(), self)
        self._jelleg_valaszto.pack(ipadx=2, ipady=2)

        megjegyzes = LabelFrame(self, text="megjegyzés")
        Entry(megjegyzes, textvariable=self._megjegyzes, width=40).pack(ipadx=2, ipady=2, side=LEFT)
        megjegyzes.pack(ipadx=2, ipady=2, side=BOTTOM, fill=BOTH)

        self._temafelelos_valaszto = Valaszto("témafelelős", self._kontaktszemelyek(2), self)
        self._temafelelos_valaszto.pack(ipadx=2, ipady=2, side=BOTTOM)

        erkezett = LabelFrame(self, text="érkezett")
        Entry(erkezett, textvariable=self._erkezett, width=10).pack(ipadx=2, ipady=2)
        erkezett.pack(ipadx=2, ipady=2, side=LEFT)
        hatarido = LabelFrame(self, text="leadási határidő")
        Entry(hatarido, textvariable=self._hatarido, width=10).pack(ipadx=2, ipady=2)
        hatarido.pack(ipadx=2, ipady=2, side=LEFT)        
        ma = date.isoformat(date.today())
        egyhetmulva = date.isoformat(date.today() + timedelta(days=7))
        self._erkezett.set(ma)
        self._hatarido.set(egyhetmulva)
 def build_widgets(self):
     "Build the various widgets that will be used in the program."
     # Create processing frame widgets.
     self.processing_frame = LabelFrame(self, text='Processing Mode:')
     self.mode_var = StringVar(self, 'encode')
     self.decode_button = Radiobutton(self.processing_frame,
                                      text='Decode Cipher-Text',
                                      command=self.handle_radiobuttons,
                                      value='decode',
                                      variable=self.mode_var)
     self.encode_button = Radiobutton(self.processing_frame,
                                      text='Encode Plain-Text',
                                      command=self.handle_radiobuttons,
                                      value='encode',
                                      variable=self.mode_var)
     self.freeze_var = BooleanVar(self, False)
     self.freeze_button = Checkbutton(self.processing_frame,
                                      text='Freeze Key & Primer',
                                      command=self.handle_checkbutton,
                                      offvalue=False,
                                      onvalue=True,
                                      variable=self.freeze_var)
     # Create encoding frame widgets.
     self.encoding_frame = LabelFrame(self, text='Encoding Options:')
     self.chain_size_label = Label(self.encoding_frame, text='Chain Size:')
     self.chain_size_entry = Entry(self.encoding_frame)
     self.plain_text_label = Label(self.encoding_frame, text='Plain-Text:')
     self.plain_text_entry = Entry(self.encoding_frame)
     # Create input frame widgets.
     self.input_frame = LabelFrame(self, text='Input Area:')
     self.input_text = ScrolledText(self.input_frame, **self.TEXT)
     # Create output frame widgets.
     self.output_frame = LabelFrame(self, text='Output Area:')
     self.output_text = ScrolledText(self.output_frame, **self.TEXT)
Example #3
0
def statistics(df, dictionaries):
    """ фомрмирование статистик """
    global stat
    report = Toplevel()
    qty = StringVar(report)
    headers = [item for item in df if item not in ['Цена', 'Билет', 'Время']]
    q1 = LabelFrame(report, text='Качественные')
    q2 = LabelFrame(report, text='Количественные')
    choice = Combobox(q1, values=headers, textvariable=qty)
    qty.trace('w', lambda name, index, mode, sv=qty: updateBoxes(sv))
    qty.set(headers[0])
    choice.current(0)
    choice.pack(side=LEFT, padx=5, pady=5)
    q1.pack(side=TOP, padx=10, pady=10)
    choice2 = Combobox(q2, values=['Цена'])
    choice2.pack(side=LEFT, padx=5, pady=5)
    choice2.current(0)
    choice2.config(state=DISABLED)
    q2.pack(side=TOP, padx=10, pady=10)
    bframe = Frame(report)
    Button(bframe, text='Сформировать', command=lambda frame=df: text_report_old(frame))\
        .pack(side=LEFT, padx=10, pady=10)
    Button(bframe, text='Закрыть', command=lambda: report.destroy())\
        .pack(side=LEFT, padx=10, pady=10)
    bframe.pack(side=TOP)
Example #4
0
    def __init__(self, szulo, **kw):
        super().__init__(szulo, text="ajánlat", **kw)

        self._ajanlatiar = StringVar()
        self._leadva = StringVar()
        self._ervenyes = StringVar()
        self._megjegyzes = StringVar()
        self._esely = IntVar()

        rovidek = Frame(self)

        ar = LabelFrame(rovidek, text="ajánlati ár")
        self._fokusz = Entry(ar, textvariable=self._ajanlatiar, width=10)
        self._fokusz.pack(ipadx=2, ipady=2, side=LEFT)
        Label(ar, text="Ft").pack(ipadx=2, ipady=2)
        ar.pack(padx=2, ipady=2, side=LEFT)

        leadva = LabelFrame(rovidek, text="leadva")
        Entry(leadva, textvariable=self._leadva, width=10).pack(ipadx=2,
                                                                ipady=2)
        leadva.pack(ipadx=2, ipady=2, side=LEFT, padx=10)

        ervenyes = LabelFrame(rovidek, text="érvényes")
        Entry(ervenyes, textvariable=self._ervenyes, width=10).pack(ipadx=2,
                                                                    ipady=2)
        ervenyes.pack(ipadx=2, ipady=2, side=LEFT)

        rovidek.pack(ipadx=2, ipady=2, fill=BOTH)

        esely = LabelFrame(self, text="esélylatolgatás")
        Radiobutton(esely,
                    variable=self._esely,
                    text="bukott",
                    value=Esely.BUKOTT.ertek).pack(ipadx=2, ipady=2, side=LEFT)
        Radiobutton(esely,
                    variable=self._esely,
                    text="normál",
                    value=Esely.NORMAL.ertek).pack(ipadx=2, ipady=2, side=LEFT)
        Radiobutton(esely,
                    variable=self._esely,
                    text="érdekes",
                    value=Esely.ERDEKES.ertek).pack(ipadx=2,
                                                    ipady=2,
                                                    side=LEFT)
        Radiobutton(esely,
                    variable=self._esely,
                    text="végső",
                    value=Esely.VEGSO.ertek).pack(ipadx=2, ipady=2)
        esely.pack(ipadx=2, ipady=2, fill=BOTH)

        megjegyzes = LabelFrame(self, text="megjegyzés")
        Entry(megjegyzes, textvariable=self._megjegyzes,
              width=40).pack(ipadx=2, ipady=2, side=LEFT)
        megjegyzes.pack(ipadx=2, ipady=2, fill=BOTH)
Example #5
0
	def __init__(self):
		tk.Tk.__init__(self)
		self.title("Open Shop Channel Downloader - Library")
		self.geometry(f"{WIDTH}x{HEIGHT}")
		self.wait_visibility(self)
		self.outer_frame = Frame(self)
		self.outer_frame.pack(fill = "both", expand = 1, padx = 5, pady = 5)


		self.left_column = LabelFrame(self.outer_frame, text = "Apps Library")
		self.left_column.pack(side = 'left', expand = 1, fill = "both", padx = 5, pady = 5)

		self.apps_listbox = ScrolledListbox(self.left_column)
		self.apps_listbox.pack(expand = 1, fill = "both", padx = 5, pady = 5)
		self.apps_listbox.bind("<<ListboxSelect>>", self.on_selection)

		self.right_column = Frame(self.outer_frame)
		self.right_column.pack(side = 'right', expand = 0, fill = "both", padx = 5, pady = 5)

		self.metadata_frame = LabelFrame(self.right_column, text = "Application Metadata")
		self.metadata_frame.pack(side = "top", expand = 0, fill = "both")

		self.mgr = Notebook(self.metadata_frame)
		self.mgr.pack(side = "top", expand = 0, fill = "both", padx = 5, pady = 5)
		self.general_page = general_page(self.mgr)
		self.mgr.add(self.general_page, text = "General")
		self.description_page = description_page(self.mgr)
		self.mgr.add(self.description_page, text = "Description")

		self.checkbutton_frame = Frame(self.metadata_frame)
		self.checkbutton_frame.pack(side = 'top', fill = 'x', expand = 0)
		self.extract_var = tk.IntVar()
		self.extract_checkbutton = tk.Checkbutton(self.checkbutton_frame, text = "Extract Downloaded App", variable = self.extract_var)
		self.extract_checkbutton.pack(side = 'left', fill = 'x', expand = 0)

		self.filename_entry = labeledEntry('Output File', self.metadata_frame)
		self.filename_entry.pack(side = 'top', expand = 0, fill = 'x', padx = 5, pady = 5)

		self.download_button = Button(self.metadata_frame, text = "Download App")
		self.download_button.pack(side = "left", expand = 0, padx = 5, pady = 5)

		self.download_progress_bar = Progressbar(self.metadata_frame)
		self.download_progress_bar.pack(side = "left", padx = 5, pady = 5)

		self.icon_frame = LabelFrame(self.right_column, text = "Application Icon")
		self.icon_frame.pack(side = "top", expand = 1, fill = "both")
		self.icon = Label(self.icon_frame)
		self.icon.pack(fill = "both")

		self.populate()
Example #6
0
 def _build_inventory_display(self, position):
     gold_frame = LabelFrame(self._inventory_display,
                             text=s.language.treasure)
     Label(gold_frame, image=Gallery.get("penz-d2")).grid(row=0, column=0)
     Label(gold_frame,
           textvariable=self._current_player.gold).grid(row=0, column=1)
     gold_frame.grid(row=0, column=0, sticky=N + E + W + S, padx=5)
     crew_frame = LabelFrame(self._inventory_display, text=s.language.crew)
     Label(crew_frame, image=Gallery.get("crew")).grid(row=0, column=0)
     Label(crew_frame,
           textvariable=self._current_player.crew).grid(row=0, column=1)
     crew_frame.grid(row=0, column=1, sticky=N + E + W + S, padx=5)
     self._inventory_display.grid(row=position, column=0)
     self._inventory_display.columnconfigure(
         ALL, minsize=(self.master.width - 20) / 2)
Example #7
0
def settings():
    global settings_popup
    try: settings_popup.destroy()
    except: pass
    settings_styles = Style()
    settings_styles.configure(
        "SettingsLabelframe.TLabelframe.Label", font=("Verdana", 18, "normal"))
    settings_styles.configure(
        "SettingsLabelframe.TLabelframe.Label", foreground=COLORS['TEXTCOLOR'])

    settings_popup = Toplevel()
    settings_popup.title("Settings")
    settings_popup.transient(root)
    settings_popup.resizable(False, False)

    other_frame = LabelFrame(settings_popup, text="Settings", style="SettingsLabelframe.TLabelframe")
    basefreq_lbl = Label(other_frame, text="Octave")
    basefreq_om = OptionMenu(other_frame, OPTIONS['BASE_FREQ'], BASE_FREQS[-1], *BASE_FREQS)
    

    basefreq_lbl.grid(row=0, column=0, padx=5)
    basefreq_om.grid(row=0, column=1, padx=5)
    other_frame.pack(padx=15, pady=15, ipadx=5, ipady=5)

    settings_popup.mainloop()
Example #8
0
    def __init__(self, pipepanel, pipeline_name, *args, **kwargs):
        PipelineFrame.__init__(self, pipepanel, pipeline_name, *args, **kwargs)
        self.info = None

        eframe = self.eframe = LabelFrame(self, text="Options")
        #,fg=textLightColor,bg=baseColor)
        eframe.grid(row=5, column=1, sticky=W, columnspan=7, padx=10, pady=5)

        label = Label(eframe,
                      text="Pipeline")  #,fg=textLightColor,bg=baseColor)
        label.grid(row=3, column=0, sticky=W, padx=10, pady=5)
        Pipelines = ["CAPmirseq-plus"]
        Pipeline = self.Pipeline = StringVar()
        Pipeline.set(Pipelines[0])

        om = OptionMenu(eframe,
                        Pipeline,
                        *Pipelines,
                        command=self.option_controller)
        om.config()  #bg = widgetBgColor,fg=widgetFgColor)
        om["menu"].config()  #bg = widgetBgColor,fg=widgetFgColor)
        #om.pack(side=LEFT,padx=20,pady=5)
        om.grid(row=3, column=1, sticky=W, padx=10, pady=5)

        self.add_info(eframe)
Example #9
0
    def __init__(self, pipepanel, pipeline_name, *args, **kwargs) :
        PipelineFrame.__init__(self, pipepanel, pipeline_name, *args, **kwargs)
        self.info = None
        
        eframe = self.eframe = LabelFrame(self,text="Options") 
        #,fg=textLightColor,bg=baseColor)
        eframe.grid( row=5, column=1, sticky=W, columnspan=7, padx=10, pady=5 )
        
        label = Label(eframe,text="Pipeline:")#,fg=textLightColor,bg=baseColor)
        label.grid(row=3,column=0,sticky=W,padx=10,pady=5)
        Pipelines=["InitialChIPseqQC", "ChIPseq" ]
        Pipeline = self.Pipeline = StringVar()
        Pipeline.set(Pipelines[0])
        
        om = OptionMenu(eframe, Pipeline, *Pipelines, command=self.option_controller)
        om.config()#bg = widgetBgColor,fg=widgetFgColor)
        om["menu"].config()#bg = widgetBgColor,fg=widgetFgColor)
        #om.pack(side=LEFT,padx=20,pady=5)
        om.grid(row=3,column=1,sticky=W,padx=20,pady=5)

        #readtypes = ['Single', 'Paired']
        #self.readtype = readtype = StringVar()
        #readtype.set(readtypes[0])
        #readtype_menu = OptionMenu(eframe, readtype, *readtypes)
        #readtype_menu.grid(row=3, column=3, sticky=E, pady=5)
        #readtype_label = Label(eframe, text="-end   ")
        #readtype_label.grid( row=3, column=4, stick=W, pady=5)

        self.add_info(eframe)
        self.option_controller()
        self.peakinfo_fn = 'peakcall.tab'
        self.contrast_fn = 'contrast.tab'
Example #10
0
 def on_create_frame_down_lf(self, frame_name, col, row, colpad, rowpad):
     self.graph_down = LabelFrame(master=self.master, text=frame_name)
     self.graph_down.grid(column=col,
                          row=row,
                          padx=colpad,
                          pady=rowpad,
                          sticky='SE')
 def _create_label_frame(self):
     ''' Creates label frame.
     '''
     self.panel = panel = LabelFrame(self, text=TEXT_FOR_PANEL)
     panel.columnconfigure(0, weight=1)
     panel.rowconfigure(0, weight=1)
     panel.grid(row=1, column=0, padx=5, pady=5, sticky=E + W + S + N)
Example #12
0
    def popup_window(self, text, filename):
        top = Toplevel()

        info = LabelFrame(top, text=text)  #"Group Information")
        info_text = Text(
            info,
            width=50,
            height=8,
            #bg=projectBgColor,
            #fg=projectFgColor,
            font=("nimbus mono bold", "11"))

        def savefunc():
            self.writepaste(filename, info_text)

        def loadfunc():
            self.readpaste(filename, info_text)

        info_save_button = Button(info, text="Save", command=savefunc)
        info_load_button = Button(info, text="Load", command=loadfunc)

        #self.pairs_load_button.pack( side=BOTTOM, padx=5, pady=5 )
        #self.pairs_save_button.pack( side=BOTTOM, padx=5, pady=5 )

        info_load_button.grid(row=5, column=5, padx=10, pady=5)
        info_save_button.grid(row=5, column=6, padx=10, pady=5)
        info_text.grid(row=1,
                       rowspan=3,
                       column=1,
                       columnspan=7,
                       padx=5,
                       pady=5)

        info.grid(row=7, column=0, columnspan=6, sticky=W, padx=20, pady=10)
        top.focus_force()
Example #13
0
    def __init__(self, pipepanel, pipeline_name, *args, **kwargs):
        PipelineFrame.__init__(self, pipepanel, pipeline_name, *args, **kwargs)
        self.pairs = None

        eframe = self.eframe = LabelFrame(self, text="Options")
        #,fg=textLightColor,bg=baseColor)
        eframe.grid(row=5, column=1, sticky=W, columnspan=7, padx=10, pady=5)

        label = Label(eframe,
                      text="Pipeline")  #,fg=textLightColor,bg=baseColor)
        label.grid(row=3, column=0, sticky=W, padx=10, pady=5)

        PipelineLabels = [
            'Initial QC', 'Germline', 'Somatic Tumor-Normal',
            'Somatic Tumor-Only'
        ]
        Pipelines = [
            "initialqcgenomeseq", "wgslow", 'wgs-somatic',
            'wgs-somatic-tumoronly'
        ]

        self.label2pipeline = {k: v for k, v in zip(PipelineLabels, Pipelines)}
        PipelineLabel = self.PipelineLabel = StringVar()
        Pipeline = self.Pipeline = StringVar()
        PipelineLabel.set(PipelineLabels[0])

        #om = OptionMenu(eframe, Pipeline, *Pipelines, command=self.option_controller)
        om = OptionMenu(eframe,
                        PipelineLabel,
                        *PipelineLabels,
                        command=self.option_controller)
        om.config()  #bg = widgetBgColor,fg=widgetFgColor)
        om["menu"].config()  #bg = widgetBgColor,fg=widgetFgColor)
        #om.pack(side=LEFT,padx=20,pady=5)
        om.grid(row=3, column=1, sticky=W, padx=10, pady=5)
Example #14
0
 def _build_state_display(self, position):
     state_field = LabelFrame(self,
                              text=s.language.cards,
                              relief=RAISED,
                              width=self.master.width - 31)
     state_slots_per_row = int((self.master.width - 31) / 32)
     state_slot_height = 24 + (
         (int(len(self._current_player.states) / state_slots_per_row) + 1) *
         32)
     if self._current_player.states:
         for index, state in enumerate(self._current_player.states):
             if state not in self._main_window.engine.nemKartyaStatusz:
                 if state in self._main_window.engine.eventszotar.keys():
                     origin = self._main_window.engine.eventszotar
                     prefix = "event"
                 else:
                     origin = self._main_window.engine.kincsszotar
                     prefix = "treasure"
                 icon = f"{prefix}_{self._main_window.engine.eventszotar[state].kep}_i"
                 icon = icon[(icon.find('_') + 1):]
                 button = Button(
                     state_field,
                     image=Gallery.get(icon),
                     command=lambda s=state: origin[s].megjelenik(1))
                 button.grid(row=int(index / state_slots_per_row),
                             column=index % state_slots_per_row)
         state_field.config(height=state_slot_height)
         if state_field.winfo_children():
             state_field.grid(row=position, column=0)
         state_field.grid_propagate(False)
Example #15
0
    def __init__(self, win, tabs):
        super().__init__(tabs)
        self.win = win
        self.tabs = tabs
        self.tabs.add(self, text="Stats")

        self.stats: StatsCollection = None
        self.selection: StatsCollection = None

        self._body = Frame(self)
        self._body.grid(row=0, column=0, sticky=EW, padx=PAD_X, pady=PAD_Y)

        # Load
        self._load_stats = LoadStatsFrame(self._body, self.set_stats)
        self._load_stats.grid(row=0, column=0, padx=PAD_X, pady=PAD_Y, sticky=EW)

        # Summary
        self._summary = LabelFrame(self._body, text="  Records  ")
        self._summary.grid(row=1, column=0, sticky=EW)

        self._all_counters = CountersFrame(self._summary, text="  All  ")
        self._all_counters.grid(row=0, column=0, padx=2 * PAD_X, pady=2 * PAD_Y, sticky=EW)

        self._selection_counters = CountersFrame(self._summary, text="  Selection  ")
        self._selection_counters.grid(column=1, row=0, padx=2 * PAD_X, pady=2 * PAD_Y, sticky=EW)

        # Filter
        self._filters = FilterSelectionFrame(self._body, self.get_all, self.get_selection, self.set_selection)
        self._filters.grid(row=2, column=0, sticky=EW)

        # Reports
        self._reports = ReportsFrame(self._body, self.get_selection)
        self._reports.grid(row=3, column=0, sticky=EW)
Example #16
0
    def on_create_labelframe(self,
                             frame_name,
                             col,
                             row,
                             colpad,
                             rowpad,
                             pos,
                             pic=None):

        if pic is None:

            self.panel_control_lf = LabelFrame(master=self.dev_control_panel,
                                               text=frame_name)
            self.panel_control_lf.grid(column=col,
                                       row=row,
                                       padx=colpad,
                                       pady=rowpad,
                                       sticky=pos)
        else:
            self.house_plan_lf = LabelFrame(master=self.dev_control_panel,
                                            text=frame_name)
            self.house_plan_lf.grid(column=col,
                                    row=row,
                                    padx=colpad,
                                    pady=rowpad,
                                    sticky=pos)
            img = None
            try:
                img = Image.open(
                    os.path.join(self.imgpath, str(self.plan[pic])))
                print(str(self.plan[pic]))
            except IOError:
                pass

            print(img.mode, '- - - - ', img.size)
            img.rotate(90)  # Bild Umdrehen
            img.thumbnail((self.pic_width, self.pic_height),
                          Image.ANTIALIAS)  # groesse des Bild anpassen
            img_lbl = ImageTk.PhotoImage(
                image=img
            )  # ohne dass --> UnboundLocalError: local variable 'img'

            # referenced before assignment img_lbl musst als label image zugewiesen werden
            # ohne dass - - > _tkinter.TclError: image specification must contain an odd number of elements
            self.house_lbl = Label(self.house_plan_lf, image=img_lbl)
            self.house_lbl.grid(column=0, row=0, padx=8, pady=5)
            self.house_lbl = img_lbl  # und diese Zuweisung am Ende
Example #17
0
def make_pivot(df, dicts):
    """ формирование сводной таблицы """
    report = Toplevel()
    radio = Frame(report)
    buttons = Frame(report)
    param1 = LabelFrame(radio, text='1-й параметр')
    param2 = LabelFrame(radio, text='2-й параметр')
    options = [item for item in df][:-1]
    options.pop(options.index('Цена'))
    value_var_1 = IntVar()
    value_var_2 = IntVar()
    count = 0
    for item in options:
        Radiobutton(param1, text=item, variable=value_var_1, value=count,
                    command=lambda num=value_var_1: trace_rb(num, None)) \
            .pack(side=TOP, anchor='w')
        Radiobutton(param2, text=item, variable=value_var_2, value=count,
                    command=lambda num=value_var_2: trace_rb(num, None)) \
            .pack(side=TOP, anchor='w')
        count += 1
    param1.pack(side=LEFT, padx=(20, 5), pady=(20, 10))

    res = {'Минимум': np.min, 'Максимум': np.max}
    picker = Frame(report)
    Label(picker, text='Метод агрегации') \
        .pack(side=LEFT, anchor='w', padx=10, pady=10)
    method = StringVar(report)
    m_combo = Combobox(picker,
                       values=[item for item in res.keys()],
                       textvariable=method)
    m_combo.current(0)
    m_combo.pack(side=LEFT, padx=10, pady=10, anchor='e')

    Button(buttons, text='Сформировать',
           command=lambda v0=df, v1=value_var_1, v2=value_var_2, v3=options, fr=report, m=method, m_dic=res:
           pivot_export(v0, v1, v2, v3, fr, m, m_dic)) \
        .pack(side=LEFT, anchor='w', padx=10, pady=10)
    param2.pack(side=LEFT, padx=(5, 20), pady=(20, 10))
    Button(buttons, text='Закрыть', command=lambda: report.destroy()) \
        .pack(side=RIGHT, anchor='e', padx=10, pady=10)

    radio.pack(side=TOP)
    picker.pack(side=TOP)
    buttons.pack(side=TOP)
    value_var_1.set(0)
    value_var_2.set(0)
Example #18
0
 def memory_frame(self):
     self.frame_memory = LabelFrame(self.ventana,
                                    width=250,
                                    height=220,
                                    text="Recent requests",
                                    labelanchor='n',
                                    relief='ridge')
     self.frame_memory.place(x=780, y=130 + self.despy)
Example #19
0
 def __init__(self, parent, name, del_name, label, x, y, width, height):
     self.container = LabelFrame(parent,
                                 text=label,
                                 width=width,
                                 height=height)
     parent.children[name] = parent.children.pop(del_name)
     self.container.place(x=x, y=y)
     self.buf_access = self.collect_access()
Example #20
0
    def __init__(self):
        self.BTL = [110, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 38400, 56000, 57600, 115200, 128000, 256000]  # 波特率下拉列表框内容
        self.JYW = ['NONE', 'ODD', 'EVEN', 'MARK', 'SPACE']  # 校验位下拉列表框内容
        self.SJW = [5, 6, 7, 8]  # 数据位下拉列表内容
        self.TZW = [1, 1.5, 2]  # 停止位下拉列表内容
        self.CKXX = self.read_serial_info()
        self.PZMC = ['串口号','波特率','校验位','数据位','停止位']
        self.serial_res_hex_bzw = False  # 接收数据框内容显示hex标志位
        self.serial_sen_hex_bzw = False  # 发送数据框内容显示hex标志位
        self.radiobutton_sen_ascii_click_count = 1  # 设置发送ASCII单选框点击次数为0
        self.radiobutton_sen_hex_click_count = 0  # 设置发送HEX单选框点击次数为0

        self.root = Tk(className='串口调试助手')  # 创建一个主窗体,并命名为‘串口调试助手’
        self.root.protocol('WM_DELETE_WINDOW',self.close_window)  # 实现点击窗口关闭按钮,调用self.close_window方法,关闭已经打开的串口,销毁窗口
        self.root.geometry('630x580')  # 设置窗体大小
        self.root.minsize(width=630, height=435)  # 这两句语言限制窗口不能随意变化
        self.root.maxsize(width=630, height=435)

        self.lf = LabelFrame(self.root, text='串口设置')  # 创建标签容器,并且命名为‘串口设置’
        self.lf.grid(padx=8, pady=10,ipadx=3, ipady=5,row=1,column=1,sticky='n')  # 设置标签容器在窗口中的位置

        self.text_res_con = LabelFrame(master=self.root,text='接收设置')  # 创建标签容器,并命名为接收设置
        self.text_res_con.grid(row=1,column=1,sticky='s')  # 设置标签容器在窗口中的位置

        self.text_sen_con = LabelFrame(master=self.root,text='发送设置')  # 创建标签容器,并命名为接收设置
        self.text_sen_con.grid(padx=8, pady=10,row=2,column=1,sticky='nesw')  # 设置标签容器在窗口中的位置

        self.data_rec = LabelFrame(self.root, text='数据日志')  # 创建标签容器,并且命名为‘数据日志’
        self.data_rec.grid(ipadx=3, ipady=5,row=1, column=2, sticky='e')  # 设置标签容器在窗口中的位置

        self.y_scroll = Scrollbar(self.data_rec)  # 创建接收文本框的Y轴下拉框
        self.y_scroll.pack(side=RIGHT,fill=Y)  # 确定位置

        self.result_text = Text(master=self.data_rec,height=22,width=66,yscrollcommand=self.y_scroll.set) # 创建一个多文本组件,用来显示接收的串口信息,并且配置关联滚轴
        self.result_text.pack(side=RIGHT,fill=Y)  # 设置多文本组件在窗口中的位置
        self.y_scroll.config(command=self.result_text.yview)  # 让文本框和滚轴关联起来

        self.data_sen = LabelFrame(self.root, text='数据发送')  # 创建标签容器,并且命名为‘数据日志’
        self.data_sen.grid(ipadx=3, ipady=5,row=2, column=2, sticky='w')  # 设置标签容器在窗口中的位置

        self.send_text = Text(master=self.data_sen,height=6,width=60)  # 创建一个发送文本框
        self.send_text.grid(row=1,column=1,sticky='n')  # 设置标签容器在窗口中的位置

        self.button_send = Button(self.data_sen,text='发送消息',command=self.button_send_serial_click,width=7)  # 创建一个发送文本框
        self.button_send.grid(row=1,column=2,sticky='NSEW')  # 设置串口打开按钮的位置
Example #21
0
 def __init__(self, master):
     Frame.__init__(self, master=master)
     self._main_window = self.master.master
     self._resolution_field = LabelFrame(self, text='')
     self._language_field = LabelFrame(self, text='')
     self._is_full_screen = IntVar()
     self._is_full_screen.set(self._main_window.is_full_screen.get())
     self._position_fields()
     self._resolutions = sorted(self._main_window.resolution_list)
     self._resolution_scale = Scale(self._resolution_field,
                                    from_=0,
                                    to=len(self._resolutions) - 1,
                                    orient=HORIZONTAL,
                                    resolution=1,
                                    takefocus=0,
                                    showvalue=0,
                                    length=self._main_window.width,
                                    command=self._update_resolution_button)
     self._resolution_scale.set(self._compose_scale())
     self._resolution_display = Label(self._resolution_field,
                                      text=(self._main_window.width, '×',
                                            self._main_window.height))
     self._resolution_changer = Button(
         self._resolution_field,
         textvariable=self._main_window.ui_text_variables['apply'],
         command=self._change_resolution,
         state=DISABLED)
     self._full_screen_label = Label(
         self._resolution_field,
         textvariable=self._main_window.ui_text_variables['full_screen'])
     self._full_screen_checkbox = Checkbutton(
         self._resolution_field,
         takefocus=0,
         variable=self._is_full_screen,
         command=lambda: self._resolution_changer.config(state=NORMAL))
     self._languages = self._main_window.data_reader.load_language_list()
     self._languages = [language.value.name for language in Languages]
     self._language_picker = Combobox(self._language_field,
                                      value=sorted(self._languages),
                                      takefocus=0)
     self._language_picker.set(self._main_window.language.name)
     self._language_picker.bind("<<ComboboxSelected>>", self._pick_language)
     self._position_elements()
     self.load_ui_texts()
Example #22
0
 def add_info(self, parent):
     if not self.info:
         self.info = LabelFrame(parent, text="Sample Information")
         self.groups_button = Button(self.info,
                                     text="Set Groups",
                                     command=self.popup_groups)
         self.contrasts_button = Button(self.info,
                                        text="Set Contrasts",
                                        command=self.popup_contrasts)
         self.groups_button.grid(row=5, column=5, padx=10, pady=5)
         self.contrasts_button.grid(row=5, column=6, padx=10, pady=5)
Example #23
0
 def __init__(self, master):
     Frame.__init__(self, master)
     self._main_window = self.master.master
     self._land_land_roll = False
     self._heading = Frame(self)
     self._inventory_display = Frame(self)
     self._die_field = Frame(self)
     self._score_field = LabelFrame(self)
     self._turn_order = Frame(self)
     self.die = None
     if self._main_window.is_game_in_progress.get():
         self._load_content()
Example #24
0
    def add_info(self, parent):
        if not self.info:
            self.info = LabelFrame(parent, text='Sample Information')
            self.peakinfo_button = Button(self.info,
                                          text="Set Peak Infomation",
                                          command=self.popup_peakinfo)
            self.peakinfo_button.grid(row=5, column=5, padx=10, pady=5)

            self.contrast_button = Button(self.info,
                                          text="Set Groups to compare peaks",
                                          command=self.popup_window_contrast)
            self.contrast_button.grid(row=5, column=6, padx=10, pady=5)
    def configure_gui(self):

        self.master.title("501")
        self.master.geometry("600x500")

        # function binding return key to entry box
        self.master.bind('<Return>', lambda e: self.score_Entered())

        #create frames
        self.labFrame1 = LabelFrame(self.tab1, text="Player1 Stats")
        self.labFrame2 = LabelFrame(self.tab1, text="Player2 Stats")
        self.labFrame3 = LabelFrame(self.tab1, text="Player1 Scores")
        self.labFrame4 = LabelFrame(self.tab1, text="Player2  Scores")
        self.labFrame5 = LabelFrame(self.tab1, text="Enter Scores")
        #self.labFrame6 = LabelFrame(self.master, text="Additional info")

        #make frames vis(ible
        self.labFrame1.grid(row=0, column=0, rowspan=2, sticky='ns')
        self.labFrame3.grid(row=0, column=1)
        self.labFrame4.grid(row=0, column=2)
        self.labFrame2.grid(row=0, column=3, rowspan=2, sticky='ns')
        self.labFrame5.grid(row=1, column=1, columnspan=2, sticky='ew')
Example #26
0
 def on_create_labelframe(self, frame_name, col, row, colpad, rowpad, pos):
     """
     Erstellung eines oberen Bezeichner fuer ein Element und Positionierung des Elements in einem Frame
     :param frame_name: Titel oben auf ein Objekt
     :param col: Spalten
     :param row: ZEile
     :param colpad: Innenabstand in der Spaltenrichtung
     :param rowpad: Innenabstand in der Zeilenrichtung
     :param pos: Plazierung in einem Frame ('N':Nord, 'S':Sued, 'W':West, usw.)
     :return:
     """
     self.lf = LabelFrame(master=self.master, text=frame_name)
     self.lf.grid(column=col, row=row, padx=colpad, pady=rowpad, sticky=pos)
Example #27
0
    def body(self, szulo):
        self._projekt_valaszto = Valaszto("projekt", self._projektek(), self)
        self._projekt_valaszto.set_callback(self._cim_megjelenit)
        self._projekt_valaszto.pack(ipadx=2, ipady=2)

        munkaresz = LabelFrame(self, text="munkarész")
        self._munkaresz_urlap = MunkareszUrlap(munkaresz)
        self._munkaresz_urlap.pack(ipadx=2, ipady=2)
        munkaresz.pack(fill=X, padx=2, pady=2)

        cim = LabelFrame(self, text="munkarész címe")
        self._cim_urlap = CimUrlap(cim)
        self._cim_urlap.pack(ipadx=2, ipady=2)
        self._cim_megjelenit(1)
        cim.pack(padx=2, pady=2)

        jelleg = LabelFrame(self, text="munkarész jellege")
        self._jelleg_urlap = JellegUrlap(jelleg)
        self._jelleg_urlap.pack(ipadx=2, ipady=2)
        jelleg.pack(fill=X, padx=2, pady=2)

        return self._projekt_valaszto.valaszto
Example #28
0
    def body(self, szulo):
        self._projekt_valaszto = Valaszto("megnevezés", self._projektek(),
                                          self)
        self._projekt_valaszto.set_callback(self._projekt_megjelenit)
        self._projekt_valaszto.pack(ipadx=2, ipady=2)

        megnevezes = LabelFrame(self, text="projekt neve")
        self._projekt_urlap = ProjektUrlap(megnevezes)
        self._projekt_urlap.pack(ipadx=2, ipady=2)
        self._projekt_megjelenit(1)
        megnevezes.pack(fill=X, padx=2, pady=2)

        return self._projekt_valaszto.valaszto
Example #29
0
    def create_widgets(self):
        ''' creates GUI for app '''
        # expand widget to fill the grid
        # self.columnconfigure(1, weight=1, pad=100)
        # self.rowconfigure(1, weight=1, pad=20)

        lframe = LabelFrame(self, text="Combobox", width=100, height=100)
        lframe.grid(row=1, column=1, sticky=N + S + E + W)

        self.cbov = StringVar()
        cbox = Combobox(lframe, textvariable=self.cbov)
        cbox['values'] = ('value1', 'value2', 'value3')
        # COMBO.bind('<<ComboboxSelected>>', self.ONCOMBOSELECT)
        cbox.current(0)
        cbox.grid(row=1, column=1, sticky=E + W, padx=10, pady=20)
Example #30
0
    def body(self, szulo):

        megnevezes = LabelFrame(self, text="projekt neve")
        self._projekt_urlap = ProjektUrlap(megnevezes)
        self._projekt_urlap.pack(ipadx=2, ipady=2)
        self._projekt_urlap.projektszam = "{}/{}".format(self._ev, self._szam)
        megnevezes.pack(fill=X, padx=2, pady=2)

        cim = LabelFrame(self, text="projekt címe")
        self._cim_urlap = CimUrlap(cim)
        self._cim_urlap.pack(ipadx=2, ipady=2)
        cim.pack(padx=2, pady=2)

        munkaresz = LabelFrame(self, text="munkarész")
        self._munkaresz_urlap = MunkareszUrlap(munkaresz)
        self._munkaresz_urlap.pack(ipadx=2, ipady=2)
        munkaresz.pack(fill=X, padx=2, pady=2)

        jelleg = LabelFrame(self, text="jelleg")
        self._jelleg_urlap = JellegUrlap(jelleg)
        self._jelleg_urlap.pack(ipadx=2, ipady=2)
        jelleg.pack(fill=X, padx=2, pady=2)

        return self._projekt_urlap.fokusz