def __init__(self, parent): WindowTab.__init__(self, parent) # Create the 3 views self.outer_panedwindow = ttk.Panedwindow(self, orient=Tk.VERTICAL) self.outer_panedwindow.pack(side=Tk.TOP, fill=Tk.BOTH, expand=True) self.inner_panedwindow = ttk.Panedwindow(self.outer_panedwindow, orient=Tk.HORIZONTAL) self.outer_panedwindow.add(self.inner_panedwindow) # A byte range tree on the left self.byte_range_tree = ByteRangeView(self.inner_panedwindow) self.byte_range_tree.select_callback = self.header_selected self.byte_range_tree.open_callback = self.block_opened self.byte_range_tree.configure(width=200, height=100, padding=5) self.inner_panedwindow.add(self.byte_range_tree) # A table of header key-value pairs on the right self.header_table = FieldValueView(self.inner_panedwindow) self.header_table.select_callback = self.field_selected self.header_table.configure(width=100, height=100, padding=5) self.inner_panedwindow.add(self.header_table) # A byte table at the bottom self.bytes_table = BytesView(self.outer_panedwindow) self.bytes_table.configure(width=300, height=100, padding=5) self.outer_panedwindow.add(self.bytes_table)
def __init__(self, master): ''' Main user interface for the application with the following master-slave relationship: master panedwindow canvas sidebar random button ''' master.title("Gravitationally") master.resizable(False, False) # create empty space attribute self.space = Space.Space() # config master and panedwindow self.master = master self.panedwindow = ttk.Panedwindow(master, orient = HORIZONTAL) self.panedwindow.pack(fill = BOTH, expand = True) # config sidebar and canvas self.canvas = Canvas(self.panedwindow, width = 800, height = 640, background = 'black') self.sidebar = ttk.Frame(self.panedwindow, width = 150, height = 300) self.panedwindow.add(self.sidebar) self.panedwindow.add(self.canvas) # config mouse button press on canvas self.canvas.bind('<ButtonPress>', self.canvasPress) # config random button ttk.Button(self.sidebar, text = 'Random', command = self.runRandomSimulation).grid(row = 1, column = 0, padx = 3, pady = 3) ttk.Button(self.sidebar, text = 'Clear', command = self.clear).grid(row = 10, column = 0, padx = 3, pady = 3)
def Main(self): mainframe = ttk.Panedwindow(self.master, orient=HORIZONTAL) self.frame1 = ttk.Frame(mainframe, padding="10 10 5 10") self.frame2 = ttk.Frame(mainframe, padding="5 10 10 10") mainframe.add(self.frame1) mainframe.add(self.frame2) mainframe.grid() self.Frame1() self.Frame2()
def initUI(self): self.parent.title("sqlite Gui test") self.makeMenu() self.pack(fill=tk.BOTH, expand=1) # two paned window self.pw = ttk.Panedwindow(self, orient=tk.HORIZONTAL) self.pw.pack(fill=tk.BOTH, expand=1) # left side of panel self.dbTree = dtv.dbTreeView(self.pw) self.dbTree.bind("<Button-1>", self.treeClick) self.pw.add(self.dbTree) # right side, to be set self.table = tv.tableView(self.pw, "", tableName="Leer") self.pw.add(self.table)
def __init__(self, parent): WindowTab.__init__(self, parent) self.search_bar = ttk.Labelframe(self, text='Filter', borderwidth=5) self.search_bar.pack(side=Tk.TOP, fill=Tk.X, expand=False) self.search_label = Tk.Label(self.search_bar, text='Pattern') self.search_label.pack(side=Tk.LEFT) self.gap = ttk.Frame(self, height=15) self.gap.pack(side=Tk.TOP, fill=Tk.X, expand=False) self.search_entry = Tk.Entry(self.search_bar) self.search_entry.pack(side=Tk.LEFT, fill=Tk.X, expand=True) self.search_entry.bind('<Return>', self.search) self.panedwindow = ttk.Panedwindow(self, orient=Tk.VERTICAL) self.panedwindow.pack(side=Tk.BOTTOM, fill=Tk.BOTH, expand=True) self.mach_o_table = TreeTable(self, 'Mach-O', columns=self.MACH_O_TABLE_COLUMNS) self.mach_o_table.tree.configure(selectmode='browse') self.mach_o_table.tree.column(self.MACH_O_TABLE_COLUMNS[1], width=75, stretch=False, anchor=Tk.E) self.mach_o_table.tree.column(self.MACH_O_TABLE_COLUMNS[2], width=75, stretch=False, anchor=Tk.E) self.mach_o_table.tree.tag_configure(self.LIGHT_BLUE_TAG_NAME, background=self.LIGHT_BLUE) self.mach_o_table.select_callback = self._mach_o_selected self.panedwindow.add(self.mach_o_table) self.symbol_table = SymbolTableView(self) self.panedwindow.add(self.symbol_table) self._mach_o_info = list() self._filter_mapping = None # map table index to mach-o info index when an entry in mach-o table is clicked
def __init__(self, parent): WindowTab.__init__(self, parent) self.search_bar = ttk.Labelframe(self, text='Filter', borderwidth=5) self.search_bar.pack(side=Tk.TOP, fill=Tk.X, expand=False) self.search_label = Tk.Label(self.search_bar, text='Pattern') self.search_label.pack(side=Tk.LEFT) self.gap = ttk.Frame(self, height=15) self.gap.pack(side=Tk.TOP, fill=Tk.X, expand=False) self.search_entry = Tk.Entry(self.search_bar) self.search_entry.pack(side=Tk.LEFT, fill=Tk.X, expand=True) self.search_entry.bind('<Return>', self.search) self.panedwindow = ttk.Panedwindow(self, orient=Tk.VERTICAL) self.panedwindow.pack(side=Tk.BOTTOM, fill=Tk.BOTH, expand=True) self.mach_o_table = TreeTable(self, 'Mach-O / Sections', columns=self.MACH_O_TABLE_COLUMNS) self.mach_o_table.tree.configure(selectmode='browse') self.mach_o_table.tree.column(self.MACH_O_TABLE_COLUMNS[1], anchor=Tk.E) self.mach_o_table.tree.column(self.MACH_O_TABLE_COLUMNS[2], anchor=Tk.E) self.mach_o_table.tree.column(self.MACH_O_TABLE_COLUMNS[3], anchor=Tk.E) self.mach_o_table.select_callback = self._mach_o_selected self.panedwindow.add(self.mach_o_table) self.string_table = StringTableView(self) self.string_table.widget.tag_configure(self.LIGHT_BLUE_TAG_NAME, background=self.LIGHT_BLUE) self.panedwindow.add(self.string_table) self._mach_o_info = list() self._filter_mapping = None self._current_segemnt = None # only used by _parse()
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 = '#d9d9d9' # X11 color: 'gray85' font10 = "-family {Copperplate Gothic Bold} -size 9 -weight " \ "bold -slant roman -underline 0 -overstrike 0" font9 = "-family {Segoe UI} -size 24 -weight normal -slant " \ "roman -underline 0 -overstrike 0" 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("955x813+589+15") top.title("Text") top.configure(background="#d9d9d9") top.configure(highlightbackground="#d9d9d9") top.configure(highlightcolor="black") self.Message1 = Message(top) self.Message1.place(relx=0.06, rely=0.01, relheight=0.1, relwidth=0.89) self.Message1.configure(background="#eb0214") self.Message1.configure(font=font9) self.Message1.configure(foreground="#00ffff") self.Message1.configure(highlightbackground="#d9d9d9") self.Message1.configure(highlightcolor="black") self.Message1.configure(text='''House Price Predictor''') self.Message1.configure(width=846) self.TPanedwindow1 = ttk.Panedwindow(top, orient="horizontal") self.TPanedwindow1.place(relx=0.06, rely=0.14, relheight=0.82, relwidth=0.88) self.TPanedwindow1_p1 = ttk.Labelframe(width=385, text='') self.TPanedwindow1.add(self.TPanedwindow1_p1) self.TPanedwindow1_p2 = ttk.Labelframe(text='') self.TPanedwindow1.add(self.TPanedwindow1_p2) self.__funcid0 = self.TPanedwindow1.bind('<Map>', self.__adjust_sash0) self.Label1 = Label(self.TPanedwindow1_p1) self.Label1.place(relx=0.03, rely=0.06, height=26, width=103) self.Label1.configure(activebackground="#f9f9f9") self.Label1.configure(activeforeground="black") self.Label1.configure(background="#d9d9d9") self.Label1.configure(disabledforeground="#a3a3a3") self.Label1.configure(foreground="#000000") self.Label1.configure(highlightbackground="#d9d9d9") self.Label1.configure(highlightcolor="black") self.Label1.configure(text='''Date of selling''') self.Entry1 = Entry(self.TPanedwindow1_p1) self.Entry1.place(relx=0.31, rely=0.06, height=24, relwidth=0.4) self.Entry1.configure(background="white") self.Entry1.configure(disabledforeground="#a3a3a3") self.Entry1.configure(font="TkFixedFont") self.Entry1.configure(foreground="#000000") self.Entry1.configure(highlightbackground="#d9d9d9") self.Entry1.configure(highlightcolor="black") self.Entry1.configure(insertbackground="black") self.Entry1.configure(selectbackground="#c4c4c4") self.Entry1.configure(selectforeground="black") self.Label2 = Label(self.TPanedwindow1_p1) self.Label2.place(relx=0.73, rely=0.06, height=26, width=108) self.Label2.configure(activebackground="#f9f9f9") self.Label2.configure(activeforeground="black") self.Label2.configure(background="#d9d9d9") self.Label2.configure(disabledforeground="#a3a3a3") self.Label2.configure(foreground="#000000") self.Label2.configure(highlightbackground="#d9d9d9") self.Label2.configure(highlightcolor="black") self.Label2.configure(text='''(YYYY-MM-DD)''') self.Label3 = Label(self.TPanedwindow1_p1) self.Label3.place(relx=0.03, rely=0.13, height=26, width=150) self.Label3.configure(activebackground="#f9f9f9") self.Label3.configure(activeforeground="black") self.Label3.configure(background="#d9d9d9") self.Label3.configure(disabledforeground="#a3a3a3") self.Label3.configure(foreground="#000000") self.Label3.configure(highlightbackground="#d9d9d9") self.Label3.configure(highlightcolor="black") self.Label3.configure(text='''Number of bedrooms''') self.Entry2 = Entry(self.TPanedwindow1_p1) self.Entry2.place(relx=0.44, rely=0.13, height=24, relwidth=0.14) self.Entry2.configure(background="white") self.Entry2.configure(disabledforeground="#a3a3a3") self.Entry2.configure(font="TkFixedFont") self.Entry2.configure(foreground="#000000") self.Entry2.configure(highlightbackground="#d9d9d9") self.Entry2.configure(highlightcolor="black") self.Entry2.configure(insertbackground="black") self.Entry2.configure(selectbackground="#c4c4c4") self.Entry2.configure(selectforeground="black") self.Label4 = Label(self.TPanedwindow1_p1) self.Label4.place(relx=0.03, rely=0.21, height=26, width=150) self.Label4.configure(activebackground="#f9f9f9") self.Label4.configure(activeforeground="black") self.Label4.configure(background="#d9d9d9") self.Label4.configure(disabledforeground="#a3a3a3") self.Label4.configure(foreground="#000000") self.Label4.configure(highlightbackground="#d9d9d9") self.Label4.configure(highlightcolor="black") self.Label4.configure(text='''Number of bathrooms''') self.Entry3 = Entry(self.TPanedwindow1_p1) self.Entry3.place(relx=0.44, rely=0.21, height=24, relwidth=0.14) self.Entry3.configure(background="white") self.Entry3.configure(disabledforeground="#a3a3a3") self.Entry3.configure(font="TkFixedFont") self.Entry3.configure(foreground="#000000") self.Entry3.configure(highlightbackground="#d9d9d9") self.Entry3.configure(highlightcolor="black") self.Entry3.configure(insertbackground="black") self.Entry3.configure(selectbackground="#c4c4c4") self.Entry3.configure(selectforeground="black") self.Label5 = Label(self.TPanedwindow1_p1) self.Label5.place(relx=0.03, rely=0.3, height=26, width=101) self.Label5.configure(activebackground="#f9f9f9") self.Label5.configure(activeforeground="black") self.Label5.configure(background="#d9d9d9") self.Label5.configure(disabledforeground="#a3a3a3") self.Label5.configure(foreground="#000000") self.Label5.configure(highlightbackground="#d9d9d9") self.Label5.configure(highlightcolor="black") self.Label5.configure(text='''Area of House''') self.Entry4 = Entry(self.TPanedwindow1_p1) self.Entry4.place(relx=0.34, rely=0.3, height=24, relwidth=0.3) self.Entry4.configure(background="white") self.Entry4.configure(disabledforeground="#a3a3a3") self.Entry4.configure(font="TkFixedFont") self.Entry4.configure(foreground="#000000") self.Entry4.configure(highlightbackground="#d9d9d9") self.Entry4.configure(highlightcolor="black") self.Entry4.configure(insertbackground="black") self.Entry4.configure(selectbackground="#c4c4c4") self.Entry4.configure(selectforeground="black") self.Label6 = Label(self.TPanedwindow1_p1) self.Label6.place(relx=0.62, rely=0.3, height=26, width=41) self.Label6.configure(activebackground="#f9f9f9") self.Label6.configure(activeforeground="black") self.Label6.configure(background="#d9d9d9") self.Label6.configure(disabledforeground="#a3a3a3") self.Label6.configure(foreground="#000000") self.Label6.configure(highlightbackground="#d9d9d9") self.Label6.configure(highlightcolor="black") self.Label6.configure(text='''(sqft)''') self.Label7 = Label(self.TPanedwindow1_p1) self.Label7.place(relx=0.03, rely=0.39, height=26, width=77) self.Label7.configure(activebackground="#f9f9f9") self.Label7.configure(activeforeground="black") self.Label7.configure(background="#d9d9d9") self.Label7.configure(disabledforeground="#a3a3a3") self.Label7.configure(foreground="#000000") self.Label7.configure(highlightbackground="#d9d9d9") self.Label7.configure(highlightcolor="black") self.Label7.configure(text='''Area of lot''') self.Entry5 = Entry(self.TPanedwindow1_p1) self.Entry5.place(relx=0.29, rely=0.39, height=24, relwidth=0.3) self.Entry5.configure(background="white") self.Entry5.configure(disabledforeground="#a3a3a3") self.Entry5.configure(font="TkFixedFont") self.Entry5.configure(foreground="#000000") self.Entry5.configure(highlightbackground="#d9d9d9") self.Entry5.configure(highlightcolor="black") self.Entry5.configure(insertbackground="black") self.Entry5.configure(selectbackground="#c4c4c4") self.Entry5.configure(selectforeground="black") self.Label8 = Label(self.TPanedwindow1_p1) self.Label8.place(relx=0.57, rely=0.39, height=26, width=41) self.Label8.configure(activebackground="#f9f9f9") self.Label8.configure(activeforeground="black") self.Label8.configure(background="#d9d9d9") self.Label8.configure(disabledforeground="#a3a3a3") self.Label8.configure(foreground="#000000") self.Label8.configure(highlightbackground="#d9d9d9") self.Label8.configure(highlightcolor="black") self.Label8.configure(text='''(sqft)''') self.Label9 = Label(self.TPanedwindow1_p1) self.Label9.place(relx=0.03, rely=0.48, height=26, width=120) self.Label9.configure(activebackground="#f9f9f9") self.Label9.configure(activeforeground="black") self.Label9.configure(background="#d9d9d9") self.Label9.configure(disabledforeground="#a3a3a3") self.Label9.configure(foreground="#000000") self.Label9.configure(highlightbackground="#d9d9d9") self.Label9.configure(highlightcolor="black") self.Label9.configure(text='''Number of floors''') self.Entry6 = Entry(self.TPanedwindow1_p1) self.Entry6.place(relx=0.39, rely=0.48, height=24, relwidth=0.14) self.Entry6.configure(background="white") self.Entry6.configure(disabledforeground="#a3a3a3") self.Entry6.configure(font="TkFixedFont") self.Entry6.configure(foreground="#000000") self.Entry6.configure(highlightbackground="#d9d9d9") self.Entry6.configure(highlightcolor="black") self.Entry6.configure(insertbackground="black") self.Entry6.configure(selectbackground="#c4c4c4") self.Entry6.configure(selectforeground="black") self.Label10 = Label(self.TPanedwindow1_p1) self.Label10.place(relx=0.03, rely=0.57, height=26, width=138) self.Label10.configure(activebackground="#f9f9f9") self.Label10.configure(activeforeground="black") self.Label10.configure(background="#d9d9d9") self.Label10.configure(disabledforeground="#a3a3a3") self.Label10.configure(foreground="#000000") self.Label10.configure(highlightbackground="#d9d9d9") self.Label10.configure(highlightcolor="black") self.Label10.configure(text='''Waterfront present?''') self.Label11 = Label(self.TPanedwindow1_p1) self.Label11.place(relx=0.03, rely=0.66, height=26, width=139) self.Label11.configure(activebackground="#f9f9f9") self.Label11.configure(activeforeground="black") self.Label11.configure(background="#d9d9d9") self.Label11.configure(disabledforeground="#a3a3a3") self.Label11.configure(foreground="#000000") self.Label11.configure(highlightbackground="#d9d9d9") self.Label11.configure(highlightcolor="black") self.Label11.configure(text=''''View' rated out of 5''') self.Scale1 = Scale(self.TPanedwindow1_p1) self.Scale1.place(relx=0.42, rely=0.63, relwidth=0.33, relheight=0.0, height=47) self.Scale1.configure(activebackground="#d9d9d9") self.Scale1.configure(background="#d9d9d9") self.Scale1.configure(font="TkTextFont") self.Scale1.configure(foreground="#000000") self.Scale1.configure(highlightbackground="#d9d9d9") self.Scale1.configure(highlightcolor="black") self.Scale1.configure(length="120") self.Scale1.configure(orient="horizontal") self.Scale1.configure(to="5.0") self.Scale1.configure(troughcolor="#d9d9d9") self.Label12 = Label(self.TPanedwindow1_p1) self.Label12.place(relx=0.03, rely=0.77, height=26, width=172) self.Label12.configure(activebackground="#f9f9f9") self.Label12.configure(activeforeground="black") self.Label12.configure(background="#d9d9d9") self.Label12.configure(disabledforeground="#a3a3a3") self.Label12.configure(foreground="#000000") self.Label12.configure(highlightbackground="#d9d9d9") self.Label12.configure(highlightcolor="black") self.Label12.configure(text=''''Condition' rated out of 5''') self.Scale2 = Scale(self.TPanedwindow1_p1) self.Scale2.place(relx=0.49, rely=0.74, relwidth=0.33, relheight=0.0, height=47) self.Scale2.configure(activebackground="#d9d9d9") self.Scale2.configure(background="#d9d9d9") self.Scale2.configure(font="TkTextFont") self.Scale2.configure(foreground="#000000") self.Scale2.configure(highlightbackground="#d9d9d9") self.Scale2.configure(highlightcolor="black") self.Scale2.configure(length="120") self.Scale2.configure(orient="horizontal") self.Scale2.configure(to="5.0") self.Scale2.configure(troughcolor="#d9d9d9") self.Radiobutton1 = Radiobutton(self.TPanedwindow1_p1) self.Radiobutton1.place(relx=0.47, rely=0.57, relheight=0.05, relwidth=0.13) self.Radiobutton1.configure(activebackground="#d9d9d9") self.Radiobutton1.configure(activeforeground="#000000") self.Radiobutton1.configure(background="#d9d9d9") self.Radiobutton1.configure(disabledforeground="#a3a3a3") self.Radiobutton1.configure(foreground="#000000") self.Radiobutton1.configure(highlightbackground="#d9d9d9") self.Radiobutton1.configure(highlightcolor="black") self.Radiobutton1.configure(justify=LEFT) self.Radiobutton1.configure(text='''Yes''') self.Radiobutton1.configure(value="0") self.Radiobutton1.configure(variable=test1_support.v) self.Radiobutton2 = Radiobutton(self.TPanedwindow1_p1) self.Radiobutton2.place(relx=0.62, rely=0.57, relheight=0.05, relwidth=0.13) self.Radiobutton2.configure(activebackground="#d9d9d9") self.Radiobutton2.configure(activeforeground="#000000") self.Radiobutton2.configure(background="#d9d9d9") self.Radiobutton2.configure(disabledforeground="#a3a3a3") self.Radiobutton2.configure(foreground="#000000") self.Radiobutton2.configure(highlightbackground="#d9d9d9") self.Radiobutton2.configure(highlightcolor="black") self.Radiobutton2.configure(justify=LEFT) self.Radiobutton2.configure(text='''No''') self.Radiobutton2.configure(value="1") self.Radiobutton2.configure(variable=test1_support.v) self.Label13 = Label(self.TPanedwindow1_p2) self.Label13.place(relx=0.02, rely=0.06, height=46, width=196) self.Label13.configure(activebackground="#f9f9f9") self.Label13.configure(activeforeground="black") self.Label13.configure(background="#d9d9d9") self.Label13.configure(disabledforeground="#a3a3a3") self.Label13.configure(foreground="#000000") self.Label13.configure(highlightbackground="#d9d9d9") self.Label13.configure(highlightcolor="black") self.Label13.configure(text='''Grade (based on King County grading system)''') self.Entry7 = Entry(self.TPanedwindow1_p2) self.Entry7.place(relx=0.51, rely=0.07, height=24, relwidth=0.14) self.Entry7.configure(background="white") self.Entry7.configure(disabledforeground="#a3a3a3") self.Entry7.configure(font="TkFixedFont") self.Entry7.configure(foreground="#000000") self.Entry7.configure(highlightbackground="#d9d9d9") self.Entry7.configure(highlightcolor="black") self.Entry7.configure(insertbackground="black") self.Entry7.configure(selectbackground="#c4c4c4") self.Entry7.configure(selectforeground="black") self.Label14 = Label(self.TPanedwindow1_p2) self.Label14.place(relx=0.02, rely=0.16, height=26, width=242) self.Label14.configure(activebackground="#f9f9f9") self.Label14.configure(activeforeground="black") self.Label14.configure(background="#d9d9d9") self.Label14.configure(disabledforeground="#a3a3a3") self.Label14.configure(foreground="#000000") self.Label14.configure(highlightbackground="#d9d9d9") self.Label14.configure(highlightcolor="black") self.Label14.configure(justify=LEFT) self.Label14.configure(text='''Area of house apart from basement''') self.Entry8 = Entry(self.TPanedwindow1_p2) self.Entry8.place(relx=0.59, rely=0.16, height=24, relwidth=0.12) self.Entry8.configure(background="white") self.Entry8.configure(disabledforeground="#a3a3a3") self.Entry8.configure(font="TkFixedFont") self.Entry8.configure(foreground="#000000") self.Entry8.configure(highlightbackground="#d9d9d9") self.Entry8.configure(highlightcolor="black") self.Entry8.configure(insertbackground="black") self.Entry8.configure(selectbackground="#c4c4c4") self.Entry8.configure(selectforeground="black") self.Label15 = Label(self.TPanedwindow1_p2) self.Label15.place(relx=0.7, rely=0.16, height=26, width=41) self.Label15.configure(activebackground="#f9f9f9") self.Label15.configure(activeforeground="black") self.Label15.configure(background="#d9d9d9") self.Label15.configure(disabledforeground="#a3a3a3") self.Label15.configure(foreground="#000000") self.Label15.configure(highlightbackground="#d9d9d9") self.Label15.configure(highlightcolor="black") self.Label15.configure(text='''(sqft)''') self.Label16 = Label(self.TPanedwindow1_p2) self.Label16.place(relx=0.02, rely=0.24, height=26, width=124) self.Label16.configure(activebackground="#f9f9f9") self.Label16.configure(activeforeground="black") self.Label16.configure(background="#d9d9d9") self.Label16.configure(disabledforeground="#a3a3a3") self.Label16.configure(foreground="#000000") self.Label16.configure(highlightbackground="#d9d9d9") self.Label16.configure(highlightcolor="black") self.Label16.configure(text='''Area of basement''') self.Entry9 = Entry(self.TPanedwindow1_p2) self.Entry9.place(relx=0.33, rely=0.24, height=24, relwidth=0.12) self.Entry9.configure(background="white") self.Entry9.configure(disabledforeground="#a3a3a3") self.Entry9.configure(font="TkFixedFont") self.Entry9.configure(foreground="#000000") self.Entry9.configure(highlightbackground="#d9d9d9") self.Entry9.configure(highlightcolor="black") self.Entry9.configure(insertbackground="black") self.Entry9.configure(selectbackground="#c4c4c4") self.Entry9.configure(selectforeground="black") self.Label17 = Label(self.TPanedwindow1_p2) self.Label17.place(relx=0.44, rely=0.24, height=26, width=41) self.Label17.configure(activebackground="#f9f9f9") self.Label17.configure(activeforeground="black") self.Label17.configure(background="#d9d9d9") self.Label17.configure(disabledforeground="#a3a3a3") self.Label17.configure(foreground="#000000") self.Label17.configure(highlightbackground="#d9d9d9") self.Label17.configure(highlightcolor="black") self.Label17.configure(text='''(sqft)''') self.Label18 = Label(self.TPanedwindow1_p2) self.Label18.place(relx=0.02, rely=0.31, height=26, width=69) self.Label18.configure(activebackground="#f9f9f9") self.Label18.configure(activeforeground="black") self.Label18.configure(background="#d9d9d9") self.Label18.configure(disabledforeground="#a3a3a3") self.Label18.configure(foreground="#000000") self.Label18.configure(highlightbackground="#d9d9d9") self.Label18.configure(highlightcolor="black") self.Label18.configure(text='''Year built''') self.Entry10 = Entry(self.TPanedwindow1_p2) self.Entry10.place(relx=0.33, rely=0.31, height=24, relwidth=0.21) self.Entry10.configure(background="white") self.Entry10.configure(disabledforeground="#a3a3a3") self.Entry10.configure(font="TkFixedFont") self.Entry10.configure(foreground="#000000") self.Entry10.configure(highlightbackground="#d9d9d9") self.Entry10.configure(highlightcolor="black") self.Entry10.configure(insertbackground="black") self.Entry10.configure(selectbackground="#c4c4c4") self.Entry10.configure(selectforeground="black") self.Label19 = Label(self.TPanedwindow1_p2) self.Label19.place(relx=0.02, rely=0.39, height=26, width=106) self.Label19.configure(activebackground="#f9f9f9") self.Label19.configure(activeforeground="black") self.Label19.configure(background="#d9d9d9") self.Label19.configure(disabledforeground="#a3a3a3") self.Label19.configure(foreground="#000000") self.Label19.configure(highlightbackground="#d9d9d9") self.Label19.configure(highlightcolor="black") self.Label19.configure(text='''Year renovated''') self.Entry11 = Entry(self.TPanedwindow1_p2) self.Entry11.place(relx=0.33, rely=0.39, height=24, relwidth=0.21) self.Entry11.configure(background="white") self.Entry11.configure(disabledforeground="#a3a3a3") self.Entry11.configure(font="TkFixedFont") self.Entry11.configure(foreground="#000000") self.Entry11.configure(highlightbackground="#d9d9d9") self.Entry11.configure(highlightcolor="black") self.Entry11.configure(insertbackground="black") self.Entry11.configure(selectbackground="#c4c4c4") self.Entry11.configure(selectforeground="black") self.Label20 = Label(self.TPanedwindow1_p2) self.Label20.place(relx=0.02, rely=0.46, height=26, width=61) self.Label20.configure(activebackground="#f9f9f9") self.Label20.configure(activeforeground="black") self.Label20.configure(background="#d9d9d9") self.Label20.configure(disabledforeground="#a3a3a3") self.Label20.configure(foreground="#000000") self.Label20.configure(highlightbackground="#d9d9d9") self.Label20.configure(highlightcolor="black") self.Label20.configure(text='''Zipcode''') self.Entry12 = Entry(self.TPanedwindow1_p2) self.Entry12.place(relx=0.2, rely=0.46, height=24, relwidth=0.29) self.Entry12.configure(background="white") self.Entry12.configure(disabledforeground="#a3a3a3") self.Entry12.configure(font="TkFixedFont") self.Entry12.configure(foreground="#000000") self.Entry12.configure(highlightbackground="#d9d9d9") self.Entry12.configure(highlightcolor="black") self.Entry12.configure(insertbackground="black") self.Entry12.configure(selectbackground="#c4c4c4") self.Entry12.configure(selectforeground="black") self.Label21 = Label(self.TPanedwindow1_p2) self.Label21.place(relx=0.02, rely=0.54, height=26, width=60) self.Label21.configure(activebackground="#f9f9f9") self.Label21.configure(activeforeground="black") self.Label21.configure(background="#d9d9d9") self.Label21.configure(disabledforeground="#a3a3a3") self.Label21.configure(foreground="#000000") self.Label21.configure(highlightbackground="#d9d9d9") self.Label21.configure(highlightcolor="black") self.Label21.configure(text='''Latitude''') self.Entry13 = Entry(self.TPanedwindow1_p2) self.Entry13.place(relx=0.2, rely=0.54, height=24, relwidth=0.47) self.Entry13.configure(background="white") self.Entry13.configure(disabledforeground="#a3a3a3") self.Entry13.configure(font="TkFixedFont") self.Entry13.configure(foreground="#000000") self.Entry13.configure(highlightbackground="#d9d9d9") self.Entry13.configure(highlightcolor="black") self.Entry13.configure(insertbackground="black") self.Entry13.configure(selectbackground="#c4c4c4") self.Entry13.configure(selectforeground="black") self.Label22 = Label(self.TPanedwindow1_p2) self.Label22.place(relx=0.02, rely=0.61, height=26, width=73) self.Label22.configure(activebackground="#f9f9f9") self.Label22.configure(activeforeground="black") self.Label22.configure(background="#d9d9d9") self.Label22.configure(disabledforeground="#a3a3a3") self.Label22.configure(foreground="#000000") self.Label22.configure(highlightbackground="#d9d9d9") self.Label22.configure(highlightcolor="black") self.Label22.configure(text='''Longitude''') self.Entry14 = Entry(self.TPanedwindow1_p2) self.Entry14.place(relx=0.2, rely=0.61, height=24, relwidth=0.47) self.Entry14.configure(background="white") self.Entry14.configure(disabledforeground="#a3a3a3") self.Entry14.configure(font="TkFixedFont") self.Entry14.configure(foreground="#000000") self.Entry14.configure(highlightbackground="#d9d9d9") self.Entry14.configure(highlightcolor="black") self.Entry14.configure(insertbackground="black") self.Entry14.configure(selectbackground="#c4c4c4") self.Entry14.configure(selectforeground="black") self.Predictor = Button(self.TPanedwindow1_p2) self.Predictor.place(relx=0.31, rely=0.73, height=63, width=126) self.Predictor.configure(activebackground="#d9d9d9") self.Predictor.configure(activeforeground="#000000") self.Predictor.configure(background="#00ffff") self.Predictor.configure(command=self.getVals) self.Predictor.configure(disabledforeground="#a3a3a3") self.Predictor.configure(font=font10) self.Predictor.configure(foreground="#eb0214") self.Predictor.configure(highlightbackground="#d9d9d9") self.Predictor.configure(highlightcolor="black") self.Predictor.configure(pady="0") self.Predictor.configure(text='''Predict!''')
def Frame2(self): F2 = ttk.Panedwindow(self.frame2, orient=VERTICAL) self.status=ttk.Frame(F2) F2.add(self.status) # F2.config(width=1024,height=500) F2.grid()
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = 'wheat' # X11 color: #f5deb3 _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#b2c9f4' # Closest X11 color: 'SlateGray2' _ana1color = '#eaf4b2' # Closest X11 color: '{pale goldenrod}' _ana2color = '#f4bcb2' # Closest X11 color: 'RosyBrown2' font10 = "-family {DejaVu Sans Mono} -size 14 -weight normal " \ "-slant roman -underline 0 -overstrike 0" font11 = "TkDefaultFont" font9 = "-family {DejaVu Sans} -size 14 -weight normal -slant " \ "roman -underline 0 -overstrike 0" 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=font9) self.style.map('.',background= [('selected', _compcolor), ('active',_ana2color)]) top.geometry("600x881+650+150") top.title("New Toplevel 1") top.configure(background="wheat") top.configure(highlightbackground="wheat") top.configure(highlightcolor="black") self.TButton1 = ttk.Button(top) self.TButton1.place(relx=0.02, rely=0.02, height=32, width=92) self.TButton1.configure(takefocus="") self.TButton1.configure(text='''Tbutton''') self.style.map('TCheckbutton',background= [('selected', _bgcolor), ('active',"_ana2color")]) self.TCheckbutton1 = ttk.Checkbutton(top) self.TCheckbutton1.place(relx=0.03, rely=0.08, relwidth=0.12 , relheight=0.0, height=25) self.TCheckbutton1.configure(variable=themed_support.tch36) self.TCheckbutton1.configure(takefocus="") self.TCheckbutton1.configure(text='''Tcheck''') self.TCombobox1 = ttk.Combobox(top) self.TCombobox1.place(relx=0.03, rely=0.14, relheight=0.02, relwidth=0.3) self.TCombobox1.configure(textvariable=themed_support.combobox) self.TCombobox1.configure(takefocus="") self.TEntry1 = ttk.Entry(top) self.TEntry1.place(relx=0.05, rely=0.19, relheight=0.02, relwidth=0.27) self.TEntry1.configure(takefocus="") self.TEntry1.configure(cursor="xterm") self.TFrame1 = ttk.Frame(top) self.TFrame1.place(relx=0.05, rely=0.24, relheight=0.09, relwidth=0.21) self.TFrame1.configure(relief=GROOVE) self.TFrame1.configure(borderwidth="2") self.TFrame1.configure(relief=GROOVE) self.TFrame1.configure(width=125) self.TLabelframe1 = ttk.Labelframe(top) self.TLabelframe1.place(relx=0.05, rely=0.39, relheight=0.09 , relwidth=0.25) self.TLabelframe1.configure(text='''Tlabelframe''') self.TLabelframe1.configure(width=150) self.TProgressbar1 = ttk.Progressbar(top) self.TProgressbar1.place(relx=0.45, rely=0.64, relwidth=0.17 , relheight=0.0, height=19) self.style.map('TRadiobutton',background= [('selected', _bgcolor), ('active',"_ana2color")]) self.TRadiobutton1 = ttk.Radiobutton(top) self.TRadiobutton1.place(relx=0.73, rely=0.64, relwidth=0.16 , relheight=0.0, height=23) self.TRadiobutton1.configure(takefocus="") self.TRadiobutton1.configure(text='''TRadio''') self.TScale1 = ttk.Scale(top) self.TScale1.place(relx=0.85, rely=0.41, relwidth=0.0, relheight=0.11 , width=17) self.TScale1.configure(orient="vertical") self.TScale1.configure(takefocus="") self.TScale2 = ttk.Scale(top) self.TScale2.place(relx=0.45, rely=0.68, relwidth=0.17, relheight=0.0 , height=17) self.TScale2.configure(takefocus="") self.Scrolledlistbox1 = ScrolledListBox(top) self.Scrolledlistbox1.place(relx=0.05, rely=0.76, relheight=0.07 , relwidth=0.19) self.Scrolledlistbox1.configure(background="white") self.Scrolledlistbox1.configure(disabledforeground="#b8a786") self.Scrolledlistbox1.configure(font=font11) self.Scrolledlistbox1.configure(highlightbackground="wheat") self.Scrolledlistbox1.configure(highlightcolor="wheat") self.Scrolledlistbox1.configure(selectbackground="#c4c4c4") self.Scrolledlistbox1.configure(width=10) self.Scrolledtext1 = ScrolledText(top) self.Scrolledtext1.place(relx=0.37, rely=0.76, relheight=0.09 , relwidth=0.21) self.Scrolledtext1.configure(background="white") self.Scrolledtext1.configure(font=font10) self.Scrolledtext1.configure(highlightbackground="wheat") self.Scrolledtext1.configure(insertborderwidth="3") self.Scrolledtext1.configure(selectbackground="#c4c4c4") self.Scrolledtext1.configure(width=10) self.Scrolledtext1.configure(wrap=NONE) self.style.configure('Treeview.Heading', font=font9) self.Scrolledtreeview1 = ScrolledTreeView(top) self.Scrolledtreeview1.place(relx=0.13, rely=0.86, relheight=0.12 , relwidth=0.7) self.Scrolledtreeview1.configure(columns="Col1") self.Scrolledtreeview1.heading("#0",text="Tree") self.Scrolledtreeview1.heading("#0",anchor="center") self.Scrolledtreeview1.column("#0",width="209") self.Scrolledtreeview1.column("#0",minwidth="20") self.Scrolledtreeview1.column("#0",stretch="1") self.Scrolledtreeview1.column("#0",anchor="w") self.Scrolledtreeview1.heading("Col1",text="Col1") self.Scrolledtreeview1.heading("Col1",anchor="center") self.Scrolledtreeview1.column("Col1",width="209") self.Scrolledtreeview1.column("Col1",minwidth="20") self.Scrolledtreeview1.column("Col1",stretch="1") self.Scrolledtreeview1.column("Col1",anchor="w") self.TSizegrip1 = ttk.Sizegrip(top) self.TSizegrip1.place(anchor=SE, relx=1.0, rely=1.0) self.TLabel1 = ttk.Label(top) self.TLabel1.place(relx=0.05, rely=0.34, height=17, width=37) self.TLabel1.configure(background="wheat") self.TLabel1.configure(foreground="#000000") self.TLabel1.configure(relief=FLAT) self.TLabel1.configure(text='''Tlabel''') self.style.configure('TNotebook.Tab', background=_bgcolor) self.style.configure('TNotebook.Tab', foreground=_fgcolor) self.style.map('TNotebook.Tab', background= [('selected', _compcolor), ('active',_ana2color)]) self.TNotebook1 = ttk.Notebook(top) self.TNotebook1.place(relx=0.43, rely=0.05, relheight=0.26, relwidth=0.5) self.TNotebook1.configure(width=300) self.TNotebook1.configure(takefocus="") self.TNotebook1_t1 = ttk.Frame(self.TNotebook1) self.TNotebook1.add(self.TNotebook1_t1, padding=3) self.TNotebook1.tab(0, text="Page 1",underline="-1",) self.TNotebook1_t2 = ttk.Frame(self.TNotebook1) self.TNotebook1.add(self.TNotebook1_t2, padding=3) self.TNotebook1.tab(1, text="Page 2",underline="-1",) self.TPanedwindow2 = ttk.Panedwindow(top, orient="vertical") self.TPanedwindow2.place(relx=0.03, rely=0.49, relheight=0.23 , relwidth=0.33) self.TPanedwindow2.configure(width=200) self.TPanedwindow2_p1 = ttk.Labelframe(height=75, text='Pane 1') self.TPanedwindow2.add(self.TPanedwindow2_p1) self.TPanedwindow2_p2 = ttk.Labelframe(text='Pane 2') self.TPanedwindow2.add(self.TPanedwindow2_p2) self.__funcid0 = self.TPanedwindow2.bind('<Map>', self.__adjust_sash0) self.TPanedwindow1 = ttk.Panedwindow(top, orient="horizontal") self.TPanedwindow1.place(relx=0.42, rely=0.34, relheight=0.23 , relwidth=0.33) self.TPanedwindow1.configure(width=200) self.TPanedwindow1_p1 = ttk.Labelframe(width=75, text='Pane 1') self.TPanedwindow1.add(self.TPanedwindow1_p1) self.TPanedwindow1_p2 = ttk.Labelframe(text='Pane 2') self.TPanedwindow1.add(self.TPanedwindow1_p2) self.__funcid1 = self.TPanedwindow1.bind('<Map>', self.__adjust_sash1)
def setUp(self): support.root_deiconify() self.paned = ttk.Panedwindow()
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 = '#d9d9d9' # X11 color: 'gray85' font12 = "-family Verdana -size 10 -weight bold -slant roman " \ "-underline 0 -overstrike 0" 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("1200x750+347+157") top.title("Photo Enhancer") top.configure(background="#d9d9d9") #######Menu Bar######## #File self.menubar = Menu(top, bg='#ff0000', fg=_fgcolor) top.configure(menu=self.menubar) self.file = Menu(top, tearoff=0) self.menubar.add_cascade(menu=self.file, compound="left", font=( 'Purisa', 12, 'normal', 'roman', ), foreground="#000000", label="File") #Load Image from Computer self.file.add_command( activeforeground="#000000", command=lambda: functions.openClicked(root, self), font="TkMenuFont", foreground="#000000", label="Open File") #Load URL self.file.add_command( activeforeground="#000000", command=lambda: functions.importClicked(root, self), font="TkMenuFont", foreground="#000000", label="Load URL") self.file.add_separator( #background="#ffff00" ) #Save self.file.add_command( activeforeground="#000000", command=lambda: functions.saveClicked(root, self), font="TkMenuFont", foreground="#000000", label="Save") #Save As self.file.add_command( activeforeground="#000000", command=lambda: functions.saveasClicked(root, self), font="TkMenuFont", foreground="#000000", label="Save As") self.file.add_separator( #background="#ffff00" ) #Close Image self.file.add_command( activeforeground="#000000", command=lambda: functions.closeClicked(root, self), font="TkMenuFont", foreground="#000000", label="Close the Image") self.file.add_separator( #background="#ffff00" ) #Quit the Application self.file.add_command( activeforeground="#000000", #background="#ffff00", command=lambda: functions.quitClicked(root, self), compound="top", font="TkMenuFont", foreground="#000000", #image=self._img0, label="Quit") #Edit self.edit = Menu(top, tearoff=0) self.menubar.add_cascade(menu=self.edit, compound="left", font=( 'Purisa', 12, 'normal', 'roman', ), foreground="#000000", state="disabled", label="Edit") self.edit.add_command( activeforeground="#000000", command=lambda: functions.rotateClicked(root, self), font="TkMenuFont", foreground="#000000", label="Rotate") self.edit.add_command( activeforeground="#000000", command=lambda: functions.brightenClicked(root, self), font="TkMenuFont", foreground="#000000", label="Brighten") self.edit.add_command( activeforeground="#000000", command=lambda: functions.contrastClicked(root, self), font="TkMenuFont", foreground="#000000", label="Contrast") self.edit.add_command( activeforeground="#000000", command=lambda: functions.filterClicked(root, self), font="TkMenuFont", foreground="#000000", label="Filter") self.edit.add_command( activeforeground="#000000", command=lambda: functions.mirrorClicked(root, self), font="TkMenuFont", foreground="#000000", label="Mirror") self.edit.add_command( activeforeground="#000000", command=lambda: functions.cropClicked(root, self), font="TkMenuFont", foreground="#000000", label="Crop") self.edit.add_command( activeforeground="#000000", command=lambda: functions.blurClicked(root, self), font="TkMenuFont", foreground="#000000", label="Blur") self.edit.add_command( activeforeground="#000000", command=lambda: functions.sharpenClicked(root, self), font="TkMenuFont", foreground="#000000", label="Sharpen") self.help = Menu(top, tearoff=0) self.menubar.add_cascade(menu=self.help, compound="left", font=( 'Purisa', 12, 'normal', 'roman', ), foreground="#000000", label="Help") self.help.add_command( activeforeground="#000000", command=lambda: functions.helpClicked(root, self), font="TkMenuFont", foreground="#000000", label="About") #######Buttons######### self.TPanedwindow1 = ttk.Panedwindow(top, orient="horizontal") self.TPanedwindow1.place(relx=0.02, rely=0.01, relheight=0.96, relwidth=0.97) self.TPanedwindow1.configure(width=1165) self.toolPanel = ttk.Labelframe(width=200, text='') self.TPanedwindow1.add(self.toolPanel) self.displayPanel = ttk.Labelframe(text='') self.TPanedwindow1.add(self.displayPanel) self.__funcid0 = self.TPanedwindow1.bind('<Map>', self.__adjust_sash0) #Places the Editing Tools Title self.toolLabel = ttk.Label(self.toolPanel) self.toolLabel.place(relx=0.3, rely=0.07, height=29, width=96, y=-12) self.toolLabel.configure(background="#d9d9d9") self.toolLabel.configure(foreground="#000000") self.toolLabel.configure(font=font12) self.toolLabel.configure(relief=FLAT) self.toolLabel.configure(justify=CENTER) self.toolLabel.configure(text='''Editing Tools''') self.toolLabel.configure(width=96) #Places the Rotate Button self.rotateButton = ttk.Button(self.toolPanel) self.rotateButton.place(relx=0.26, rely=0.14, height=25, width=90, y=-12) self.rotateButton.configure( command=lambda: functions.rotateClicked(root, self)) self.rotateButton.configure(takefocus="") self.rotateButton.configure(text='''Rotate''') self.rotateButton.configure(state=DISABLED) #Clockwise Radio Button self.clockwiseRadiobutton = Radiobutton(self.toolPanel) self.clockwiseRadiobutton.place(relx=0.16, rely=0.18, relheight=0.03, relwidth=0.52, y=-12, h=12) self.clockwiseRadiobutton.configure(activebackground="#d9d9d9") self.clockwiseRadiobutton.configure(activeforeground="#000000") self.clockwiseRadiobutton.configure(background="#eaeaea") self.clockwiseRadiobutton.configure(foreground="#000000") self.clockwiseRadiobutton.configure(highlightbackground="#d9d9d9") self.clockwiseRadiobutton.configure(highlightcolor="black") self.clockwiseRadiobutton.configure(justify=LEFT) self.clockwiseRadiobutton.configure(text='''Clockwise''') self.clockwiseRadiobutton.configure(variable="rotate") self.clockwiseRadiobutton.configure(value="1") self.clockwiseRadiobutton.configure( command=lambda: functions.setRotateDirection(1)) #1 rotates clockwise self.clockwiseRadiobutton.configure(state=DISABLED) self.clockwiseRadiobutton.select() #Counterclockwise Radio Button self.counterwiseRadiobutton = Radiobutton(self.toolPanel) self.counterwiseRadiobutton.place(relx=0.16, rely=0.22, relheight=0.03, relwidth=0.61, y=-12, h=12) self.counterwiseRadiobutton.configure(activebackground="#d9d9d9") self.counterwiseRadiobutton.configure(activeforeground="#000000") self.counterwiseRadiobutton.configure(background="#eaeaea") self.counterwiseRadiobutton.configure(foreground="#000000") self.counterwiseRadiobutton.configure(highlightbackground="#d9d9d9") self.counterwiseRadiobutton.configure(highlightcolor="black") self.counterwiseRadiobutton.configure(justify=LEFT) self.counterwiseRadiobutton.configure(text='''Counterwise''') self.counterwiseRadiobutton.configure(variable="rotate") self.counterwiseRadiobutton.configure(value="-1") #-1 rotates counterclockwise self.counterwiseRadiobutton.configure( command=lambda: functions.setRotateDirection(-1)) self.counterwiseRadiobutton.configure(state=DISABLED) self.counterwiseRadiobutton.deselect() #Brightness Button self.brightnessButton = ttk.Button(self.toolPanel) self.brightnessButton.place(relx=0.26, rely=0.28, height=25, width=90, y=-12) self.brightnessButton.configure( command=lambda: functions.brightnessClicked(root, self)) self.brightnessButton.configure(takefocus="") self.brightnessButton.configure(text='''Brighten''') self.brightnessButton.configure(state=DISABLED) #Brightness Scale self.brightScale = ttk.Scale(self.toolPanel) self.brightScale.place(relx=0.25, rely=0.31, relwidth=0.5, relheight=0.0, height=26) self.brightScale.configure(from_="-255") self.brightScale.configure(to="255") self.brightScale.configure(value="0") #Scale ranges from -255 to 255 & it starts at 0 self.brightScale.configure( command=lambda x: functions.setBrightness(root, self)) #Contrast Button self.contrastButton = ttk.Button(self.toolPanel) self.contrastButton.place(relx=0.26, rely=0.38, height=25, width=90, y=-12) self.contrastButton.configure( command=lambda: functions.contrastClicked(root, self)) self.contrastButton.configure(takefocus="") self.contrastButton.configure(text='''Contrast''') self.contrastButton.configure(state=DISABLED) #Contrast Scale self.contrastScale = ttk.Scale(self.toolPanel) self.contrastScale.place(relx=0.25, rely=0.42, relwidth=0.5, relheight=0.0, height=26) self.contrastScale.configure(takefocus="") self.contrastScale.configure(from_="0.0") self.contrastScale.configure(to="10.0") self.contrastScale.configure(value="5.0") #scale ranges from 0 to 10 & starts at 5 self.contrastScale.configure( command=lambda x: functions.setContrast(root, self)) #Filter Button self.filterButton = ttk.Button(self.toolPanel) self.filterButton.place(relx=0.26, rely=0.50, height=25, width=90, y=-12) self.filterButton.configure(takefocus="") self.filterButton.configure(text='''Filter''') self.filterButton.configure(state=DISABLED) self.filterButton.configure( command=lambda: functions.filterClicked(root, self)) #Black and White Button self.bw = Radiobutton(self.toolPanel) self.bw.place(relx=0.26, rely=0.54, relheight=0.03, relwidth=0.36, y=-12, h=12) self.bw.configure(activebackground="#d9d9d9") self.bw.configure(activeforeground="#000000") self.bw.configure(background="#eaeaea") self.bw.configure(disabledforeground="#a3a3a3") self.bw.configure(foreground="#000000") self.bw.configure(highlightbackground="#d9d9d9") self.bw.configure(highlightcolor="black") self.bw.configure(justify=LEFT) self.bw.configure(text='''B&W''') self.bw.configure(variable="filter") self.bw.configure(value="1") self.bw.configure(width=70) self.bw.select() self.bw.configure( command=lambda: functions.setFilterOptions((1, 1, 1))) self.bw.configure(state=DISABLED) #Blue Filter self.red = Radiobutton(self.toolPanel) self.red.place(relx=0.26, rely=0.58, relheight=0.03, relwidth=0.36, y=-12, h=12) self.red.configure(activebackground="#d9d9d9") self.red.configure(activeforeground="#000000") self.red.configure(background="#eaeaea") self.red.configure(disabledforeground="#a3a3a3") self.red.configure(foreground="#000000") self.red.configure(highlightbackground="#d9d9d9") self.red.configure(highlightcolor="black") self.red.configure(justify=LEFT) self.red.configure(text='''Blue''') self.red.configure(variable="filter") self.red.configure(value="2") self.red.configure(width=70) self.red.deselect() self.red.configure( command=lambda: functions.setFilterOptions((0, 1, 1))) self.red.configure(state=DISABLED) #Green Filter self.blue = Radiobutton(self.toolPanel) self.blue.place(relx=0.26, rely=0.62, relheight=0.03, relwidth=0.38, y=-12, h=12) self.blue.configure(activebackground="#d9d9d9") self.blue.configure(activeforeground="#000000") self.blue.configure(background="#eaeaea") self.blue.configure(disabledforeground="#a3a3a3") self.blue.configure(foreground="#000000") self.blue.configure(highlightbackground="#d9d9d9") self.blue.configure(highlightcolor="black") self.blue.configure(justify=LEFT) self.blue.configure(text='''Green''') self.blue.configure(variable="filter") self.blue.configure(value="3") self.blue.configure(width=70) self.blue.deselect() self.blue.configure( command=lambda: functions.setFilterOptions((1, 1, 0))) self.blue.configure(state=DISABLED) #Red Filter self.green = Radiobutton(self.toolPanel) self.green.place(relx=0.26, rely=0.66, relheight=0.03, relwidth=0.36, y=-12, h=12) self.green.configure(activebackground="#d9d9d9") self.green.configure(activeforeground="#000000") self.green.configure(background="#eaeaea") self.green.configure(disabledforeground="#a3a3a3") self.green.configure(foreground="#000000") self.green.configure(highlightbackground="#d9d9d9") self.green.configure(highlightcolor="black") self.green.configure(justify=LEFT) self.green.configure(text='''Red''') self.green.configure(variable="filter") self.green.configure(value="4") self.green.configure(width=70) self.green.deselect() self.green.configure( command=lambda: functions.setFilterOptions((1, 0, 1))) self.green.configure(state=DISABLED) #Mirror Button self.mirrorButton = ttk.Button(self.toolPanel) self.mirrorButton.place(relx=0.26, rely=0.71, height=25, width=90, y=-12) self.mirrorButton.configure(takefocus="") self.mirrorButton.configure(text='''Mirror''') self.mirrorButton.configure( command=lambda: functions.mirrorClicked(root, self)) self.mirrorButton.configure(state=DISABLED) #Crop Button self.cropButton = ttk.Button(self.toolPanel) self.cropButton.place(relx=0.26, rely=0.77, height=25, width=90, y=-12) self.cropButton.configure(takefocus="") self.cropButton.configure(text='''Crop''') self.cropButton.configure(command=functions.cropClicked) self.cropButton.configure(state=DISABLED) #Blur Button self.blurButton = ttk.Button(self.toolPanel) self.blurButton.place(relx=0.26, rely=0.83, height=25, width=90, y=-12) self.blurButton.configure(takefocus="") self.blurButton.configure(text='''Blur''') self.blurButton.configure( command=lambda: functions.blurClicked(root, self)) self.blurButton.configure(state=DISABLED) #Sharpen Button self.sharpenButton = ttk.Button(self.toolPanel) self.sharpenButton.place(relx=0.26, rely=0.89, height=25, width=90, y=-12) self.sharpenButton.configure(takefocus="") self.sharpenButton.configure(text='''Sharpen''') self.sharpenButton.configure( command=lambda: functions.sharpenClicked(root, self)) self.sharpenButton.configure(state=DISABLED) #Draws the canvas for the image display self.imgCanvas = Canvas(self.displayPanel) self.imgCanvas.place(relx=0.0, rely=0.01, relheight=0.90, relwidth=0.99, y=-12, h=12) self.imgCanvas.configure(background="#d9d9d9") self.imgCanvas.configure(borderwidth="2") self.imgCanvas.configure(insertbackground="black") self.imgCanvas.configure(relief=RIDGE) self.imgCanvas.configure(selectbackground="#c4c4c4") self.imgCanvas.configure(selectforeground="black") self.imgCanvas.configure(width=955) root.bind( "<Button-1>", lambda event: functions.mousePressedWrapper(event, root, self)) root.bind("<B1-Motion>", lambda event: functions.mouseMovedWrapper(event, root, self)) root.bind( "<ButtonRelease-1>", lambda event: functions.mouseReleasedWrapper(event, root, self)) #Displays the image label for URL bar self.fileLabel = Label(self.displayPanel) self.fileLabel.place(relx=0.02, rely=0.95, height=27, width=60, y=-12) self.fileLabel.configure(background="#eaeaea") self.fileLabel.configure(disabledforeground="#a3a3a3") self.fileLabel.configure(foreground="#000000") self.fileLabel.configure(text='''Image:''') #White space to enter URL self.imageEntry = Entry(self.displayPanel) self.imageEntry.place(relx=0.09, rely=0.94, height=30, relwidth=0.75) self.imageEntry.configure(background="white") self.imageEntry.configure(disabledforeground="#a3a3a3") self.imageEntry.configure(font="TkFixedFont") self.imageEntry.configure(foreground="#000000") self.imageEntry.configure(insertbackground="black") READONLY = 'readonly' self.imageEntry.configure(state=READONLY) self.imageEntry.configure(width=694) #Button to load the URL self.loadButton = Button(self.displayPanel) self.loadButton.place(relx=0.85, rely=0.96, height=24, width=100, y=-12) self.loadButton.configure(activebackground="#d9d9d9") self.loadButton.configure(activeforeground="#000000") self.loadButton.configure(background="#d9d9d9") self.loadButton.configure(disabledforeground="#a3a3a3") self.loadButton.configure(foreground="#000000") self.loadButton.configure(highlightbackground="#d9d9d9") self.loadButton.configure(highlightcolor="black") self.loadButton.configure(pady="0") self.loadButton.configure(state=DISABLED) self.loadButton.configure(text='''Load Image''') self.loadButton.configure( command=lambda: functions.openURL(root, self))
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' self.file_path = "" self.text = "" self.imgLabel = Label(top) _bgcolor = '#000080' # X11 color: 'gray85' _fgcolor = '#FFFFFF' # X11 color: 'black' _compcolor = '#d9d9d9' # X11 color: 'gray85' _ana1color = '#d9d9d9' # X11 color: 'gray85' _ana2color = '#d9d9d9' # X11 color: 'gray85' 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("600x550+387+131") top.title("Heisenberg OCR") top.configure(highlightcolor="blue") self.TPanedwindow1 = ttk.Panedwindow(top, orient="vertical") self.TPanedwindow1.place(relx=0.02, rely=0.02, relheight=0.97, relwidth=0.97) self.TPanedwindow1.configure(width=200) self.extractTextTPane = ttk.Labelframe(height=200, text='Extract Text') self.TPanedwindow1.add(self.extractTextTPane) self.imageSearchTPane = ttk.Labelframe(text='Search Image') self.TPanedwindow1.add(self.imageSearchTPane) self.__funcid0 = self.TPanedwindow1.bind('<Map>', self.__adjust_sash0) self.imgPathFrame = Frame(self.extractTextTPane) self.imgPathFrame.place(relx=0.05, rely=0.15, relheight=0.25, relwidth=0.9) self.imgPathFrame.configure(relief=GROOVE) self.imgPathFrame.configure(borderwidth="5") self.imgPathFrame.configure(relief=GROOVE) self.imgPathFrame.configure(width=225) self.imgPathFrame.configure(background="#000080") self.pathTLabel = ttk.Label(self.imgPathFrame) self.pathTLabel.place(relx=0.04, rely=0.2, height=25, width=37) self.pathTLabel.configure(background="#000080") self.pathTLabel.configure(foreground="#FFFFFF") self.pathTLabel.configure(relief=FLAT) self.pathTLabel.configure(text='''Path:''') self.pathText = Text(self.imgPathFrame) self.pathText.place(relx=0.11, rely=0.22, relheight=0.6, relwidth=0.7) self.pathText.configure(background="white") self.pathText.configure(font="TkTextFont") # self.pathText.configure(background="#000080") self.pathText.configure(width=10) self.pathText.configure(wrap=WORD) self.browseTButton = ttk.Button(self.imgPathFrame, command=self.load_file) self.browseTButton.place(relx=0.82, rely=0.24, height=25, width=83) self.browseTButton.configure(takefocus="") self.browseTButton.configure(text='''Browse''') self.browseTButton.configure(compound="center") self.imgTxtScrolled = ScrolledText(self.extractTextTPane) self.imgTxtScrolled.place(relx=0.05, rely=0.43, relheight=0.5, relwidth=0.9) self.imgTxtScrolled.configure(background="white") self.imgTxtScrolled.configure(font="TkTextFont") self.imgTxtScrolled.configure(insertborderwidth="3") # self.imgTxtScrolled.configure(selectbackground="#c4c4c4") self.imgTxtScrolled.configure(width=10) self.imgTxtScrolled.configure(wrap=NONE) self.imgTxtScrolled.configure(background="grey") self.getImgFrame = Frame(self.imageSearchTPane) self.getImgFrame.place(relx=0.05, rely=0.09, relheight=0.17, relwidth=0.9) self.getImgFrame.configure(relief=GROOVE) self.getImgFrame.configure(borderwidth="5") self.getImgFrame.configure(relief=GROOVE) self.getImgFrame.configure(width=125) self.getImgFrame.configure(background="#000080") self.typeTLabel = ttk.Label(self.getImgFrame) self.typeTLabel.place(relx=0.04, rely=0.25, height=28, width=68) self.typeTLabel.configure(background="#000080") self.typeTLabel.configure(foreground="#FFFFFF") self.typeTLabel.configure(relief=FLAT) self.typeTLabel.configure(text='''Enter Text:''') self.searchText = Entry(self.getImgFrame) self.searchText.place(relx=0.19, rely=0.25, relheight=0.5, relwidth=0.63) self.searchText.configure(background="white") self.searchText.configure(font="TkTextFont") self.searchText.configure(selectbackground="#c4c4c4") self.searchText.configure(width=10) self.searchTButton = ttk.Button(self.getImgFrame, command=self.searchImg) self.searchTButton.place(relx=0.84, rely=0.25, height=28, width=73) self.searchTButton.configure(takefocus="") self.searchTButton.configure(text='''Search''') self.searchImgFrame = Frame(self.imageSearchTPane) self.searchImgFrame.place(relx=0.05, rely=0.3, relheight=0.64, relwidth=0.9) self.searchImgFrame.configure(relief=GROOVE) self.searchImgFrame.configure(borderwidth="5") self.searchImgFrame.configure(relief=GROOVE) self.searchImgFrame.configure(width=125) self.imgCanvas = Canvas(self.searchImgFrame, scrollregion=(0, 0, 3000, 3000)) self.imgCanvas.place(relx=0, rely=0, relheight=1, relwidth=1) self.imgCanvas.configure(background="grey") self.imgCanvas.configure(borderwidth="2") self.imgCanvas.configure(relief=RIDGE) self.imgCanvas.configure(selectbackground="#c4c4c4") self.imgCanvas.configure(width=378) self.hbar = Scrollbar(self.searchImgFrame, orient=HORIZONTAL) self.hbar.pack(side=BOTTOM, fill=X) self.hbar.config(command=self.imgCanvas.xview) self.vbar = Scrollbar(self.searchImgFrame, orient=VERTICAL) self.vbar.pack(side=RIGHT, fill=Y) self.vbar.config(command=self.imgCanvas.yview) self.imgCanvas.config(xscrollcommand=self.hbar.set, yscrollcommand=self.vbar.set) self.imgCanvas.pack(side=LEFT, expand=True, fill=BOTH)
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("1080x782+586+112") top.title("Qaps") top.configure(highlightcolor="black") self.TPanedwindow1 = ttk.Panedwindow(top, orient="horizontal") self.TPanedwindow1.place(x=5, rely=0.0, relheight=0.972, relwidth=0.985) self.TPanedwindow1_p1 = ttk.Labelframe(width=405, text='', relief=tk.FLAT) self.TPanedwindow1.add(self.TPanedwindow1_p1) self.TPanedwindow1_pb = ttk.Frame(width=160, borderwidth=1, relief=tk.GROOVE) self.TPanedwindow1.add(self.TPanedwindow1_pb) self.TPanedwindow1_p2 = ttk.Labelframe(width=405, text='', relief=tk.FLAT) self.TPanedwindow1.add(self.TPanedwindow1_p2) self.__funcid0 = self.TPanedwindow1.bind('<Map>', self.__adjust_sash0) self.button_qopen = tk.Button(self.TPanedwindow1_p1) self.button_qopen.place(x=0, rely=0.013, height=31, width=191, bordermode='ignore') self.button_qopen.configure(activebackground="#f9f9f9") self.button_qopen.configure(text='''Open Qtractor Project''') self.button_qbackup = tk.Button(self.TPanedwindow1_p1) self.button_qbackup.place(x=190, rely=0.013, height=31, width=191, bordermode='ignore') self.button_qbackup.configure(activebackground="#f9f9f9") self.button_qbackup.configure(text='''BACKUP Qtractor Project''') self.button_qbackup.configure(state=tk.DISABLED) self.label_qproject = tk.Label(self.TPanedwindow1_p1) self.label_qproject.place(x=0, rely=0.053, height=21, relwidth=0.99, bordermode='ignore') self.label_qproject.configure(activebackground="#f9f9f9") self.label_qproject.configure(anchor='n') self.label_qproject.configure(background="#ececec") self.label_qproject.configure(justify='left') self.label_qproject.configure(text='''''') self.style.configure('Treeview.Heading', font="TkDefaultFont") self.tree_ctrl_qtractor = ScrolledTreeView(self.TPanedwindow1_p1) self.tree_ctrl_qtractor.place(x=0, rely=0.079, relheight=0.87, relwidth=0.99, bordermode='ignore') # build_treeview_support starting. self.tree_ctrl_qtractor.configure(show="tree") self.tree_ctrl_qtractor.column("#0", width="460") self.tree_ctrl_qtractor.column("#0", minwidth="460") self.tree_ctrl_qtractor.column("#0", stretch="1") self.tree_ctrl_qtractor.column("#0", anchor="w") self.button_qsave = tk.Button(self.TPanedwindow1_p1) self.button_qsave.place(x=0, rely=0.954, height=31, width=191, bordermode='ignore') self.button_qsave.configure(activebackground="#f9f9f9") self.button_qsave.configure(text='''Save Qtractor Project''') self.button_qsave.configure(state=tk.DISABLED) self.label_1 = tk.Label(self.TPanedwindow1_pb) self.label_1.place(x=5, y=80, height=31, width=70, bordermode='ignore') self.label_1.configure(anchor='n') self.label_1.configure(text='''Plugin''') self.button_q_to_a = tk.Button(self.TPanedwindow1_pb) self.button_q_to_a.place(x=5, y=100, height=31, width=70, bordermode='ignore') self.button_q_to_a.configure(activebackground="#f9f9f9") self.button_q_to_a.configure(text='''>''') self.button_a_to_q = tk.Button(self.TPanedwindow1_pb) self.button_a_to_q.place(x=5, y=135, height=31, width=70, bordermode='ignore') self.button_a_to_q.configure(activebackground="#f9f9f9") self.button_a_to_q.configure(text='''<''') self.label_2 = tk.Label(self.TPanedwindow1_pb) self.label_2.place(x=5, y=230, height=31, width=70, bordermode='ignore') self.label_2.configure(anchor='n') self.label_2.configure(text='''Track''') self.button_q_to_a_track = tk.Button(self.TPanedwindow1_pb) self.button_q_to_a_track.place(x=5, y=250, height=31, width=70, bordermode='ignore') self.button_q_to_a_track.configure(activebackground="#f9f9f9") self.button_q_to_a_track.configure(text='''>>''') self.button_a_to_q_track = tk.Button(self.TPanedwindow1_pb) self.button_a_to_q_track.place(x=5, y=285, height=31, width=70, bordermode='ignore') self.button_a_to_q_track.configure(activebackground="#f9f9f9") self.button_a_to_q_track.configure(text='''<<''') self.label_3 = tk.Label(self.TPanedwindow1_pb) self.label_3.place(x=5, y=380, height=31, width=70, bordermode='ignore') self.label_3.configure(anchor='n') self.label_3.configure(text='''All''') self.button_q_to_a_all = tk.Button(self.TPanedwindow1_pb) self.button_q_to_a_all.place(x=5, y=400, height=31, width=70, bordermode='ignore') self.button_q_to_a_all.configure(activebackground="#f9f9f9") self.button_q_to_a_all.configure(text='''>>>>''') self.button_a_to_q_all = tk.Button(self.TPanedwindow1_pb) self.button_a_to_q_all.place(x=5, y=435, height=31, width=70, bordermode='ignore') self.button_a_to_q_all.configure(activebackground="#f9f9f9") self.button_a_to_q_all.configure(text='''<<<<''') self.button_aopen = tk.Button(self.TPanedwindow1_p2) self.button_aopen.place(x=0, rely=0.013, height=31, width=191, bordermode='ignore') self.button_aopen.configure(activebackground="#f9f9f9") self.button_aopen.configure(text='''Open Ardour Project''') self.button_abackup = tk.Button(self.TPanedwindow1_p2) self.button_abackup.place(x=190, rely=0.013, height=31, width=191, bordermode='ignore') self.button_abackup.configure(activebackground="#f9f9f9") self.button_abackup.configure(text='''BACKUP Ardour Project''') self.button_abackup.configure(state=tk.DISABLED) self.label_aproject = tk.Label(self.TPanedwindow1_p2) self.label_aproject.place(x=0, rely=0.053, height=21, relwidth=0.99, bordermode='ignore') self.label_aproject.configure(activebackground="#f9f9f9") self.label_aproject.configure(anchor='n') self.label_aproject.configure(background="#ececec") self.label_aproject.configure(justify='left') self.label_aproject.configure(text='''''') self.tree_ctrl_ardour = ScrolledTreeView(self.TPanedwindow1_p2) self.tree_ctrl_ardour.place(relx=0.0, rely=0.079, relheight=0.87, relwidth=0.99, bordermode='ignore') # build_treeview_support starting. self.tree_ctrl_ardour.configure(show="tree") self.tree_ctrl_ardour.column("#0", width="460") self.tree_ctrl_ardour.column("#0", minwidth="460") self.tree_ctrl_ardour.column("#0", stretch="1") self.tree_ctrl_ardour.column("#0", anchor="w") self.button_asave = tk.Button(self.TPanedwindow1_p2) self.button_asave.place(relx=0.0, rely=0.954, height=31, width=191, bordermode='ignore') self.button_asave.configure(activebackground="#f9f9f9") self.button_asave.configure(text='''Save Ardour Project''') self.button_asave.configure(state=tk.DISABLED) self.label_status = tk.Label(top) self.label_status.place(x=5, rely=0.972, height=21, relwidth=0.99) self.label_status.configure(background="#ececec") self.label_status.configure(text='''''')
def Frame1(self): #divided Frame1 by Vertical F1 = ttk.Panedwindow(self.frame1, orient=VERTICAL) self.f1topf=ttk.Frame(F1) space=ttk.Frame(F1) f1bottomf=ttk.Frame(F1) F1.add(self.f1topf) F1.add(space) F1.add(f1bottomf) F1.grid() F3=ttk.PanedWindow(f1bottomf, orient=HORIZONTAL) F3calf=ttk.Labelframe(F3,text='Calibration Frame') F3objf=ttk.Labelframe(F3,text='Object Frame') F3.add(F3calf) F3.add(F3objf) F3.grid() # f1bottomf.add(F3cal) #f1bottomf.add(F3obj) #f1bottomf.grid() F3caltop=ttk.Panedwindow(F3calf, orient=VERTICAL) F3caltopf=ttk.Frame(F3caltop) F3caltop.add(F3caltopf) F3caltop.grid() F3calbottom=ttk.Panedwindow(F3calf, orient=VERTICAL) self.Cexecutef = ttk.Frame(F3calbottom) spacec=ttk.Frame(F3calbottom) F3calbottom.add(spacec) F3calbottom.add(self.Cexecutef) F3calbottom.grid() F3objtop=ttk.Panedwindow(F3objf, orient=VERTICAL) F3objtopf=ttk.Frame(F3objtop) F3objtop.add(F3objtopf) F3objtop.grid() F3objbottom=ttk.Panedwindow(F3objf, orient=VERTICAL) self.Oexecutef = ttk.Frame(F3objbottom) spaceo=ttk.Frame(F3objbottom) F3objbottom.add(spaceo) F3objbottom.add(self.Oexecutef) F3objbottom.grid() F3c=ttk.Panedwindow(F3caltopf, orient=HORIZONTAL) # calfram1=ttk.Labelframe(F3c,text="Dark") calfram1=ttk.Frame(F3c)#) space1=ttk.Frame(F3c) calfram2=ttk.Frame(F3c)#,text="Flat") space2=ttk.Frame(F3c) calfram3=ttk.Frame(F3c)#,text="Arc") space3=ttk.Frame(F3c) F3o=ttk.Panedwindow(F3objtopf, orient=HORIZONTAL) objfram1=ttk.Frame(F3o)#,text="Standard") space4=ttk.Frame(F3o) objfram2=ttk.Frame(F3o)#,text="Target") F3c.add(calfram1) F3c.add(space1) F3c.add(calfram2) F3c.add(space2) F3c.add(calfram3) F3c.add(space3) F3c.grid() F3o.add(objfram1) F3o.add(space4) F3o.add(objfram2) F3o.grid() #calibration frame #dark F41 = ttk.Panedwindow(calfram1, orient=VERTICAL) calibnote1=ttk.Frame(F41) self.calib11 = ttk.Frame(F41) space12=ttk.Frame(F41) self.ccm1 = ttk.Labelframe(F41, text="Combine method") space13 = ttk.Frame(F41) self.calib12 = ttk.Frame(F41) F41.add(calibnote1) F41.add(self.calib11) F41.add(space12) F41.add(self.ccm1) F41.add(space13) F41.add(self.calib12) F41.grid() #flat F42 = ttk.Panedwindow(calfram2, orient=VERTICAL) calibnote2=ttk.Frame(F42) self.calib21 = ttk.Frame(F42) space22=ttk.Frame(F42) self.ccm2 = ttk.Labelframe(F42, text="Combine method") space23 = ttk.Frame(F42) self.calib22 = ttk.Frame(F42) F42.add(calibnote2) F42.add(self.calib21) F42.add(space22) F42.add(self.ccm2) F42.add(space23) F42.add(self.calib22) F42.grid() #arc F43 = ttk.Panedwindow(calfram3, orient=VERTICAL) calibnote3=ttk.Frame(F43) self.calib31 = ttk.Frame(F43) space32=ttk.Frame(F43) self.ccm3 = ttk.Labelframe(F43, text="Combine method") space33 = ttk.Frame(F43) self.calib32 = ttk.Frame(F43) F43.add(calibnote3) F43.add(self.calib31) F43.add(space32) F43.add(self.ccm3) F43.add(space33) F43.add(self.calib32) F43.grid() #calibration notebook # calibn = ttk.Notebook(calibnote) # calibl1 = Listbox(calibnote1) # self.Cflatf = ttk.Frame(calibn) # self.Carcf = ttk.Frame(calibn) self.Cdarkf = ttk.Frame(calibnote1) self.Cdarkf.grid() # calibl1.grid() # calibl2 = Listbox(calibnote2) self.Cflatf = ttk.Frame(calibnote2) self.Cflatf.grid() # calibl2.grid() # calibl3 = Listbox(calibnote3) self.Carcf = ttk.Frame(calibnote3) self.Carcf.grid() # calibl3.grid() # calibn.add(self.Cflatf, text='FLAT') # calibn.add(self.Carcf, text='ARC') # calibn.grid() #Object frame std F51 = ttk.Panedwindow(objfram1, orient=VERTICAL) objnote1=ttk.Frame(F51) self.obj11 = ttk.Frame(F51) space14=ttk.Frame(F51) self.ocm1 = ttk.Labelframe(F51, text="Combine method") space15 = ttk.Frame(F51) self.obj12 = ttk.Frame(F51) F51.add(objnote1) F51.add(self.obj11) F51.add(space14) F51.add(self.ocm1) F51.add(space15) F51.add(self.obj12) F51.grid() #Object frame tar F52 = ttk.Panedwindow(objfram2, orient=VERTICAL) objnote2=ttk.Frame(F52) self.obj21 = ttk.Frame(F52) space24=ttk.Frame(F52) self.ocm2 = ttk.Labelframe(F52, text="Combine method") space25 = ttk.Frame(F52) self.obj22 = ttk.Frame(F52) F52.add(objnote2) F52.add(self.obj21) F52.add(space24) F52.add(self.ocm2) F52.add(space25) F52.add(self.obj22) F52.grid() #object notebook # objn = ttk.Notebook(objnote) # self.Ostandardf = ttk.Frame(objn) # self.Otargetf = ttk.Frame(objn) # objn.add(self.Ostandardf, text='Standard') # objn.add(self.Otargetf, text='Target') # objn.grid() self.Ostandardf = ttk.Frame(objnote1) self.Ostandardf.grid() self.Otargetf = ttk.Frame(objnote2) self.Otargetf.grid()
def __init__(self, root, conf): self.root = root self.conf = conf self.main = ttk.Panedwindow(root, orient=VERTICAL) f1 = ttk.Labelframe(self.main, text='Common') f2 = ttk.Labelframe(self.main, text='Specific') f3 = ttk.Labelframe(self.main, text='Results') self.main.add(f1) self.main.add(f2) self.main.add(f3) self.main.grid() Label(f1, text="Host:") \ .grid(row=0, column=1, padx=2, pady=2) self.host = Entry(f1, width=20) self.host.grid(row=0, column=2, padx=2, pady=2) self.host.insert(0, self.conf.get('server', 'host')) Label(f1, text="Port:") \ .grid(row=0, column=3, padx=2, pady=2) self.port = Entry(f1, width=6) self.port.grid(row=0, column=4, padx=2, pady=2) self.port.insert(0, self.conf.get('server', 'port')) # row1 Label(f1, text="Signer's private key") \ .grid(row=1, column=0, columnspan=1, padx=2, pady=2) self.privKeyEntry = Entry(f1, width=64) self.privKeyEntry.grid(row=1, column=1, columnspan=4, padx=2, pady=2) self.privKeyEntry.insert(0, self.conf.get('common', 'privkey')) # row2 self.multisigEnabled = IntVar() temp = Checkbutton(f1, text='Multisig transaction', variable=self.multisigEnabled, command=self.toggleMultisigPubKeyEntry) temp.grid(row=2, column=0, columnspan=5, padx=2, pady=2, sticky=W) # row3 Label(f1, text="Multisig public key") \ .grid(row=3, column=0, columnspan=1, padx=2, pady=2) self.multisigPubKeyEntry = Entry(f1, width=64) self.multisigPubKeyEntry.grid(row=3, column=1, columnspan=4, padx=2, pady=2) self.multisigPubKeyEntry.insert(0, self.conf.get('common', 'multisig')) self.multisigPubKeyEntry.configure(state='disabled') self.namespaceTab() self.mosaicTab() self.mosaicSupplyTab() self.transferTab() # add tabs self.n = ttk.Notebook(f2) self.n.add(self.ns, text="namespace") self.n.add(self.mc, text="mosaic create") self.n.add(self.ms, text="mosaic supply") self.n.add(self.tr, text="transfer") self.n.select(self.tr) self.n.grid(row=1) self.result = Text(f3, width=120, height=15) self.result.grid(row=2) boldFont = tkFont.Font(self.result, self.result.cget("font")) boldFont.configure(weight="bold") self.result.tag_configure("bt", font=boldFont)
# this is a sample python program which is used to demonstrate the use of Paned windows from the ttk library from Tkinter import * import ttk root = Tk() p = ttk.Panedwindow(root, orient=VERTICAL) p.pack(fill=BOTH, expand=1) # first pane, which would get widgets gridded into it: f1 = ttk.Labelframe(p, text='Pane1', width=100, height=100) f2 = ttk.Labelframe(p, text='Pane2', width=100, height=100) # second pane p.add(f1) p.add(f2) root.mainloop() # this is the end of the python program . happy coding....!!
#try: try: f.write(str(i) + ' ' + name + ' ' + str(score) + ' ' + '\n') except: f.write( str(i) + ' ' + 'Invalid Name[' + pid + '] ' + str(score) + ' ' + '\n') i += 1 if i > n: break StatusUpdate("Done!") f.close() #More boring GUI stuff window = ttk.Panedwindow(root, orient=HORIZONTAL) window.pack(fill=BOTH, expand=1) f1 = ttk.Labelframe(window, text='Levels', width=100, height=100) f2 = ttk.Labelframe(window, text='Function', width=100, height=100) # second pane window.add(f1) window.add(f2) # first pane, level selection: centralcheck = Checkbutton(f1, text="Central section", anchor="w", variable=cent) centralcheck.pack(fill=BOTH, expand=1) dawncheck = Checkbutton(f1, text="Dawn", anchor="w", variable=dawn) dawncheck.pack(fill=BOTH, expand=1)
def __init__(self, parent_top): global HOST global PORT global ACC global PWD global DOWNLOAD_DIR global EXSERVER global MAIL_ADD global AD4_ACC global AD4_PWD global PROGRESS_THREADS self.parent_top = parent_top self.ftp_top = Toplevel(parent_top) self.ftp_top.title("Mail Monitor") self.ftp_top.geometry('600x330+300+220') self.ftp_top.iconbitmap(DOWNLOADER_ICON) #self.ftp_top.attributes("-toolwindow", 1) #self.ftp_top.wm_attributes('-topmost',1) self.ftp_top.protocol("WM_DELETE_WINDOW", lambda: self.ask_quit(self.ftp_top)) self.running = True #Label(self.ftp_top, text='').pack() #Label(self.ftp_top, text='').pack() fm0 = Frame(self.ftp_top) #Label(fm0, text='Mail Monitor v2.0',\ # font = ('Helvetica', 12, 'bold')).pack()#, fg= my_color_blue_office) Label(fm0, text='').pack() fm0.pack() self.dir_fm = Frame(self.ftp_top) self.v_saved_number = 0 self.l_savein = Label(self.dir_fm, text="Save in: ") self.v_savein = StringVar() self.entry_savein = Entry(self.dir_fm, width=66, textvariable=self.v_savein) self.v_savein.set(SAVE_DIR) #self.entry_savein.config(state='disabled') self.b_savein = Button(self.dir_fm, text='Choose directory', command=self.choose_dir, activeforeground\ ='white', activebackground='orange') self.b_savein.pack(side=RIGHT) self.l_savein.pack(side=LEFT) self.entry_savein.pack(side=LEFT) self.dir_fm.pack() self.pwindow_qconn = ttk.Panedwindow(self.ftp_top, orient=VERTICAL) self.lframe_direct = ttk.Labelframe(self.ftp_top, text='Direct Download',\ width= 620, height = 220) self.lframe_monitor = ttk.Labelframe(self.ftp_top, text='Auto Download',\ width= 620, height = 220) self.pwindow_qconn.add(self.lframe_direct) self.pwindow_qconn.add(self.lframe_monitor) #Host label and entry self.label_host = Label(self.lframe_direct, text='Ftp Host:').grid(row=0, column=0) self.v_host = StringVar() self.entry_host = Entry(self.lframe_direct, textvariable=self.v_host, width=50) self.entry_host.grid(row=0, column=1) ts1 = "Either input an ip:port address or a full ftp url:\n ftp://QD-BSC2:qdBSC#[email protected]:8080/" ts2 = "01_Training/02_PMU/02_Documents\n then click 'Direct download' to download files in this directory" ts = ts1 + ts2 tooltip.ToolTip(self.entry_host, msg=None, msgFunc=lambda: ts, follow=True, delay=0.2) #Port label and entry self.label_port = Label(self.lframe_direct, text='Port:') #self.label_port.grid(row=0,column=2) self.v_port = StringVar() self.entry_port = Entry(self.lframe_direct, textvariabl=self.v_port, width=20) #self.entry_port.grid(row=0,column=3) #Usrnamer label and entry self.label_user = Label(self.lframe_direct, text='Username:'******'Password:'******'Dirname:').grid(row=1, column=0) self.v_ddirname = StringVar() self.entry_ddirname = Entry(self.lframe_direct, textvariabl=self.v_ddirname, width=50) self.entry_ddirname.grid(row=1, column=1) #Download button self.button_direct = Button(self.lframe_direct,text="Direct dowload",\ width=20, command=self.start_direct_download, activeforeground='white', \ activebackground='orange',bg = 'white', relief='raised') self.button_direct.grid(row=2, column=3) #############Auto download############### self.fm_up = Frame(self.lframe_monitor) s1 = "Monitor 'Inbox' to automatically download files" s2 = " " s3 = "based on ftp information in mail with specified title" s = s1 + s2 + s3 self.v_chk = BooleanVar() self.chk_auto = Checkbutton(self.fm_up, text = s, variable = self.v_chk,\ command = self.periodical_check) self.chk_auto.pack() self.fm_up.pack() self.fm_config = Frame(self.lframe_monitor, height=50) #exchange serveHost label and entry self.label_exserver = Label(self.fm_config, text='Exchange Server:') self.label_exserver.grid(row=0, column=0) self.v_exserver = StringVar() self.entry_exserver = Entry(self.fm_config, textvariable=self.v_exserver, width=27) self.entry_exserver.grid(row=0, column=1) #Mail Address label and entry self.label_mail_add = Label(self.fm_config, text=' Mail Address:') self.label_mail_add.grid(row=0, column=2) self.v_mail_k_add = StringVar() self.entry_mail_add = Entry(self.fm_config, textvariabl=self.v_mail_k_add, width=29) self.entry_mail_add.grid(row=0, column=3) #Domain//Usrnamer label and entry self.label_csl = Label(self.fm_config, text='Domain\CSL:', justify=LEFT) self.label_csl.grid(row=1, column=0) self.v_csl = StringVar() self.entry_csl = Entry(self.fm_config, textvariabl=self.v_csl, width=27) self.entry_csl.grid(row=1, column=1) #CIP Password label and entry self.label_cip = Label(self.fm_config, text=' AD4 Password:'******'Mail Title Keyword:') self.label_mail_k.grid(row=2, column=0) self.v_mail_k = StringVar() self.entry_mail_k = Entry(self.fm_config, textvariable=self.v_mail_k, width=27) self.entry_mail_k.grid(row=2, column=1) tts = "Refer to the Python regular expression\n '.*' means no filter or just leave it a blank" tooltip.ToolTip(self.entry_mail_k, msg=None, msgFunc=lambda: tts, follow=True, delay=0.2) self.label_interval = Label(self.fm_config, text='Monitor Interval(sec):') self.label_interval.grid(row=2, column=2) self.v_interval = StringVar() self.spin_interval = Spinbox(self.fm_config, textvariable=self.v_interval,\ width = 8, from_=1, to=8640,increment=1) self.spin_interval.grid(row=2, column=3) self.fm_config.pack() self.fm_mid = Frame(self.lframe_monitor, height=50) #button trigger monitor mails' titles self.ftp_queue = [] #like self.ftp_queue = [['ftp_info1','ftp_info2'],['ftp_info3'],['ftp_info4,ftp_info5']] self.v_ftp_number = StringVar() self.v_ftp_number.set(str(len(self.ftp_queue))) self.label_ftp_q = Label(self.fm_mid, textvariable=self.v_ftp_number) self.label_ftp_q.pack(side=RIGHT) Label(self.fm_mid, text="FTP Queued: ").pack(side=RIGHT) self.button_monitor = Button(self.fm_mid, text="Start monitor",\ command=self.start_monitor_download, activeforeground\ ='white', activebackground='orange',bg = 'white', relief='raised', width=20) self.button_monitor.pack() #grid(row=1,column=3) self.fm_mid.pack() #for read exchanger configuration self.pwindow_qconn.pack() Label(self.ftp_top, text=' ').pack() self.fm_tip = Frame(self.ftp_top) fm_label = Frame(self.fm_tip) #self.label_blank11 = Label(self.fm_tip,text= ' '*3).pack(side=LEFT) self.v_tip = StringVar() self.label_tip = Label(fm_label, textvariable=self.v_tip, justify=LEFT) self.label_tip.grid(row=0, column=0) fm_label.pack() fm_b = Frame(self.fm_tip) self.p = ttk.Progressbar(fm_b, orient=HORIZONTAL, mode='determinate', length=100, maximum=100) self.p.pack(side=LEFT) global PROGRESS_BAR global PROGRESS_STRVAR global PROGRESS_LBL self.v_p = StringVar() self.v_p.set("") PROGRESS_STRVAR = self.v_p self.p_label = Label(fm_b, textvariable=self.v_p) self.p_label.pack(side=LEFT) PROGRESS_LBL = self.p_label PROGRESS_BAR = self.p fm_b.pack(side=LEFT) self.fm_tip.pack(side=LEFT) PROGRESS_BAR.pack_forget() PROGRESS_LBL.pack_forget() #GUI finish #######retrive data from disk#############: data_bak = retrive_bak() if data_bak: self.v_host.set(data_bak.ftp_bak.host) self.v_port.set(data_bak.ftp_bak.port) self.v_user.set(data_bak.ftp_bak.user) self.v_pwd.set(data_bak.ftp_bak.pwd) self.v_ddirname.set(data_bak.ftp_bak.target_dir) self.v_mail_k.set(data_bak.ftp_bak.mail_keyword) self.v_interval.set(data_bak.ftp_bak.interval) self.v_exserver.set(data_bak.ol_bak.server) self.v_mail_k_add.set(data_bak.ol_bak.mail) self.v_mail_k_add.set(data_bak.ol_bak.mail) self.v_csl.set(data_bak.ol_bak.user) self.v_cip.set(data_bak.ol_bak.pwd) else: self.v_host.set(HOST) self.v_port.set(PORT) self.v_user.set(ACC) self.v_pwd.set(PWD) self.v_ddirname.set(DOWNLOAD_DIR) self.v_mail_k.set(MAIL_KEYWORD) self.v_interval.set(MONITOR_INTERVAL) self.v_exserver.set(EXSERVER) self.v_mail_k_add.set(MAIL_ADD) self.v_csl.set(AD4_ACC) self.v_cip.set(AD4_PWD) #######retrive data from disk#############: self.periodical_check() #start a ever running progress tip thread t_progress_tip = threading.Thread(target=self.start_progress_tip) t_progress_tip.start() PROGRESS_THREADS.append(t_progress_tip) print("DEBUG my_ftp.py progress thread start", t_progress_tip)
def _init_ui(self): self._init_menu() self._frame = ttk.Frame(self.window) self._panes = ttk.Panedwindow(self._frame, orient=tk.HORIZONTAL) self._leftPaneFrame = ttk.Frame(self._panes, width=100) self._rightPaneFrame = ttk.Frame(self._panes, width=300) self._panes.add(self._leftPaneFrame) self._panes.add(self._rightPaneFrame) self._lblShowData = ttk.Label(self._leftPaneFrame, text='Data objects:') self._lstObjects = tk.Listbox(self._leftPaneFrame, listvariable=self._varObjects, selectmode=tk.EXTENDED) self._scrFiles = ttk.Scrollbar(self._leftPaneFrame, orient=tk.VERTICAL, command=self._lstObjects.yview) self._lstObjects['yscrollcommand'] = self._scrFiles.set self._lblDataView = ttk.Label(self._rightPaneFrame, text='Data View:') self._frmPlot = ttk.Frame(self._rightPaneFrame) self._mplFigure = Figure(figsize=(5, 4), dpi=100) self._pltCanvas = FigureCanvasTkAgg(self._mplFigure, master=self._frmPlot) self._pltCanvas.show() self._pltCanvas.get_tk_widget().pack(side=tk.TOP, fill=tk.BOTH, expand=1) self._mplToolbar = NavigationToolbar2TkAgg(self._pltCanvas, self._frmPlot) self._mplToolbar.update() self._pltCanvas._tkcanvas.pack(side=tk.TOP, fill=tk.BOTH, expand=1) self._leftPaneFrame.columnconfigure(0, weight=33) self._leftPaneFrame.columnconfigure(1, weight=33) self._leftPaneFrame.columnconfigure(2, weight=33) self._leftPaneFrame.rowconfigure(1, weight=99) self._lblShowData.grid(column=0, row=0, padx=5, pady=10, sticky=(tk.N, tk.W, tk.S)) self._lstObjects.grid(column=0, columnspan=3, row=1, padx=5, pady=5, sticky=(tk.N, tk.W, tk.E, tk.S)) self._scrFiles.grid(column=50, row=1, pady=5, sticky=(tk.N, tk.S)) self._rightPaneFrame.rowconfigure(1, weight=99) self._rightPaneFrame.columnconfigure(0, weight=99) self._lblDataView.grid(column=0, row=0, padx=5, pady=10, sticky=(tk.W, tk.E)) self._frmPlot.grid(column=0, row=1, sticky=(tk.N, tk.W, tk.S, tk.E)) self._frame.columnconfigure(0, weight=100) self._frame.rowconfigure(0, weight=99) self._panes.grid(column=0, row=0, sticky=(tk.N, tk.W, tk.E, tk.S)) self._szGrip = ttk.Sizegrip(self._frame).grid(column=0, row=999, sticky=(tk.W, tk.E)) self._frame.pack(side=tk.TOP, fill=tk.BOTH, expand=1)
def __init__(self, parent_top): self.decode_top = Toplevel(parent_top) self.decode_top.title("Decoder") self.decode_top.geometry('800x600+300+220') self.decode_top.iconbitmap(icon_path) self.decode_top.attributes("-toolwindow", 1) #self.decode_top.wm_attributes('-topmost',1) n = ttk.Notebook(self.decode_top) f1 = ttk.Frame( n, height=500) # first page, which would get widgets gridded into it f2 = ttk.Frame(n) # second page n.add(f1, text='One') n.add(f2, text='Two') lab1 = Label(f1, text='Parse BSC real time message trace',\ font = ('Helvetica', 12, 'bold'), fg='blue') lab1.pack() #option################### p_option = ttk.Panedwindow(f1, orient=VERTICAL) lf_option = ttk.Labelframe(p_option, text='Option', width=620, height=120) p_option.add(lf_option) self.vversion = StringVar() self.v_select = ttk.Combobox(lf_option, textvariable=self.vversion, width=30) self.v_select['values'] = ('LR14.3', 'LR13.3', 'LR11') self.v_select['state'] = "readonly" self.v_select.current(0) self.v_select.bind("<<ComboboxSelected>>", self.select_version) v_label = Label(lf_option, text='Select Version').grid(row=0, column=1) self.v_select.grid(row=0, column=2) n_label = Label(lf_option, text='*').grid(row=0, column=3) m_label = Label(lf_option, text='Buffer Mode').grid(row=1, column=1) m_entry = Entry(lf_option, width=33).grid(row=1, column=2) blank_label1 = Label(lf_option, text=' ' * 10).grid(row=0, column=4) blank_label2 = Label(lf_option, text=' ' * 10).grid(row=1, column=4) o_label = Label(lf_option, text='Object Name').grid(row=0, column=5) o_entry = Entry(lf_option, width=33).grid(row=0, column=6) f_label = Label(lf_option, text='Field Mode').grid(row=1, column=5) f_entry = Entry(lf_option, width=33).grid(row=1, column=6) p_option.pack(expand=YES, fill=BOTH) #option################### blank_label = Label(f1, text='') blank_label.pack() #raw content################ p_raw = ttk.Panedwindow(f1, orient=VERTICAL) lf_raw = ttk.Labelframe(p_raw, text='Message Content(Raw Trace)', width=620, height=320) p_raw.add(lf_raw) self.text_pad = Text(lf_raw, undo=True, width=600, height=300) self.text_pad.pack(expand=YES, fill=BOTH) scroll = Scrollbar(self.text_pad) self.text_pad.config(yscrollcommand=scroll.set) scroll.config(command=self.text_pad.yview) scroll.pack(side=RIGHT, fill=Y) self.text_pad.insert(1.0, "这里粘贴日志信息") p_raw.pack(expand=YES, fill=BOTH) #raw content################ #button################### self.button_frm = Frame(f1) self.decode_button = Button(self.button_frm, text="decode", background=my_color_green, command=self.log_translate) self.decode_button.pack(side=LEFT) self.reset_button = Button(self.button_frm, text="reset", command=self.reset_translate) self.reset_button.pack() self.button_frm.pack() #button################### #Resut################### p = ttk.Panedwindow(f1, orient=VERTICAL) fp1 = ttk.Labelframe(p, text='Result', width=620, height=220) p.add(fp1) self.result_pad = Text(fp1, undo=True, width=600, height=200) self.result_pad.pack(expand=YES, fill=BOTH) p.pack(expand=YES, fill=BOTH) #Resut################### #notepad2################# lab2 = Label(f2, text='graphic') lab2.pack() self.can = Canvas(f2, width=600, height=600, bg='#00FFFF') self.can.create_line((0, 0), (200, 200), width=5) self.can.create_text(300, 30, text="Scenario Figure") self.can.pack() #notepad2################# n.pack()
def __init__(self, master=None): _bgcolor = '#d9d9d9' # X11 color: 'gray85' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#b2c9f4' # Closest X11 color: 'SlateGray2' _ana1color = '#eaf4b2' # Closest X11 color: '{pale goldenrod}' _ana2color = '#f4bcb2' # Closest X11 color: 'RosyBrown2' font10 = "-family {DejaVu Sans} -size 16 -weight normal -slant " + \ " roman -underline 0 -overstrike 0" 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=font10) self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)]) master.configure(highlightbackground="wheat") master.configure(highlightcolor="black") self.TPanedwindow1 = ttk.Panedwindow(master, orient="vertical") self.TPanedwindow1.place(relx=0.03, rely=0.02, relheight=0.83, relwidth=0.96) self.TPanedwindow1.configure(width=585) self.TPanedwindow1_f1 = ttk.Labelframe(height=75, text='Regular Expression') self.TPanedwindow1.add(self.TPanedwindow1_f1) self.TPanedwindow1_f2 = ttk.Labelframe(height=75, text='Sample') self.TPanedwindow1.add(self.TPanedwindow1_f2) self.TPanedwindow1_f3 = ttk.Labelframe(text='Matches') self.TPanedwindow1.add(self.TPanedwindow1_f3) self.__funcid0 = self.TPanedwindow1.bind('<Map>', self.__adjust_sash0) self.Expression = ScrolledText(self.TPanedwindow1_f1) self.Expression.place(relx=0.02, rely=0.2, relheight=0.75, relwidth=0.96) self.Expression.configure(background="white") self.Expression.configure(font="TkTextFont") self.Expression.configure(highlightbackground="wheat") self.Expression.configure(insertborderwidth="3") self.Expression.configure(selectbackground="#c4c4c4") self.Expression.configure(width=10) self.Expression.configure(wrap=NONE) self.Sample = ScrolledText(self.TPanedwindow1_f2) self.Sample.place(relx=0.02, rely=0.2, relheight=0.67, relwidth=0.96) self.Sample.configure(background="white") self.Sample.configure(font="TkTextFont") self.Sample.configure(insertborderwidth="3") self.Sample.configure(selectbackground="#c4c4c4") self.Sample.configure(width=10) self.Sample.configure(wrap=NONE) self.Sample.bind('<Button-1>', vrex_support.sync_matches) self.Matches = ScrolledText(self.TPanedwindow1_f3) self.Matches.place(relx=0.02, rely=0.04, relheight=0.93, relwidth=0.96) self.Matches.configure(background="white") self.Matches.configure(font="TkTextFont") self.Matches.configure(insertborderwidth="3") self.Matches.configure(selectbackground="#c4c4c4") self.Matches.configure(width=10) self.Matches.configure(wrap=NONE) self.Matches.bind('<Button-1>', vrex_support.sync_sample) self.menubar = Menu(master, font=font10, bg=_bgcolor, fg=_fgcolor) master.configure(menu=self.menubar) self.file = Menu(master, tearoff=0) self.menubar.add_cascade(menu=self.file, background="#d9d9d9", font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="File") self.file.add_command(background="#d9d9d9", command=vrex_support.load_regular_expression, font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="Load regular expression") self.file.add_command(background="#d9d9d9", command=vrex_support.save_regular_expression, font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="Save regular expression") self.file.add_separator(background="#d9d9d9") self.file.add_command(background="#d9d9d9", command=vrex_support.load_sample, font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="Load sample") self.file.add_command(background="#d9d9d9", command=vrex_support.save_sample, font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="Save sample") self.file.add_separator(background="#d9d9d9") self.file.add_command(background="#d9d9d9", command=vrex_support.quit, font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="Quit") self.menubar.add_command(background="#d9d9d9", command=vrex_support.help, font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="Help") self.Quit = Button(master) self.Quit.place(relx=0.9, rely=0.91, height=25, width=49) self.Quit.configure(activebackground="#f9f9f9") self.Quit.configure(command=vrex_support.quit) self.Quit.configure(disabledforeground="#b8a786") self.Quit.configure(highlightbackground="wheat") self.Quit.configure(text='''Quit''') self.Match = Button(master) self.Match.place(relx=0.16, rely=0.91, height=25, width=61) self.Match.configure(activebackground="#f9f9f9") self.Match.configure(command=lambda: vrex_support.display(0)) self.Match.configure(disabledforeground="#b8a786") self.Match.configure(highlightbackground="wheat") self.Match.configure(text='''Match''') self.Button1 = Button(master) self.Button1.place(relx=0.28, rely=0.91, height=25, width=32) self.Button1.configure(activebackground="#f9f9f9") self.Button1.configure(background="#ffffff") self.Button1.configure(command=lambda: vrex_support.display(1)) self.Button1.configure(disabledforeground="#b8a786") self.Button1.configure(foreground="blue") self.Button1.configure(highlightbackground="wheat") self.Button1.configure(text='''1''') self.Button2 = Button(master) self.Button2.place(relx=0.34, rely=0.91, height=25, width=32) self.Button2.configure(activebackground="#f9f9f9") self.Button2.configure(background="#ffffff") self.Button2.configure(command=lambda: vrex_support.display(2)) self.Button2.configure(disabledforeground="#b8a786") self.Button2.configure(foreground="darkgreen") self.Button2.configure(highlightbackground="wheat") self.Button2.configure(text='''2''') self.Button3 = Button(master) self.Button3.place(relx=0.41, rely=0.91, height=25, width=32) self.Button3.configure(activebackground="#f9f9f9") self.Button3.configure(background="#ffffff") self.Button3.configure(command=lambda: vrex_support.display(3)) self.Button3.configure(disabledforeground="#b8a786") self.Button3.configure(foreground="magenta") self.Button3.configure(highlightbackground="wheat") self.Button3.configure(text='''3''') self.Button4 = Button(master) self.Button4.place(relx=0.48, rely=0.91, height=25, width=32) self.Button4.configure(activebackground="#f9f9f9") self.Button4.configure(background="#ffffff") self.Button4.configure(command=lambda: vrex_support.display(4)) self.Button4.configure(disabledforeground="#b8a786") self.Button4.configure(foreground="sienna") self.Button4.configure(highlightbackground="wheat") self.Button4.configure(text='''4''') self.Button5 = Button(master) self.Button5.place(relx=0.54, rely=0.91, height=25, width=32) self.Button5.configure(activebackground="#f9f9f9") self.Button5.configure(background="#ffffff") self.Button5.configure(command=lambda: vrex_support.display(5)) self.Button5.configure(disabledforeground="#b8a786") self.Button5.configure(foreground="purple") self.Button5.configure(highlightbackground="wheat") self.Button5.configure(text='''5''') self.Button6 = Button(master) self.Button6.place(relx=0.61, rely=0.91, height=25, width=32) self.Button6.configure(activebackground="#f9f9f9") self.Button6.configure(background="#ffffff") self.Button6.configure(command=lambda: vrex_support.display(6)) self.Button6.configure(disabledforeground="#b8a786") self.Button6.configure(foreground="firebrick") self.Button6.configure(highlightbackground="wheat") self.Button6.configure(text='''6''') self.Button7 = Button(master) self.Button7.place(relx=0.67, rely=0.91, height=25, width=32) self.Button7.configure(activebackground="#f9f9f9") self.Button7.configure(background="#ffffff") self.Button7.configure(command=lambda: vrex_support.display(7)) self.Button7.configure(disabledforeground="#b8a786") self.Button7.configure(foreground="deeppink") self.Button7.configure(highlightbackground="wheat") self.Button7.configure(text='''7''') self.Button8 = Button(master) self.Button8.place(relx=0.74, rely=0.91, height=25, width=32) self.Button8.configure(activebackground="#f9f9f9") self.Button8.configure(background="#ffffff") self.Button8.configure(command=lambda: vrex_support.display(8)) self.Button8.configure(disabledforeground="#b8a786") self.Button8.configure(foreground="green4") self.Button8.configure(highlightbackground="wheat") self.Button8.configure(text='''8''') self.Button9 = Button(master) self.Button9.place(relx=0.8, rely=0.91, height=25, width=32) self.Button9.configure(activebackground="#f9f9f9") self.Button9.configure(background="#ffffff") self.Button9.configure(command=lambda: vrex_support.display(9)) self.Button9.configure(disabledforeground="#b8a786") self.Button9.configure(foreground="deepskyblue1") self.Button9.configure(highlightbackground="wheat") self.Button9.configure(text='''9''') self.Go = Button(master) self.Go.place(relx=0.05, rely=0.91, height=25, width=40) self.Go.configure(activebackground="#f9f9f9") self.Go.configure(command=vrex_support.go) self.Go.configure(disabledforeground="#b8a786") self.Go.configure(highlightbackground="wheat") self.Go.configure(text='''Go''') self.TSizegrip1 = ttk.Sizegrip(master) self.TSizegrip1.place(anchor=SE, relx=1.0, rely=1.0)
def __init__(self, root): root.title("ATP File Generator") root.resizable(False, False) self.m = Menu(root) root.config(menu=self.m) self.fm = Menu(self.m, tearoff=0) self.m.add_cascade(label="File", menu=self.fm) if (platform.system() == "Darwin"): self.create_shortcuts("Command", "Command") else: self.create_shortcuts("Control", "Ctrl") self.default = ttk.Frame(root) self.options = ttk.Panedwindow(self.default, orient=VERTICAL) self.generic_options = ttk.Panedwindow(self.default, orient=VERTICAL) self.cpu_options = ttk.Panedwindow(self.default, orient=VERTICAL) self.dpu_options = ttk.Panedwindow(self.default, orient=VERTICAL) self.gpu_options = ttk.Panedwindow(self.default, orient=VERTICAL) self.atp_string = "" self.processor = StringVar() self.author = StringVar() self.processor_list = ["", "CPU", "DPU", "GPU", "Generic"] self.processor.set("CPU") self.address_types = [ "", "LINEAR", "UNIFORM", "NORMAL", "POISSON", "WEIBULL" ] self.size_types = [ "", "FIXED", "UNIFORM", "NORMAL", "POISSON", "WEIBULL" ] self.options.add( Label(self.options, text="General Settings", justify=LEFT)) self.options.add( Label(self.options, text="Choose a processor type: ", justify=LEFT)) self.options.add( ttk.OptionMenu(self.options, self.processor, *self.processor_list, command=lambda x: self.choose_processor_options())) self.options.add(Label(self.options, text="Author: ")) self.options.add(ttk.Entry(self.options, textvariable=self.author)) self.button_generate_file = ttk.Button(self.options, text="Generate ATP Profile", command=self.print_atp) self.options.add(self.button_generate_file) self.button_generate_profile = ttk.Button(self.options, text="Add ATP Profile", command=self.append_atp) self.button_generate_profile.configure(state="disable") self.options.add(self.button_generate_profile) self.button_preview_file = ttk.Button(self.options, text="Preview ATP Profile", command=self.preview_atp) self.button_preview_file.configure(state="enable") self.options.add(self.button_preview_file) self.options.add( ttk.Button(self.options, text="Open ATP Profile", command=self.open_atp)) self.options.add( ttk.Button(self.options, text="Clear", command=lambda: self.clear_fields(self.default))) self.options.add(ttk.Button(self.options, text="Quit", command=quit)) self.options.grid(sticky=N, row=0, column=1) self.create_processor_options() self.default.pack()
def setUp(self): self.paned = ttk.Panedwindow()
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' _bgcolor = '#f5deb3' # X11 color: 'wheat' _fgcolor = '#000000' # X11 color: 'black' _compcolor = '#b2c9f4' # Closest X11 color: 'SlateGray2' _ana1color = '#eaf4b2' # Closest X11 color: '{pale goldenrod}' _ana2color = '#f4bcb2' # Closest X11 color: 'RosyBrown2' font9 = "-family {DejaVu Sans Mono} -size 14 -weight normal " \ "-slant roman -underline 0 -overstrike 0" 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=font9) self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)]) top.geometry("565x513+650+150") top.title("Complex Example") top.configure(background="#f5deb3") top.configure(highlightbackground="#f5deb3") top.configure(highlightcolor="black") self.TPanedwindow1 = ttk.Panedwindow(top, orient="vertical") self.TPanedwindow1.place(relx=0.05, rely=0.06, relheight=0.8, relwidth=0.88) self.TPanedwindow1.configure(width=200) self.TPanedwindow1_p1 = ttk.Labelframe(height=75, text='Pane 1') self.TPanedwindow1.add(self.TPanedwindow1_p1) self.TPanedwindow1_p2 = ttk.Labelframe(text='Pane 2') self.TPanedwindow1.add(self.TPanedwindow1_p2) self.__funcid0 = self.TPanedwindow1.bind('<Map>', self.__adjust_sash0) self.TPanedwindow2 = ttk.Panedwindow(self.TPanedwindow1_p2, orient="horizontal") self.TPanedwindow2.place(relx=0.08, rely=0.09, relheight=0.85, relwidth=0.86) self.TPanedwindow2.configure(width=200) self.TPanedwindow2_p1 = ttk.Labelframe(width=85, text='Pane 1') self.TPanedwindow2.add(self.TPanedwindow2_p1) self.TPanedwindow2_p2 = ttk.Labelframe(text='Pane 2') self.TPanedwindow2.add(self.TPanedwindow2_p2) self.__funcid1 = self.TPanedwindow2.bind('<Map>', self.__adjust_sash1) self.style.configure('TNotebook.Tab', background=_bgcolor) self.style.configure('TNotebook.Tab', foreground=_fgcolor) self.style.map('TNotebook.Tab', background=[('selected', _compcolor), ('active', _ana2color)]) self.TNotebook1 = ttk.Notebook(self.TPanedwindow2_p2) self.TNotebook1.place(relx=0.06, rely=0.11, relheight=0.83, relwidth=0.89) self.TNotebook1.configure(width=300) self.TNotebook1.configure(takefocus="") self.TNotebook1_t1 = ttk.Frame(self.TNotebook1) self.TNotebook1.add(self.TNotebook1_t1, padding=3) self.TNotebook1.tab( 0, text="Page 1", underline="-1", ) self.TNotebook1_t2 = ttk.Frame(self.TNotebook1) self.TNotebook1.add(self.TNotebook1_t2, padding=3) self.TNotebook1.tab( 1, text="Page 2", underline="-1", ) self.Label1 = Label(self.TNotebook1_t1) self.Label1.place(relx=0.13, rely=0.2, height=27, width=114) self.Label1.configure(activebackground="#ffffcd") self.Label1.configure(background="#f5deb3") self.Label1.configure(disabledforeground="#b8a786") self.Label1.configure(font=font9) self.Label1.configure(highlightbackground="#f5deb3") self.Label1.configure(text='''First Page''') self.Button2 = Button(self.TNotebook1_t1) self.Button2.place(relx=0.37, rely=0.5, height=35, width=70) self.Button2.configure(activebackground="#f4bcb2") self.Button2.configure(background="#f5deb3") self.Button2.configure(command=complex_support.qqq) self.Button2.configure(disabledforeground="#b8a786") self.Button2.configure(font=font9) self.Button2.configure(highlightbackground="#f5deb3") self.Button2.configure(text='''Redo''') self.Message1 = Message(self.TNotebook1_t2) self.Message1.place(relx=0.23, rely=0.3, relheight=0.17, relwidth=0.52) self.Message1.configure(background="#f5deb3") self.Message1.configure(font=font9) self.Message1.configure(highlightbackground="#f5deb3") self.Message1.configure(text='''Second Page''') self.Message1.configure(width=157) self.TSizegrip1 = ttk.Sizegrip(top) self.TSizegrip1.place(anchor=SE, relx=1.0, rely=1.0) self.Button1 = Button(top) self.Button1.place(relx=0.44, rely=0.9, height=35, width=70) self.Button1.configure(activebackground="#f4bcb2") self.Button1.configure(background="#f5deb3") self.Button1.configure(command=complex_support.quit) self.Button1.configure(disabledforeground="#b8a786") self.Button1.configure(font=font9) self.Button1.configure(highlightbackground="#f5deb3") self.Button1.configure(text='''Quit''')
def __init__(self, top=None): '''This class configures and populates the toplevel window. top is the toplevel containing window.''' top.withdraw() time_start = time.time() splash = sup.SplashWindow(top) self.style = ttk.Style() if sys.platform == 'win32': self.style.theme_use('winnative') self.style.configure('.', font='TkDefaultFont') #~ top.geometry('838x455+364+117') top.geometry('850x440') top.title('MSTM studio') #~ top.configure(highlightcolor='black') self.load_images() self.root_panedwin = ttk.Panedwindow(top, orient='horizontal') self.root_panedwin.place(relx=0.0, rely=0.0, relheight=1.0, relwidth=1.0) self.root_panedwin.configure(width=200) self.left_frame = ttk.Frame(width=220.0) self.root_panedwin.add(self.left_frame) #~ self.middle_frame = ttk.Labelframe(width=350, text='View') self.middle_frame = ttk.Frame(width=350) self.root_panedwin.add(self.middle_frame) self.right_frame = ttk.Frame() self.root_panedwin.add(self.right_frame) self.__funcid0 = self.root_panedwin.bind('<Map>', self.__adjust_sash0) self.left_panedwin = ttk.Panedwindow(self.left_frame, orient='vertical') self.left_panedwin.place(relx=0.0, rely=0.0, relheight=1.0, relwidth=1.0) self.left_panedwin.configure(width=200) self.materials_frame = ttk.Labelframe(height=105, text='Materials') self.left_panedwin.add(self.materials_frame) self.spheres_frame = ttk.Labelframe(text='Spheres') self.left_panedwin.add(self.spheres_frame) self.__funcid1 = self.left_panedwin.bind('<Map>', self.__adjust_sash1) self.style.configure('Treeview.Heading', font='TkDefaultFont') self.stvMaterial = ScrolledTreeView(self.materials_frame) self.stvMaterial.place(relx=0.0, y=30, relheight=0.8, relwidth=1.0) self.configure_stvMaterial() self.stvMaterial.bind('<Double-1>', sup.btChangeMatColClick) self.btAddMat = ttk.Button(self.materials_frame, command=sup.btAddMatClick, text='A', image=self.imAdd) self.btAddMat.place(x=5, y=0, height=25, width=25) self.btLoadMat = ttk.Button(self.materials_frame, command=sup.btLoadMatClick, text='L', image=self.imLoad) self.btLoadMat.place(x=30, y=0, height=25, width=25) self.btPlotMat = ttk.Button(self.materials_frame, command=sup.btPlotMatClick, text='P', image=self.imPlot) self.btPlotMat.place(x=55, y=0, height=25, width=25) self.btDelMat = ttk.Button(self.materials_frame, command=sup.btDelMatClick, text='D', image=self.imDelete) self.btDelMat.place(relx=1, x=-30, rely=0, height=25, width=25) self.stvSpheres = ScrolledTreeView(self.spheres_frame) self.stvSpheres.place(relx=0.0, y=30, relheight=0.85, relwidth=1.0) self.configure_stvSpheres() self.stvSpheres.bind('<Double-1>', sup.btEditSphClick) self.btAddSph = ttk.Button(self.spheres_frame, command=sup.btAddSphClick, text='A', image=self.imAdd) self.btAddSph.place(x=5, y=0, height=25, width=25) self.btEditSph = ttk.Button(self.spheres_frame, command=sup.btEditSphClick, text='E', image=self.imEdit) self.btEditSph.place(x=30, y=0, height=25, width=25) self.btPlotSph = ttk.Button(self.spheres_frame, command=sup.btPlotSphClick, text='R', image=self.imRefresh) self.btPlotSph.place(x=55, y=0, height=25, width=25) self.lbEnvMat = ttk.Label(self.spheres_frame, text='Matrix') self.lbEnvMat.place(relx=0.45, y=-5) self.cbEnvMat = ttk.Combobox(self.spheres_frame) self.cbEnvMat.place(relx=0.45, y=10, width=55) self.btDelSph = ttk.Button(self.spheres_frame, command=sup.btDelSphClick, text='D', image=self.imDelete) self.btDelSph.place(relx=1.0, y=0, x=-30, height=25, width=25) self.middle_panedwin = ttk.Panedwindow(self.middle_frame, orient='vertical') self.middle_panedwin.place(relx=0.0, rely=0.0, relheight=1.0, relwidth=1.0) #~ self.middle_panedwin.configure(relwidth=1.0) self.canvas_frame = ttk.Labelframe(height=360, text='View') self.middle_panedwin.add(self.canvas_frame) self.spectrum_frame = ttk.Labelframe(height=-40, text='Spectrum') self.middle_panedwin.add(self.spectrum_frame) self.__funcid2 = self.left_panedwin.bind('<Map>', self.__adjust_sash2) self.canvas = Canvas(self.canvas_frame) self.canvas.place(relx=0.0, rely=0, relheight=1.0, relwidth=1.0) self.canvas.configure(background='white') self.canvas.configure(borderwidth='2') self.canvas.configure(relief='ridge') self.canvas.configure(selectbackground='#c4c4c4') self.canvas.bind('<Button-4>', sup.mouse_wheel) # for Linux self.canvas.bind('<Button-5>', sup.mouse_wheel) # for Linux self.canvas.bind('<MouseWheel>', sup.mouse_wheel) # for Windowz self.canvas.bind('<Button-3>', sup.mouse_down) self.canvas.bind('<B3-Motion>', sup.mouse_move) self.canvas.bind('<ButtonRelease-3>', sup.mouse_up) self.lbZoom = ttk.Label( self.canvas, text='x1.00', background='white') #font=('courier', 18, 'bold'), width=10) self.lbZoom.place(relx=1.0, x=-50, rely=1.0, y=-25) self.lbLambdaMin = ttk.Label(self.spectrum_frame, text='min') self.lbLambdaMin.place(x=5, y=0) self.edLambdaMin = ttk.Entry(self.spectrum_frame) self.edLambdaMin.place(x=5, y=15, width=35) self.edLambdaMin.insert(0, '300') self.lbLambdaMax = ttk.Label(self.spectrum_frame, text='max') self.lbLambdaMax.place(x=45, y=0) self.edLambdaMax = ttk.Entry(self.spectrum_frame) self.edLambdaMax.place(x=45, y=15, width=35) self.edLambdaMax.insert(0, '800') self.lbLambdaCount = ttk.Label(self.spectrum_frame, text='count') self.lbLambdaCount.place(x=85, y=0) self.edLambdaCount = ttk.Entry(self.spectrum_frame) self.edLambdaCount.place(x=85, y=15, width=35) self.edLambdaCount.insert(0, '51') self.btCalcSpec = ttk.Button(self.spectrum_frame, command=sup.btCalcSpecClick, text='Calculate', image=self.imCalc, compound='left') self.btCalcSpec.place(x=130, y=10, width=90, height=25) self.lbSpecScale = ttk.Label(self.spectrum_frame, text='scale') self.lbSpecScale.place(relx=1, x=-115, y=0) self.edSpecScale = ttk.Entry(self.spectrum_frame) self.edSpecScale.place(relx=1, x=-115, y=15, width=50) self.edSpecScale.insert(0, '1') self.btSaveSpec = ttk.Button(self.spectrum_frame, command=sup.btSaveSpecClick, text='S', image=self.imSave) self.btSaveSpec.place(relx=1, x=-55, y=10, width=25, height=25) self.btPlotSpec = ttk.Button(self.spectrum_frame, command=sup.btPlotSpecClick, text='P', image=self.imPlot) self.btPlotSpec.place(relx=1, x=-30, y=10, width=25, height=25) self.right_panedwin = ttk.Panedwindow(self.right_frame, orient='vertical') self.right_panedwin.place(relx=0.0, rely=0.0, relheight=1.0, relwidth=1.0) self.right_panedwin.configure(width=200) self.plot_frame = ttk.Labelframe(height=200, text='Plot') self.right_panedwin.add(self.plot_frame) self.contribs_frame = ttk.Labelframe(height=150, text='Other contributions') self.right_panedwin.add(self.contribs_frame) self.fitting_frame = ttk.Labelframe(height=-50, text='Fitting') self.right_panedwin.add(self.fitting_frame) self.__funcid3 = self.right_panedwin.bind('<Map>', self.__adjust_sash3) # CONTRIBUTIONS self.btAddContrib = ttk.Button(self.contribs_frame, command=sup.btAddContribClick, text='A', image=self.imAdd) self.btAddContrib.place(x=5, y=0, height=25, width=25) self.btPlotAllContribs = ttk.Button(self.contribs_frame, command=sup.btPlotAllContribsClick, text='P', image=self.imPlot) self.btPlotAllContribs.place(x=30, y=0, height=25, width=25) self.btDelContrib = ttk.Button(self.contribs_frame, command=sup.btDelContribClick, text='D', image=self.imDelete) self.btDelContrib.place(relx=1.0, y=0, x=-30, height=25, width=25) self.cbContribs = [] self.edContribs = [] # actually, it will be the list of lists [[]] self.btPlotsContrib = [] self.contribs_list = [ 'ConstBkg', 'LinearBkg', 'LorentzBkg', 'Mie single', 'Mie LN', 'Lorentz peak', 'Gauss peak', 'Au film', 'bst-3Au/glass' ] self.cbContribMats = [] self.btContribDistribPlots = [] # Fitting frame self.edExpFileName = ttk.Entry(self.fitting_frame, text='Exp. file name') self.edExpFileName.place(x=5, y=0, height=25, relwidth=0.8) self.btLoadExp = ttk.Button(self.fitting_frame, command=sup.btLoadExpClick, text='L', image=self.imLoad) self.btLoadExp.place(relx=1.0, x=-55, y=0, height=25, width=25) self.btPlotExp = ttk.Button(self.fitting_frame, command=sup.btPlotExpClick, text='P', image=self.imPlot) self.btPlotExp.place(relx=1.0, x=-30, y=0, height=25, width=25) self.btStartFit = ttk.Button(self.fitting_frame, command=sup.btStartFitClick, text='>', image=self.imPlay) self.btStartFit.place(x=5, y=30, height=25, width=25) self.btStopFit = ttk.Button(self.fitting_frame, command=sup.btStopFitClick, text='|', image=self.imStop) self.btStopFit.place(x=30, y=30, height=25, width=25) self.lbChiSq = ttk.Label(self.fitting_frame, text='ChiSq:') self.lbChiSq.place(x=60, y=35) self.btConstraints = ttk.Button(self.fitting_frame, command=sup.btConstraintsClick, text='Constraints...') self.btConstraints.place(relx=1, x=-100, y=30, height=25, width=95) self._create_menu(top) time_delta = time.time() - time_start # in seconds if time_delta < self.splash_time: time.sleep(self.splash_time - time_delta) top.deiconify() splash.destroy()
def create_generic_options(self): self.generic_copyright = "not added" self.generic_type = StringVar() self.generic_type.set("READ") self.generic_master_id = StringVar() self.generic_start_fifo_level = StringVar() self.generic_start_fifo_level.set("EMPTY") self.generic_fifo_full_level = IntVar() self.generic_ot_limit = IntVar() self.generic_total_txn = IntVar() self.generic_rate = IntVar() self.generic_cmd = StringVar() self.generic_name = StringVar() self.fifo_level_list = ["", "EMPTY", "FULL"] self.type_list = ["", "READ", "WRITE"] self.generic_addressing_type = StringVar() self.generic_addressing_type.set("LINEAR") self.generic_address_base = IntVar() self.generic_address_incr = IntVar() self.generic_address_base_adjust = StringVar() self.generic_address_base_adjust.set("Yes") self.generic_address_min = IntVar() self.generic_address_max = IntVar() self.generic_address_std_dv = IntVar() self.generic_address_mean = IntVar() self.generic_address_shape = IntVar() self.generic_address_scale = IntVar() self.generic_size_type = StringVar() self.generic_size_type.set("FIXED") self.generic_size = IntVar() self.generic_size_min = IntVar() self.generic_size_max = IntVar() self.generic_size_std_dv = IntVar() self.generic_size_mean = IntVar() self.generic_size_shape = IntVar() self.generic_size_scale = IntVar() self.generic_options.add(Label(self.generic_options, text = "Generic General Settings")) self.generic_options.add(Label(self.generic_options, text = "Name")) self.generic_options.add(ttk.Entry(self.generic_options, textvariable=self.generic_name)) self.generic_options.add(Label(self.generic_options, text = "Master ID")) self.generic_options.add(ttk.Entry(self.generic_options, textvariable=self.generic_master_id)) self.generic_options.add(Label(self.generic_options, text = "Transaction Type: ")) self.generic_options.add(ttk.OptionMenu(self.generic_options, self.generic_type, *self.type_list)) self.generic_options.add(Label(self.generic_options, text = "Total Transactions")) self.generic_options.add(ttk.Entry(self.generic_options, textvariable=self.generic_total_txn)) self.generic_options.add(Label(self.generic_options, text = "Rate (B/s)")) self.generic_options.add(ttk.Entry(self.generic_options, textvariable=self.generic_rate)) self.generic_options.add(Label(self.generic_options, text = "Start FIFO Level")) self.generic_options.add(ttk.OptionMenu(self.generic_options, self.generic_start_fifo_level, *self.fifo_level_list)) self.generic_options.add(Label(self.generic_options, text = "FIFO Full Level")) self.generic_options.add(ttk.Entry(self.generic_options, textvariable=self.generic_fifo_full_level)) self.generic_options.add(Label(self.generic_options, text = "OT Limit")) self.generic_options.add(ttk.Entry(self.generic_options, textvariable=self.generic_ot_limit)) self.generic_address_options = ttk.Panedwindow(self.default, orient=VERTICAL) self.generic_linear_options = ttk.Panedwindow(self.generic_address_options, orient=VERTICAL) self.generic_uniform_options = ttk.Panedwindow(self.generic_address_options, orient=VERTICAL) self.generic_normal_options = ttk.Panedwindow(self.generic_address_options, orient=VERTICAL) self.generic_poisson_options = ttk.Panedwindow(self.generic_address_options, orient=VERTICAL) self.generic_weibull_options = ttk.Panedwindow(self.generic_address_options, orient=VERTICAL) self.generic_size_options = ttk.Panedwindow(self.default, orient=VERTICAL) self.generic_size_fixed_options = ttk.Panedwindow(self.generic_size_options, orient=VERTICAL) self.generic_size_uniform_options = ttk.Panedwindow(self.generic_size_options, orient=VERTICAL) self.generic_size_normal_options = ttk.Panedwindow(self.generic_size_options, orient=VERTICAL) self.generic_size_poisson_options = ttk.Panedwindow(self.generic_size_options, orient=VERTICAL) self.generic_size_weibull_options = ttk.Panedwindow(self.generic_size_options, orient=VERTICAL) self.generic_address_options.add(Label(self.generic_address_options, text = "Generic Address Options", justify = LEFT, padx = 20)) self.generic_address_options.add(Label(self.generic_address_options, text = "Choose read address type: ", justify = LEFT, padx = 20)) self.generic_address_options.add(ttk.OptionMenu(self.generic_address_options, self.generic_addressing_type, *self.address_types, command= lambda x : self.generate_address_options(self.generic_address_options, self.generic_addressing_type.get(), 3, self.generic_linear_options, self.generic_uniform_options, self.generic_normal_options, self.generic_poisson_options, self.generic_weibull_options))) self.generic_size_options.add(Label(self.generic_size_options, text = "Generic Size Options", justify = LEFT, padx = 20)) self.generic_size_options.add(Label(self.generic_size_options, text = "Choose data size size type: ", justify = LEFT, padx = 20)) self.generic_size_options.add(ttk.OptionMenu(self.generic_size_options, self.generic_size_type, *self.size_types, command= lambda x : self.generate_size_options(self.generic_size_options, self.generic_size_type.get(), 3, self.generic_size_fixed_options, self.generic_size_uniform_options, self.generic_size_normal_options, self.generic_size_poisson_options, self.generic_size_weibull_options))) self.create_addressing_options("", self.generic_linear_options, self.generic_uniform_options, self.generic_normal_options, self.generic_poisson_options, self.generic_weibull_options, self.generic_address_base, self.generic_address_incr, self.generic_address_min, self.generic_address_max, self.generic_address_std_dv, self.generic_address_mean, self.generic_address_shape, self.generic_address_scale) self.create_size_options("Data", self.generic_size_fixed_options, self.generic_size_uniform_options, self.generic_size_normal_options, self.generic_size_poisson_options, self.generic_size_weibull_options, self.generic_size, self.generic_size_min, self.generic_size_max, self.generic_size_std_dv, self.generic_size_mean, self.generic_size_shape, self.generic_size_scale) self.generic_address_options.add(self.generic_linear_options) self.generic_size_options.add(self.generic_size_fixed_options)
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 = '#b2c9f4' # Closest X11 color: 'SlateGray2' _ana1color = '#eaf4b2' # Closest X11 color: '{pale goldenrod}' _ana2color = '#f4bcb2' # Closest X11 color: 'RosyBrown2' font10 = "-family {DejaVu Sans} -size 14 -weight normal -slant" \ " roman -underline 0 -overstrike 0" font4 = "-family helvetica -size 12 -weight bold -slant roman " \ "-underline 0 -overstrike 0" font9 = "-family {DejaVu Sans Mono} -size 14 -weight normal " \ "-slant roman -underline 0 -overstrike 0" 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=font9) self.style.map('.', background=[('selected', _compcolor), ('active', _ana2color)]) top.geometry("609x642+617+155") top.title("Vrex for Python") top.configure(highlightbackground="wheat") top.configure(highlightcolor="black") self.TPanedwindow1 = ttk.Panedwindow(top, orient="vertical") self.TPanedwindow1.place(relx=0.016, rely=0.016, relheight=0.826, relwidth=0.961) self.TPanedwindow1.configure(width=585) self.TPanedwindow1_f1 = ttk.Labelframe(height=85, text='Regular Expression') self.TPanedwindow1.add(self.TPanedwindow1_f1) self.TPanedwindow1_f2 = ttk.Labelframe(height=91.0, text='Sample') self.TPanedwindow1.add(self.TPanedwindow1_f2) self.TPanedwindow1_f3 = ttk.Labelframe(text='Matches') self.TPanedwindow1.add(self.TPanedwindow1_f3) self.__funcid0 = self.TPanedwindow1.bind('<Map>', self.__adjust_sash0) self.Expression = ScrolledText(self.TPanedwindow1_f1) self.Expression.place(relx=0.017, rely=0.353, relheight=0.541, relwidth=0.959, bordermode='ignore') self.Expression.configure(background="white") self.Expression.configure(font=font4) self.Expression.configure(highlightbackground="wheat") self.Expression.configure(insertborderwidth="3") self.Expression.configure(selectbackground="#c4c4c4") self.Expression.configure(width=10) self.Expression.configure(wrap='none') self.Sample = ScrolledText(self.TPanedwindow1_f2) self.Sample.place(relx=0.017, rely=0.33, relheight=0.549, relwidth=0.959, bordermode='ignore') self.Sample.configure(background="white") self.Sample.configure(font=font4) self.Sample.configure(insertborderwidth="3") self.Sample.configure(selectbackground="#c4c4c4") self.Sample.configure(width=10) self.Sample.configure(wrap='none') self.Sample.bind('<Button-1>', vrex_support.sync_matches) self.Matches = ScrolledText(self.TPanedwindow1_f3) self.Matches.place(relx=0.017, rely=0.087, relheight=0.887, relwidth=0.959, bordermode='ignore') self.Matches.configure(background="white") self.Matches.configure(font=font4) self.Matches.configure(insertborderwidth="3") self.Matches.configure(selectbackground="#c4c4c4") self.Matches.configure(width=10) self.Matches.configure(wrap='none') self.Matches.bind('<Button-1>', vrex_support.sync_sample) self.menubar = tk.Menu(top, font=font10, bg=_bgcolor, fg=_fgcolor) top.configure(menu=self.menubar) self.sub_menu = tk.Menu(top, tearoff=0) self.menubar.add_cascade(menu=self.sub_menu, background="#d9d9d9", font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="File") self.sub_menu.add_command(background="#d9d9d9", command=vrex_support.load_regular_expression, font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="Load regular expression") self.sub_menu.add_command(background="#d9d9d9", command=vrex_support.save_regular_expression, font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="Save regular expression") self.sub_menu.add_separator(background="#d9d9d9") self.sub_menu.add_command(background="#d9d9d9", command=vrex_support.load_sample, font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="Load sample") self.sub_menu.add_command(background="#d9d9d9", command=vrex_support.save_sample, font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="Save sample") self.sub_menu.add_separator(background="#d9d9d9") self.sub_menu.add_command(background="#d9d9d9", command=vrex_support.quit, font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="Quit") self.menubar.add_command(background="#d9d9d9", command=vrex_support.help, font=( 'Nimbus Sans L', 14, 'normal', 'roman', ), label="Help") self.Quit = tk.Button(top) self.Quit.place(relx=0.895, rely=0.857, height=26, width=51) self.Quit.configure(activebackground="#f9f9f9") self.Quit.configure(command=vrex_support.quit) self.Quit.configure(disabledforeground="#b8a786") self.Quit.configure(highlightbackground="wheat") self.Quit.configure(text='''Quit''') self.Match = tk.Button(top) self.Match.place(relx=0.123, rely=0.857, height=26, width=63) self.Match.configure(activebackground="#f9f9f9") self.Match.configure(command=lambda: vrex_support.display(0)) self.Match.configure(disabledforeground="#b8a786") self.Match.configure(highlightbackground="wheat") self.Match.configure(text='''Match''') self.Button1 = tk.Button(top) self.Button1.place(relx=0.279, rely=0.857, height=26, width=34) self.Button1.configure(activebackground="#f9f9f9") self.Button1.configure(background="#ffffff") self.Button1.configure(command=lambda: vrex_support.display(1)) self.Button1.configure(disabledforeground="#b8a786") self.Button1.configure(foreground="blue") self.Button1.configure(highlightbackground="wheat") self.Button1.configure(text='''1''') self.Button2 = tk.Button(top) self.Button2.place(relx=0.345, rely=0.857, height=26, width=34) self.Button2.configure(activebackground="#f9f9f9") self.Button2.configure(background="#ffffff") self.Button2.configure(command=lambda: vrex_support.display(2)) self.Button2.configure(disabledforeground="#b8a786") self.Button2.configure(foreground="darkgreen") self.Button2.configure(highlightbackground="wheat") self.Button2.configure(text='''2''') self.Button3 = tk.Button(top) self.Button3.place(relx=0.411, rely=0.857, height=26, width=34) self.Button3.configure(activebackground="#f9f9f9") self.Button3.configure(background="#ffffff") self.Button3.configure(command=lambda: vrex_support.display(3)) self.Button3.configure(disabledforeground="#b8a786") self.Button3.configure(foreground="magenta") self.Button3.configure(highlightbackground="wheat") self.Button3.configure(text='''3''') self.Button4 = tk.Button(top) self.Button4.place(relx=0.476, rely=0.857, height=26, width=34) self.Button4.configure(activebackground="#f9f9f9") self.Button4.configure(background="#ffffff") self.Button4.configure(command=lambda: vrex_support.display(4)) self.Button4.configure(disabledforeground="#b8a786") self.Button4.configure(foreground="sienna") self.Button4.configure(highlightbackground="wheat") self.Button4.configure(text='''4''') self.Button5 = tk.Button(top) self.Button5.place(relx=0.542, rely=0.857, height=26, width=34) self.Button5.configure(activebackground="#f9f9f9") self.Button5.configure(background="#ffffff") self.Button5.configure(command=lambda: vrex_support.display(5)) self.Button5.configure(disabledforeground="#b8a786") self.Button5.configure(foreground="purple") self.Button5.configure(highlightbackground="wheat") self.Button5.configure(text='''5''') self.Button6 = tk.Button(top) self.Button6.place(relx=0.608, rely=0.857, height=26, width=34) self.Button6.configure(activebackground="#f9f9f9") self.Button6.configure(background="#ffffff") self.Button6.configure(command=lambda: vrex_support.display(6)) self.Button6.configure(disabledforeground="#b8a786") self.Button6.configure(foreground="firebrick") self.Button6.configure(highlightbackground="wheat") self.Button6.configure(text='''6''') self.Button7 = tk.Button(top) self.Button7.place(relx=0.673, rely=0.857, height=26, width=34) self.Button7.configure(activebackground="#f9f9f9") self.Button7.configure(background="#ffffff") self.Button7.configure(command=lambda: vrex_support.display(7)) self.Button7.configure(disabledforeground="#b8a786") self.Button7.configure(foreground="deeppink") self.Button7.configure(highlightbackground="wheat") self.Button7.configure(text='''7''') self.Button8 = tk.Button(top) self.Button8.place(relx=0.739, rely=0.857, height=26, width=34) self.Button8.configure(activebackground="#f9f9f9") self.Button8.configure(background="#ffffff") self.Button8.configure(command=lambda: vrex_support.display(8)) self.Button8.configure(disabledforeground="#b8a786") self.Button8.configure(foreground="green4") self.Button8.configure(highlightbackground="wheat") self.Button8.configure(text='''8''') self.Button9 = tk.Button(top) self.Button9.place(relx=0.805, rely=0.857, height=26, width=34) self.Button9.configure(activebackground="#f9f9f9") self.Button9.configure(background="#ffffff") self.Button9.configure(command=lambda: vrex_support.display(9)) self.Button9.configure(disabledforeground="#b8a786") self.Button9.configure(foreground="deepskyblue1") self.Button9.configure(highlightbackground="wheat") self.Button9.configure(text='''9''') self.Go = tk.Button(top) self.Go.place(relx=0.016, rely=0.857, height=26, width=42) self.Go.configure(activebackground="#f9f9f9") self.Go.configure(command=vrex_support.go) self.Go.configure(disabledforeground="#b8a786") self.Go.configure(highlightbackground="wheat") self.Go.configure(text='''Go''') self.style.configure('TSizegrip', background=_bgcolor) self.TSizegrip1 = ttk.Sizegrip(top) self.TSizegrip1.place(anchor='se', relx=1.0, rely=1.0)
def __init__(self, parent, controller=None, order_index=0): ttk.Frame.__init__(self, parent) self.controller = controller self.order_index = order_index # add a paned window for building/loading and viewing current model: pf = ttk.Panedwindow(self, orient=HORIZONTAL) left_panel = ttk.Labelframe(pf, text='Model Specification', width=600, height=400) right_panel = ttk.Labelframe(pf, text='Current Model', width=400, height=200) # second pane pf.add(left_panel) pf.add(right_panel) pf.grid(column=0, row=0, sticky=(N, W, E, S)) # set this attribute to None- if pre-defined models are loaded, it will be reset. self.model = None ############################ left panel material begin ####################################################### ############################ left tab material begin ######################################################## # add some choice tabs to the left panel- tabs = ttk.Notebook(left_panel) tabs.grid(column=0, row=0, sticky=(N, W, E, S), pady=10) tabs.grid_columnconfigure(0, weight=1) tabs.grid_rowconfigure(0, weight=1) left_panel.grid_columnconfigure(0, weight=1) left_panel.grid_rowconfigure(0, weight=1) # add a frame for the existing model tab predefined_model_frame = ttk.Frame(tabs) header_label = ttk.Label(predefined_model_frame, text="Select a pre-defined model below") header_label.grid(column=0, row=0, sticky=(N, W), pady=10) # populate a listbox for selecting existing models, including a scrollbar self.predefined_model_map = self.get_predefined_models() self.model_names = tuple(self.predefined_model_map.keys()) m_names = StringVar(value=self.model_names) self.predefined_model_listbox = Listbox(predefined_model_frame, listvariable=m_names, selectmode=SINGLE) self.predefined_model_listbox.grid(column=0, row=1, sticky=(N, S, E, W)) scroller = ttk.Scrollbar(predefined_model_frame, orient=VERTICAL, command=self.predefined_model_listbox.yview) scroller.grid(column=1, row=1, sticky=(N, S)) self.predefined_model_listbox['yscrollcommand'] = scroller.set self.predefined_model_listbox.bind('<<ListboxSelect>>', self.display_model_from_listbox) # only allow the listbox to expand/grow with its parent predefined_model_frame.grid_columnconfigure(0, weight=1) predefined_model_frame.grid_rowconfigure(1, weight=1) ############################ left tab material end ########################################################### ############################ right tab material begin ####################################################### model_builder_frame = ttk.Frame(tabs) open_file_label = ttk.Label(model_builder_frame, text='Load model from file:') open_file_button = ttk.Button(model_builder_frame, text='Open', command=self.open_file_dialog) add_reaction_button = ttk.Button(model_builder_frame, text='Create new reaction', command=self.add_new_reaction) or_manual_label = ttk.Label(model_builder_frame, text='Or manually enter reactions:') open_file_label.grid(column=0, row=0, sticky=(N, W), pady=10) open_file_button.grid(column=0, row=1, sticky=(N, W), pady=(0, 10)) or_manual_label.grid(column=0, row=2, sticky=(N, W), pady=10) add_reaction_button.grid(column=0, row=3, sticky=(N, W), pady=(0, 10)) ############################ right tab material end ####################################################### ############################ left panel material end ####################################################### ############################ right panel material begin ####################################################### # an auto-scrolling panel to contain the equations- this way they will not go off-screen on resizing self.reaction_summary_panel = AutoScrollable(right_panel) self.reaction_summary_panel.grid(column=0, row=0, sticky=(N, S, E, W)) # a place to put error messages when submissions have errors: self.submission_error_text = StringVar() self.submission_error_label = ttk.Label( right_panel, textvariable=self.submission_error_text) self.submission_error_label.grid(column=0, row=1, sticky=(N, E), padx=(0, 10)) # a button for moving to the next step in the workflow. Initially disabled, until the model is loaded self.next_button = ttk.Button(right_panel, text='Next') self.next_button['command'] = lambda: self.store_model_and_advance() self.next_button.grid(column=1, row=1, sticky=(N, E), pady=10) self.next_button.state(['disabled']) for child in right_panel.winfo_children(): child.grid_configure(padx=5) right_panel.grid_columnconfigure(0, weight=1) right_panel.grid_rowconfigure(0, weight=1) ############################ right panel material end ######################################################### # add the panels to the respective tabs: tabs.add(predefined_model_frame, text='Predefined Models') tabs.add(model_builder_frame, text='Create a model') self.grid_columnconfigure(0, weight=1) self.grid_rowconfigure(0, weight=1) self.current_reaction_widget_dict = {} self.reaction_indexer = 0 # keeps track of maximum index for the dictionary above
def __init__(self, master=None): Root = master self.Debug = True self.LastDir = '.' self.PageId = '' self.PageList = {} self.ConfList = {} self.CfgDataObj = None self.OrgCfgDataBin = None Frame.__init__(self, master, borderwidth=2) self.MenuString = [ 'Save Config Data to Binary', 'Load Config Data from Binary', 'Load Config Changes from Delta File', 'Save Config Changes to Delta File', 'Save Full Config Data to Delta File' ] Root.geometry("1200x800") Paned = ttk.Panedwindow(Root, orient=HORIZONTAL) Paned.pack(fill=BOTH, expand=True, padx=(4, 4)) Status = Label(master, text="", bd=1, relief=SUNKEN, anchor=W) Status.pack(side=BOTTOM, fill=X) FrameLeft = ttk.Frame(Paned, height=800, relief="groove") self.Left = ttk.Treeview(FrameLeft, show="tree") # Set up tree HScroller Pady = (10, 10) self.TreeScroll = ttk.Scrollbar(FrameLeft, orient="vertical", command=self.Left.yview) self.Left.configure(yscrollcommand=self.TreeScroll.set) self.Left.bind('<<TreeviewSelect>>', self.OnConfigPageSelectChange) self.Left.pack(side='left', fill=BOTH, expand=True, padx=(5, 0), pady=Pady) self.TreeScroll.pack(side='right', fill=Y, pady=Pady, padx=(0, 5)) FrameRight = ttk.Frame(Paned, relief="groove") self.FrameRight = FrameRight self.ConfCanvas = Canvas(FrameRight, highlightthickness=0) self.PageScroll = ttk.Scrollbar(FrameRight, orient="vertical", command=self.ConfCanvas.yview) self.RightGrid = ttk.Frame(self.ConfCanvas) self.ConfCanvas.configure(yscrollcommand=self.PageScroll.set) self.ConfCanvas.pack(side='left', fill=BOTH, expand=True, pady=Pady, padx=(5, 0)) self.PageScroll.pack(side='right', fill=Y, pady=Pady, padx=(0, 5)) self.ConfCanvas.create_window(0, 0, window=self.RightGrid, anchor='nw') self.ConfCanvas.bind("<Configure>", self.OnCanvasConfigure) Paned.add(FrameLeft, weight=2) Paned.add(FrameRight, weight=10) Style = ttk.Style() Style.layout("Treeview", [('Treeview.treearea', {'sticky': 'nswe'})]) Menubar = Menu(Root) FileMenu = Menu(Menubar, tearoff=0) FileMenu.add_command(label="Open Config DSC file...", command=self.LoadFromDsc) FileMenu.add_command(label=self.MenuString[0], command=self.SaveToBin, state='disabled') FileMenu.add_command(label=self.MenuString[1], command=self.LoadFromBin, state='disabled') FileMenu.add_command(label=self.MenuString[2], command=self.LoadFromDelta, state='disabled') FileMenu.add_command(label=self.MenuString[3], command=self.SaveToDelta, state='disabled') FileMenu.add_command(label=self.MenuString[4], command=self.SaveFullToDelta, state='disabled') FileMenu.add_command(label="About", command=self.About) Menubar.add_cascade(label="File", menu=FileMenu) self.FileMenu = FileMenu Root.config(menu=Menubar) if len(sys.argv) > 1: self.LoadDscFile(sys.argv[1])
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 = '#d9d9d9' # X11 color: 'gray85' 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("683x697+387+84") top.title("New Toplevel 1") top.configure(background="#d9d9d9") top.configure(highlightbackground="#d9d9d9") top.configure(highlightcolor="black") self.TPanedwindow1 = ttk.Panedwindow(top, orient="vertical") self.TPanedwindow1.place(relx=0.01, rely=0.01, relheight=0.97, relwidth=0.97) self.TPanedwindow1.configure(width=200) self.extractTextTPane = ttk.Labelframe(height=280, text='Extract Text') self.TPanedwindow1.add(self.extractTextTPane) self.imageSearchTPane = ttk.Labelframe(text='Search Image') self.TPanedwindow1.add(self.imageSearchTPane) self.__funcid0 = self.TPanedwindow1.bind('<Map>', self.__adjust_sash0) self.imgPathFrame = Frame(self.extractTextTPane) self.imgPathFrame.place(relx=0.05, rely=0.11, relheight=0.21, relwidth=0.9, y=-12, h=12) self.imgPathFrame.configure(relief=GROOVE) self.imgPathFrame.configure(borderwidth="5") self.imgPathFrame.configure(relief=GROOVE) self.imgPathFrame.configure(background="#d9d9d9") self.imgPathFrame.configure(highlightbackground="#d9d9d9") self.imgPathFrame.configure(highlightcolor="black") self.imgPathFrame.configure(width=597) self.pathTLabel = ttk.Label(self.imgPathFrame) self.pathTLabel.place(relx=0.03, rely=0.17, height=30, width=42) self.pathTLabel.configure(background="#d9d9d9") self.pathTLabel.configure(foreground="#000000") self.pathTLabel.configure(relief=FLAT) self.pathTLabel.configure(text='''Path:''') self.pathText = Text(self.imgPathFrame) self.pathText.place(relx=0.1, rely=0.2, relheight=0.49, relwidth=0.7) self.pathText.configure(background="white") self.pathText.configure(font="TkTextFont") self.pathText.configure(foreground="black") self.pathText.configure(highlightbackground="#d9d9d9") self.pathText.configure(highlightcolor="black") self.pathText.configure(insertbackground="black") self.pathText.configure(selectbackground="#c4c4c4") self.pathText.configure(selectforeground="black") self.pathText.configure(undo="1") self.pathText.configure(width=10) self.pathText.configure(wrap=WORD) self.browseTButton = ttk.Button(self.imgPathFrame, command=self.load_file) self.browseTButton.place(relx=0.72, rely=0.2, height=29, width=76) self.browseTButton.configure(takefocus="") self.browseTButton.configure(text='''Browse''') self.browseTButton.configure(compound="center") self.imgTxtScrolled = ScrolledText(self.extractTextTPane) self.imgTxtScrolled.place(relx=0.05, rely=0.35, relheight=0.21, relwidth=0.72, y=-12, h=12) self.imgTxtScrolled.configure(background="white") self.imgTxtScrolled.configure(font="TkTextFont") self.imgTxtScrolled.configure(foreground="black") self.imgTxtScrolled.configure(highlightbackground="#d9d9d9") self.imgTxtScrolled.configure(highlightcolor="black") self.imgTxtScrolled.configure(insertbackground="black") self.imgTxtScrolled.configure(insertborderwidth="3") self.imgTxtScrolled.configure(selectbackground="#c4c4c4") self.imgTxtScrolled.configure(selectforeground="black") self.imgTxtScrolled.configure(undo="1") self.imgTxtScrolled.configure(width=10) self.imgTxtScrolled.configure(wrap=NONE) self.TargetLanguageList1 = Listbox(self.extractTextTPane) self.TargetLanguageList1.place(relx=0.2, rely=0.61, relheight=0.11, relwidth=0.17, y=-12, h=12) self.TargetLanguageList1.configure(background="white") self.TargetLanguageList1.configure(disabledforeground="#a3a3a3") self.TargetLanguageList1.configure(font="TkFixedFont") self.TargetLanguageList1.configure(foreground="#000000") self.TargetLanguageList1.configure(highlightbackground="#d9d9d9") self.TargetLanguageList1.configure(highlightcolor="black") self.TargetLanguageList1.configure(selectbackground="#c4c4c4") self.TargetLanguageList1.configure(selectforeground="black") self.TargetLanguageList1.configure(width=114) self.TargetLanguageList1.insert(END, "en") self.TargetLanguageList1.insert(END, "fr") self.TargetLanguageList1.insert(END, "de") self.Translate = Button(self.extractTextTPane, command=self.translate_word) self.Translate.place(relx=0.69, rely=0.61, height=24, width=129, y=-12) self.Translate.configure(activebackground="#d9d9d9") self.Translate.configure(activeforeground="#000000") self.Translate.configure(background="#d9d9d9") self.Translate.configure(disabledforeground="#a3a3a3") self.Translate.configure(foreground="#000000") self.Translate.configure(highlightbackground="#d9d9d9") self.Translate.configure(highlightcolor="black") self.Translate.configure(pady="0") self.Translate.configure(text='''Translate''') self.TargetLanguageTextScrolled = Entry(self.extractTextTPane) self.TargetLanguageTextScrolled.place(relx=0.05, rely=0.71, relheight=0.22, relwidth=0.91, y=-12, h=12) self.TargetLanguageTextScrolled.configure(background="white") self.TargetLanguageTextScrolled.configure(font="TkTextFont") self.TargetLanguageTextScrolled.configure(foreground="black") self.TargetLanguageTextScrolled.configure( highlightbackground="#d9d9d9") self.TargetLanguageTextScrolled.configure(highlightcolor="black") self.TargetLanguageTextScrolled.configure(insertbackground="black") self.TargetLanguageTextScrolled.configure(insertborderwidth="3") self.TargetLanguageTextScrolled.configure(selectbackground="#c4c4c4") self.TargetLanguageTextScrolled.configure(selectforeground="black") self.TargetLanguageTextScrolled.configure(width=10) self.Label1 = Label(self.extractTextTPane) self.Label1.place(relx=0.05, rely=0.61, height=21, width=94, y=-12) self.Label1.configure(activebackground="#f9f9f9") self.Label1.configure(activeforeground="black") self.Label1.configure(anchor=E) self.Label1.configure(background="#d9d9d9") self.Label1.configure(disabledforeground="#a3a3a3") self.Label1.configure(foreground="#000000") self.Label1.configure(highlightbackground="#d9d9d9") self.Label1.configure(highlightcolor="black") self.Label1.configure(text='''Enter Language''') self.Text3 = Text(self.extractTextTPane) self.Text3.place(relx=0.78, rely=0.36, relheight=0.12, relwidth=0.16, y=-12, h=12) self.Text3.configure(background="white") self.Text3.configure(font="TkTextFont") self.Text3.configure(foreground="black") self.Text3.configure(highlightbackground="#d9d9d9") self.Text3.configure(highlightcolor="black") self.Text3.configure(insertbackground="black") self.Text3.configure(selectbackground="#c4c4c4") self.Text3.configure(selectforeground="black") self.Text3.configure(undo="1") self.Text3.configure(width=104) self.Text3.configure(wrap=WORD) self.getImgFrame = Frame(self.imageSearchTPane) self.getImgFrame.place(relx=0.05, rely=0.08, relheight=0.17, relwidth=0.9, y=-12, h=12) self.getImgFrame.configure(relief=GROOVE) self.getImgFrame.configure(borderwidth="5") self.getImgFrame.configure(relief=GROOVE) self.getImgFrame.configure(background="#d9d9d9") self.getImgFrame.configure(highlightbackground="#d9d9d9") self.getImgFrame.configure(highlightcolor="black") self.getImgFrame.configure(width=125) self.typeTLabel = ttk.Label(self.getImgFrame) self.typeTLabel.place(relx=0.03, rely=0.23, height=33, width=78) self.typeTLabel.configure(background="#d9d9d9") self.typeTLabel.configure(foreground="#000000") self.typeTLabel.configure(relief=FLAT) self.typeTLabel.configure(text='''Enter Text:''') self.searchText = Entry(self.getImgFrame) self.searchText.place(relx=0.19, rely=0.25, relheight=0.5, relwidth=0.63) self.searchText.configure(background="white") self.searchText.configure(font="TkTextFont") self.searchText.configure(selectbackground="#c4c4c4") self.searchText.configure(width=10) self.searchTButton = ttk.Button(self.getImgFrame, command=self.searchImg) self.searchTButton.place(relx=0.74, rely=0.23, height=33, width=84) self.searchTButton.configure(takefocus="") self.searchTButton.configure(text='''Search''') self.searchImgFrame = Frame(self.imageSearchTPane) self.searchImgFrame.place(relx=0.05, rely=0.3, relheight=0.24, relwidth=0.9) self.searchImgFrame.configure(relief=GROOVE) self.searchImgFrame.configure(borderwidth="5") self.searchImgFrame.configure(relief=GROOVE) self.searchImgFrame.configure(width=125) self.imgCanvas = Canvas(self.searchImgFrame, scrollregion=(0, 0, 3000, 3000)) self.imgCanvas.place(relx=0, rely=0, relheight=1, relwidth=1) self.imgCanvas.configure(background="grey") self.imgCanvas.configure(borderwidth="2") self.imgCanvas.configure(relief=RIDGE) self.imgCanvas.configure(selectbackground="#c4c4c4") self.imgCanvas.configure(width=378) self.hbar = Scrollbar(self.searchImgFrame, orient=HORIZONTAL) self.hbar.pack(side=BOTTOM, fill=X) self.hbar.config(command=self.imgCanvas.xview) self.vbar = Scrollbar(self.searchImgFrame, orient=VERTICAL) self.vbar.pack(side=RIGHT, fill=Y) self.vbar.config(command=self.imgCanvas.yview) self.imgCanvas.config(xscrollcommand=self.hbar.set, yscrollcommand=self.vbar.set) self.imgCanvas.pack(side=LEFT, expand=True, fill=BOTH) self.InputText = Entry(self.imageSearchTPane, validate='key', validatecommand=self.my_validater) self.InputText.place(relx=0.05, rely=0.59, relheight=0.09, relwidth=0.88, y=-12, h=12) self.InputText.configure(background="white") self.InputText.configure(font="TkTextFont") self.InputText.configure(foreground="black") self.InputText.configure(highlightbackground="#d9d9d9") self.InputText.configure(highlightcolor="black") self.InputText.configure(insertbackground="black") self.InputText.configure(selectbackground="#c4c4c4") self.InputText.configure(selectforeground="black") self.InputText.configure(width=584) self.OutputText = Entry(self.imageSearchTPane) self.OutputText.place(relx=0.05, rely=0.82, relheight=0.09, relwidth=0.88, y=-12, h=12) self.OutputText.configure(background="white") self.OutputText.configure(font="TkTextFont") self.OutputText.configure(foreground="black") self.OutputText.configure(highlightbackground="#d9d9d9") self.OutputText.configure(highlightcolor="black") self.OutputText.configure(insertbackground="black") self.OutputText.configure(selectbackground="#c4c4c4") self.OutputText.configure(selectforeground="black") self.OutputText.configure(width=584) self.TargetLanguageList2 = Listbox(self.imageSearchTPane) self.TargetLanguageList2.place(relx=0.2, rely=0.72, relheight=0.08, relwidth=0.22, y=-12, h=12) self.TargetLanguageList2.configure(background="white") self.TargetLanguageList2.configure(disabledforeground="#a3a3a3") self.TargetLanguageList2.configure(font="TkFixedFont") self.TargetLanguageList2.configure(foreground="#000000") self.TargetLanguageList2.configure(highlightbackground="#d9d9d9") self.TargetLanguageList2.configure(highlightcolor="black") self.TargetLanguageList2.configure(selectbackground="#c4c4c4") self.TargetLanguageList2.configure(selectforeground="black") self.TargetLanguageList2.configure(width=144) self.TargetLanguageList2.insert(END, "en") self.TargetLanguageList2.insert(END, "fr") self.TargetLanguageList2.insert(END, "de") self.Translate2 = Button(self.imageSearchTPane) self.Translate2.place(relx=0.69, rely=0.72, height=24, width=127, y=-12) self.Translate2.configure(activebackground="#d9d9d9") self.Translate2.configure(activeforeground="#000000") self.Translate2.configure(background="#d9d9d9") self.Translate2.configure(disabledforeground="#a3a3a3") self.Translate2.configure(foreground="#000000") self.Translate2.configure(highlightbackground="#d9d9d9") self.Translate2.configure(highlightcolor="black") self.Translate2.configure(pady="0") self.Translate2.configure(text='''Translate''') self.Label1_1 = Label(self.imageSearchTPane) self.Label1_1.place(relx=0.05, rely=0.71, height=21, width=94, y=-12) self.Label1_1.configure(activebackground="#f9f9f9") self.Label1_1.configure(activeforeground="black") self.Label1_1.configure(anchor=E) self.Label1_1.configure(background="#d9d9d9") self.Label1_1.configure(disabledforeground="#a3a3a3") self.Label1_1.configure(foreground="#000000") self.Label1_1.configure(highlightbackground="#d9d9d9") self.Label1_1.configure(highlightcolor="black") self.Label1_1.configure(text='''Enter Language''')