Пример #1
0
    def __init__(self, manager):
        self.manager = manager
        self.master = manager.root
        self.config = manager.config

        # frames
        self.__display_main_only = False
        self.frame = self.root_frame = Frame(self.master, padx=5, pady=5)
        self.left_frame = self.main_frame = Frame(self.frame)
        self.right_frame = Frame(self.frame)
        self.bottom_frame = Frame(self.frame)
        self.next_button = Button(self.bottom_frame,
                                  text='>>',
                                  command=lambda: None)
        # self.next_button.place(relx=0.5, rely=0.5, anchor='center')
        # self.next_button.grid(row=0, sticky='n')
        self.next_button.pack(fill='x')

        self.__start_time = None
        self.__end_time = None

        self.__interval_alarm_id = None
    def __init__(self, master, system):
        """Constructor method. Used to defines the layers."""
        
        self.master         = master
        self.system         = system
        self.version        = system.version
        self.fonttype       = system.fonttype
        self.formulatype    = system.formulatype
        self.superfont      = get_superfont(self.fonttype)
        self.subfont        = get_superfont(self.formulatype)
        self.tframe         = Frame(master.tframe)
        self.frame          = Frame(master.frame)
        self.bframe         = Frame(master.bframe)
        self.bgcolor        = self.frame.cget('bg')
        self.top            = None

        self.chemicals      = system.chemicals
        
        if master.master is None: self.defaults = 1

        if system.reactions is None: self.reactions      = []
        else:                        self.reactions      = system.reactions
Пример #3
0
    def __init__(self, master, system, matrix):
        """Constructor method.  Defines the parameters to be obtained in this
        window."""

        self.master = master
        self.fonttype = system.fonttype
        self.version = system.version
        self.superfont = get_superfont(self.fonttype)  #superscript font
        self.tframe = Frame(master.tframe)
        self.frame = Frame(master.frame)
        self.bframe = Frame(master.bframe)
        self.top = None  #flag for existence of toplevel#

        self.matrix = matrix
        self.name = StringVar(value=matrix.name)  #stores the chemical name
        self.model = StringVar(value=matrix.model)  #stores the chemical name
        self.e = DoubleVar(value=matrix.e)  #stores the porosity
        self.rho = DoubleVar(value=matrix.rho)  #stores the bulk density
        self.foc = DoubleVar(
            value=matrix.foc)  #stores the organic carbon fraction

        self.cancelflag = 0
Пример #4
0
    def buttonbox(self):
        '''add modified button box.
        override standard one to get rid of key bindings which cause trouble with text widget
        '''

        box = Frame(self)
        w = Button(box, text="OK", width=10, command=self.ok, default=ACTIVE)
        w.pack(side=LEFT, padx=5, pady=5)
        w = Button(box, text="Cancel", width=10, command=self.cancel)
        w.pack(side=LEFT, padx=5, pady=5)
        # self.bind("<Return>", self.ok)
        # self.bind("<Escape>", self.cancel)
        box.pack()
Пример #5
0
    def build_dlg(self):
        self.var_name = StringVar(self.top)
        self.var_name.set(self.basename)

        frame = Frame(self.top)
        frame.pack(side=TOP, fill=BOTH, expand=1)

        text = filename_dialog_text % self.num_colors
        label = Label(frame, text=text, justify="left")
        label.grid(column=0, row=0, sticky=E, columnspan=2)

        label = Label(frame, text=_("Basename:"))
        label.grid(column=0, row=1, sticky=E)
        entry = Entry(frame, width=15, textvariable=self.var_name)
        entry.grid(column=1, row=1)

        frame = Frame(self.top)
        frame.pack(side=BOTTOM, fill=X, expand=1)
        button = Button(frame, text=_("OK"), command=self.ok)
        button.pack(side=LEFT, expand=1)
        button = Button(frame, text=_("Cancel"), command=self.cancel)
        button.pack(side=LEFT, expand=1)
Пример #6
0
    def __init__(self):
        self.master = Tk()
        self.master.title('About fabian')
        frame = Frame(self.master, width=500, height=400, bd=1)
        frame.pack()

        frameAbout = Frame(frame, bd=0)
        message = "\nfabian (%s) was brought to you by \n\n\
Henning O. Sorensen & Erik Knudsen\n\
Center for Fundamental Research: Metal Structures in Four Dimensions\n\
Risoe National Laboratory\n\
Frederiksborgvej 399\n\
DK-4000 Roskilde\n\
email: [email protected]"%(Fabian.__version__)

        Message(frameAbout, text=message,width=500).pack(fill=X, padx=5)
        frameAbout.pack(expand=1, pady=10, padx=5)

        frameAbout = Frame(frame, bd=0)
        Button(frameAbout,text='So what', bg='red', command=self.quit)\
                                          .pack(side=RIGHT)
        frameAbout.pack(expand=1, pady=10, padx=5)
    def build_finalbuttons(self):

        _ypadhere_ = 1
        Frame(self).pack(side="top", fill='x', pady=35)  # Space

        _row_ = self
        self.b1 = Button(_row_,
                         text='Convert',
                         command=self.getdata_and_convert)
        self.b1.pack(side='right', padx=30, pady=_ypadhere_)

        b2 = Button(_row_, text='Quit', command=self.quit)
        b2.pack(side='right', padx=10, pady=_ypadhere_)
Пример #8
0
 def _initTeam(self):
     self.teamframe = Frame(self, borderwidth=1, relief=GROOVE)
     labteamname = Label(self.teamframe, text="Teamname:")
     labteamname.grid(row=0, sticky=N + S + E + W)
     txtteamname = Entry(self.teamframe)
     txtteamname.grid(row=0, column=1, sticky=N + S + E + W)
     self.vteamname = StringVar()
     self.vteamname.set("Amazonen")  # initialize
     button = apply(OptionMenu,
                    (self.teamframe, self.vteamname) + tuple(self.races))
     button.bind("<FocusOut>", self.changedTeamCallback)
     button.grid(row=2, column=0, sticky=N + S + E + W)
     self.teamframe.grid(row=1, column=0, sticky=N + S + E + W)
Пример #9
0
    def mkALU(self, f):
        self.ALUframe = Frame(f)
        self.ALUframe.config(relief=GROOVE)
        self.ALUframe.config(borderwidth=2)

        self.mkFunctionChoice(self.ALUframe)
        self.mkStates(self.ALUframe)

        self.ALUframe.grid(row=23,
                           column=9,
                           rowspan=3,
                           columnspan=4,
                           sticky="wens")
Пример #10
0
    def __init__(self, master, system, materials):

        """Constructor method. Defines the parameters to be obtained in this window."""

        self.master    = master
        self.fonttype  = system.fonttype
        self.version   = system.version
        self.superfont = get_superfont(self.fonttype) #superscript font
        self.tframe    = Frame(master.tframe)
        self.frame     = Frame(master.frame)
        self.bframe    = Frame(master.bframe)
        self.top       = None                   #flag for existence of toplevel#

        self.system    = system
        self.materials = materials

        if system.matrices is None:
            self.matrices  = []
            self.nmatrices = 0
        else:
            self.matrices  = system.matrices
            self.nmatrices = system.nmatrices
Пример #11
0
def init_slow_time(root):
    slow_time_frame = Frame(root)
    slow_time_frame.pack(fill=X)

    slow_time_label = Label(slow_time_frame, text='Slowing time [0; 10] sec:')
    slow_time_label.pack(side='left')

    slow_time = Spinbox(slow_time_frame, from_=0, to=10, width=4)
    slow_time.delete(0, 1)
    slow_time.insert(0, 5)
    slow_time.pack(side='right')

    return slow_time_frame, slow_time_label, slow_time
Пример #12
0
 def setupWindow(self):
     self.f_inp = Frame(self.mwin)
     self.f_inp.pack(side='left')
     self.f_plot = Frame(self.mwin)
     self.f_plot.pack(side='right')
     self.c = FigureCanvasTkAgg(self.fig, master=self.f_plot)
     self.c.show()
     self.c.get_tk_widget().pack(side=TOP, fill=BOTH, expand=1)
     # setup the input area
     self.f_actn = LabelFrame(self.f_inp, text='action')
     self.f_actn.grid(row=0, column=0)
     self.f_gg = Frame(self.f_actn)
     self.f_gg.pack()
     l_gg = Label(self.f_gg, text='generations')
     l_gg.pack()
     self.e_gg = Entry(self.f_gg)
     self.e_gg.pack()
     self.e_gg.insert(0, '40')  # number of generations
     self.b_rini = Button(self.f_actn, text='randini', command=self.randini)
     self.b_rini.pack()
     self.b_run1 = Button(self.f_actn,
                          text='update & run',
                          command=self.run_with_readout)
     self.b_run1.pack()
     self.b_run2 = Button(self.f_actn,
                          text='run (continue)',
                          command=self.run_no_readout)
     self.b_run2.pack()
     if len(self.vl): self.add_entries(self.vl)
     # draw initial plot
     self.draw_ini_solu(
     )  # sort of setting up instructive initial geometry plot of non-optimised geometry
     self.acp_ini()
     self.f_tb = Frame(self.f_plot)
     self.f_tb.pack()
     self.tb = NavigationToolbar2TkAgg(self.c, self.f_tb)
     self.c2 = Canvas(self.f_inp, width=80, height=140)
     self.c2.grid(row=4, column=0)
     self.ini_mstep_bar()
    def makeInputs(self, frame):
        #builds the frame which will hold all the inputs and their labels
        self.InputFrame = Frame(frame)
        self.InputFrameDesc = Frame(frame)
        #places this frame at co-ord (0,0) of the master frame
        self.InputFrame.grid(column = 0, row = 0)
        self.InputFrameDesc.grid(column = 4, row = 0)
        #the lables
        self.lbln = Label(self.InputFrame, text = "n=0,1,2,..", justify=LEFT)
        self.lbln.grid(column= 0,row= 0)

        self.textleftgraph = StringVar()
        self.textlefth = Label(self.InputFrameDesc, textvariable = self.textleftgraph, wraplength=300)
        self.textleftgraph.set("The quantum harmonic oscillator is one of the foundation problems of quantum mechanics. It can be applied rather directly to the explanation"
"of the vibration spectra of diatomic molecules, but has implications far beyond such simple systems. It is the foundation for the understanding of complex modes of vibration"
" in larger molecules, the motion of atoms in a solid lattice, the theory of heat capacity, etc. The wavefunctions for the quantum harmonic oscillator contain the Gaussian"
            " form which allows them to satisfy the necessary boundary conditions at infinity. The wave function of it is:")
        self.textlefth.grid(column= 0, columnspan=3, row=0)


        #add gif in the right hand side column which is an equarion.
        self.photo = PhotoImage(file="harmwav.gif")
        #InputFrame2 tells the program to place the gif in the right hand column of the program.
        self.photoloc = Label(self.InputFrameDesc, image=self.photo)
        #This tells the program which row to place the picture in.
        self.photoloc.grid(column=0, columnspan=3, row=1)



        #Entry Boxes
        self.entn = Scale(self.InputFrame, from_=0, to=10, orient=HORIZONTAL)
        self.entn.grid(column = 1, row = 0)

        self.button = Button(frame,text="?", fg="red",command=self.writeB1)#creates the first button changing the colour. the command is put in which will later be defined
        self.button.grid(column = 2, row = 0)
        #A button!
        #I have used the co-ord (0,9) just to show that it will auto remove blank rows/columns
        self.butPlot = Button(self.InputFrame, text ='PLOT', command = self.calcPattern)# pressing the button runs the method calcPattern
        self.butPlot.grid(column = 0, row = 1)
Пример #14
0
    def __init__(self, master, title, width, body_background="white", background="#f0f0f0", foreground="#333333", selected_background="#1ba1e2", selected_foreground="white", active_foreground="#0067cb", cursor="hand1"):
        Frame.__init__(self, master, background="white")
        self._title = title

        self._background = background
        self._foreground = foreground
        self._active_foreground = active_foreground
        self._selected_foreground = selected_foreground
        self._selected_background = selected_background

        self._cursor = cursor
        
        self._right_arrow_icon = BitmapImage(data=base64.b64decode(Chord.RIGHT_ARROW_ICON))
        self._down_arrow_icon = BitmapImage(data=base64.b64decode(Chord.DOWN_ARROW_ICON))
        
        self._caption = Frame(self, width =width, background=background, padx=2)
        self._caption.pack(fill=X, pady=(0,2))
        self._caption.pack_propagate(False)

        self._icon_label = Label(self._caption, image=self._right_arrow_icon, background=background)
        self._icon_label.pack(side=LEFT)

        self._title_label = Label(self._caption, text=title, bg = background, fg=foreground)
        self._title_label.pack(side=LEFT, padx=4, fill=X)

        self._caption.configure(height= self._title_label.winfo_reqheight())

        self.body = Frame(self, background=body_background)
        self._body_height = None

        self._is_opened = False
        self._is_animating = False

        self._caption.bind('<Button-1>', self._on_click)
        self._title_label.bind('<Button-1>', self._on_click)
        self._icon_label.bind('<Button-1>', self._on_click)

        self._caption.bind('<Enter>', self._on_enter)
        self._caption.bind('<Leave>', self._on_leave)
Пример #15
0
 def display_config(self):
     """Display the tabbed frame (one tab per category -- `self.config` keys, and one text field
     per parameter)
     """
     # Tabbed frame with the parameters organized by category
     notebook = ttk.Notebook(self.master)
     help_font = tkFont.Font(slant='italic', size=10)
     self.entry_variables = {}
     for tab, options in self.config.items():
         self.entry_variables[tab] = {}
         tab_frame = Frame(notebook)
         notebook.add(tab_frame, text=tab)
         for row, option in enumerate(options):
             Label(tab_frame, text=option).grid(row=row)
             # link a tk inter dedicated variable to the parameter entry
             self.entry_variables[tab][option] = _TKINTER_VARS[
                 options[option]['type']]()
             self.entry_variables[tab][option].set(options[option]['value'])
             param = Entry(tab_frame,
                           textvariable=self.entry_variables[tab][option])
             param.grid(row=row, column=1)
             help_msg = ''
             if 'help' in options[option]:
                 help_msg = options[option]['help'] + ' '
             help_msg += '(type: %s)' % options[option]['type']
             Label(tab_frame, text=help_msg, font=help_font).grid(row=row,
                                                                  column=2)
     notebook.pack(expand=True, fill='both')
     # Buttons
     buttons_frame = Frame(self.master)
     self.ok = Button(buttons_frame)
     self.ok['text'] = 'OK'
     self.ok['command'] = self.update_and_quit
     self.ok.grid(row=0, column=0)
     self.cancel = Button(buttons_frame)
     self.cancel['text'] = 'Annuler'
     self.cancel['command'] = self.quit
     self.cancel.grid(row=0, column=1)
     buttons_frame.pack()
Пример #16
0
def show_info(*args):
    if list_box.curselection():
        cs_name = list_box.get(list_box.curselection())
        cs = cardsets_dict[cs_name]
        fn = os.path.join(cs.dir, 'COPYRIGHT')
        top = Toplevel()
        text = Text(top)
        text.insert('insert', open(fn).read())
        text.pack(expand=YES, fill=BOTH)
        b_frame = Frame(top)
        b_frame.pack(fill=X)
        button = Button(b_frame, text='Close', command=top.destroy)
        button.pack(side=RIGHT)
Пример #17
0
 def body(self):
     from Tkinter import NW, E, Frame, Label, Button
     self.top = Frame(self)
     self.top.grid(row=1,column=1,sticky=E)
     self.label = Label(self.top, text=self.message, justify='center')
     self.label.grid(row=1, column=1, padx=5, pady=5,
                                 columnspan=len(self.buttons),sticky=NW)
     for n, b in enumerate(self.buttons):
         b = Button(self.top, text=b, command=lambda b=b: self.selected(b))
         b.grid(row=2, column=n, sticky=NW, pady=5, padx=5)
         if self.initial_focus == self:
             self.initial_focus = b
         b.focus_set()
Пример #18
0
 def make_frame(self, labeltext=None):
     if labeltext:
         l = Label(self.top, text=labeltext)
         l.grid(row=self.row, column=0, sticky="ne", padx=6, pady=6)
     f = Frame(self.top)
     f.grid(row=self.row,
            column=1,
            columnspan=1,
            sticky="nwe",
            padx=6,
            pady=6 if labeltext else 0)
     self.row = self.row + 1
     return f
Пример #19
0
    def __init__(self, resu1, resu2, mac):
        from Calc_essai.outils_ihm import MacWindowFrame
        from Tkinter import Tk, Frame, StringVar, Entry, Label, Button

        self.resu1 = resu1
        self.resu2 = resu2
        self.mac = mac
        self.root = Tk()

        nom1 = resu1.nom
        nom2 = resu2.nom
        titre = "MAC pour la base " + nom1 + " et " + nom2
        size = (20, 300)

        # la fenetre de MAC
        mac_win = MacWindowFrame(self.root, titre, nom1, nom2, size)
        mac_win.grid(row=0, column=0)

        self.freq1 = get_modes(resu1)
        self.freq2 = get_modes(resu2)
        # la variable NUMERIQUE qui contient ces memes listes. On remplit
        # ces valeurs quand on ferme la fenetre
        self.l1 = None
        self.l2 = None
        # la variable GRAPHIQUE qui donne le contenu des listes
        self.var_l1 = StringVar()
        self.var_l2 = StringVar()

        mac_win.set_modes(self.freq1, self.freq2, self.mac)

        # Une deuxieme fentre, dans laquelle on peut modifier l'appariement des
        # modes
        f = Frame(self.root)
        f.grid(row=1, column=0, sticky='news')
        f.columnconfigure(0, weight=1)
        f.columnconfigure(1, weight=4)

        Label(f, text="Liste de mode 1").grid(row=0, column=0, sticky='e')
        # l1 = Entry(f, textvariable=self.var_l1 )
        Label(f, textvariable=self.var_l1).grid(row=0, column=1, sticky='w')
        # l1.grid(row=0,column=1,sticky='ew')#,columnspan=3)
        Label(f, text="Liste de mode 2").grid(row=1, column=0, sticky='e')
        l2 = Entry(f, textvariable=self.var_l2)
        l2.grid(row=1, column=1, sticky='ew')  # ,columnspan=3)
        close = Button(f, text='Fermer', command=self.close_win)

        close.grid(row=2, column=1, sticky='e')

        self.set_default_pair()

        self.root.mainloop()
Пример #20
0
    def __init__(self, master):
        # Set main window's title
        master.title("ADNS3080ImageGrabber")

        frame = Frame(master)
        frame.grid(row=0, column=0)

        self.comPortStr = StringVar()
        ports = serial_ports()
        if not ports:
            ports = ['No serial ports found']
        self.comPortStr.set(ports[0])  # Set first port as default

        comports = apply(OptionMenu, (frame, self.comPortStr) + tuple(ports))
        comports.grid(row=0, column=0)

        self.baudrateStr = StringVar()
        self.baudrateStr.set('115200')

        baudrates = apply(OptionMenu, (frame, self.baudrateStr) + tuple(Serial.BAUDRATES))
        baudrates.grid(row=0, column=1)

        button = Button(frame, text="Open", command=self.open)
        button.grid(row=0, column=2)

        button = Button(frame, text="Close", command=self.close)
        button.grid(row=0, column=3)

        self.canvas = Canvas(master, width=self.grid_size*self.num_pixels, height=self.grid_size*self.num_pixels)
        self.canvas.grid(row=1)

        # params for ShiTomasi corner detection
        self.feature_params = dict( maxCorners = 10,
                               qualityLevel = 0.3,
                               minDistance = 3,
                               blockSize = 3 )

        # Parameters for lucas kanade optical flow
        self.lk_params = dict( winSize  = (30,30),
                          maxLevel = 2,
                          criteria = (cv2.TERM_CRITERIA_EPS | cv2.TERM_CRITERIA_COUNT, 10, 0.03))

        # Create some random colors
        self.color = np.random.randint(0,255,(100,3))

        # Take first frame and find corners in it
        self.frame = np.zeros((self.num_pixels,self.num_pixels,1), np.float32)
        self.prevFrame = np.zeros((self.num_pixels,self.num_pixels,1), np.float32)

        # Create a mask image for drawing purposes
        self.mask = np.zeros_like(self.prevFrame)
Пример #21
0
    def __init__(self, master):

        global myname
        del courseboxes[:]
        del online_courses[:]

        self.load_online_courses()
        n = len(online_courses)

        self.update_from_preferences(n)

        self.frame = ScrollableFrame(m)

        self.frame.pack(fill=Tkinter.BOTH, expand=Tkinter.TRUE)

        self.root_dir_box = box(self.frame)

        #Create checkbox, label and browse button for all courses
        for i in range(0, n):
            courseboxes.append(box(self.frame, i))

        self.selectall = Button(self.frame.interior,
                                text='Select All',
                                command=self.sall)
        self.selectall.grid(row=0, column=0, pady=10)
        self.deselectall = Button(self.frame.interior,
                                  text='Deselect All',
                                  command=self.dall)
        self.deselectall.grid(row=0, column=1, padx=[0, 100], pady=10)
        self.save = Button(self.frame.interior,
                           text='Save Settings',
                           command=self.save)
        self.save.grid(row=0, column=2, pady=10)

        self.auto = IntVar()
        self.autoDLD = Checkbutton(self.frame.interior,
                                   text="Auto-Download",
                                   width=20,
                                   variable=self.auto)
        self.autoDLD.grid(row=0, column=0, sticky="w")

        if os.path.exists('Cred'):
            file_pref = open('Cred', 'r')
            lines = file_pref.readlines()
            if len(lines) > 4:
                x = lines[4].replace('\n', '')
                if x == '1':
                    self.autoDLD.select()

        self.f = Frame(self.frame.interior, height=20)
        self.f.grid(row=2, columnspan=3, sticky="we")
Пример #22
0
    def _build_listbox(self, values):
        listbox_frame = Frame()

        self._listbox = Listbox(listbox_frame, background="white",
                                selectmode=SINGLE, activestyle="none",
                                exportselection=False)
        self._listbox.grid(row=0, column=0, sticky=N+E+W+S)

        self._listbox.bind("<ButtonRelease-1>",
                           self._update_entry_from_listbox)
        self._listbox.bind("<Return>", self._update_entry_from_listbox)
        self._listbox.bind("<Escape>", lambda event: self.unpost_listbox())

        self._listbox.bind('<Control-n>', self._next)
        self._listbox.bind('<Control-p>', self._previous)

        if self._use_vscrollbar:
            vbar = Scrollbar(listbox_frame, orient=VERTICAL,
                             command=self._listbox.yview)
            vbar.grid(row=0, column=1, sticky=N+S)

            self._listbox.configure(
                yscrollcommand=lambda f, l: autoscroll(vbar, f, l))

        if self._use_hscrollbar:
            hbar = Scrollbar(listbox_frame, orient=HORIZONTAL,
                             command=self._listbox.xview)
            hbar.grid(row=1, column=0, sticky=E+W)

            self._listbox.configure(
                xscrollcommand=lambda f, l: autoscroll(hbar, f, l))

        listbox_frame.grid_columnconfigure(0, weight=1)
        listbox_frame.grid_rowconfigure(0, weight=1)

        x = -self.cget("borderwidth") - self.cget("highlightthickness")
        y = self.winfo_height()-self.cget("borderwidth") - \
            self.cget("highlightthickness")

        if self._listbox_width:
            width = self._listbox_width
        else:
            width = self.winfo_width()

        listbox_frame.place(in_=self, x=x, y=y, width=width)

        height = min(self._listbox_height, len(values))
        self._listbox.configure(height=height)

        for item in values:
            self._listbox.insert(END, item)
Пример #23
0
    def __init__(self, brdNum, brdPos, addr, parentFrm):
        self.brdNum = brdNum
        self.brdPos = brdPos
        self.brdAddr = addr
        self.statLbl = StringVar()
        self.dispInpValue = 0
        self.indBitStatLbl = []
        self.indBitOptMenu = []
        self.toggleBtn = []
        self.toggleState = []
        self.bitFrms = []
        self.btnCfgBitfield = 0  #Set bits to 1 to default to toggle buttons
        self.simSwitchBits = 0
        self.pulseSolBits = 0

        #Create main frame
        self.solCardFrm = Frame(parentFrm, borderwidth=5, relief=RAISED)
        self.solCardFrm.grid(column=0, row=brdPos + 1)

        #Create card info frame
        solCardInfoFrm = Frame(self.solCardFrm)
        solCardInfoFrm.grid(column=8, row=0)

        #Add card info
        tmpLbl = Label(solCardInfoFrm, text="Sol Card %d" % (brdNum + 1))
        tmpLbl.grid(column=0, row=0)
        tmpLbl = Label(solCardInfoFrm, text="Addr = 0x%02x" % addr)
        tmpLbl.grid(column=0, row=1)
        tmpLbl = Label(solCardInfoFrm, text="Status")
        tmpLbl.grid(column=0, row=2)
        tmpLbl = Label(solCardInfoFrm,
                       textvariable=self.statLbl,
                       relief=SUNKEN)
        self.statLbl.set("0x%02x" % self.dispInpValue)
        tmpLbl.grid(column=0, row=3)

        for i in xrange(rs232Intf.NUM_SOL_PER_BRD):
            TkSolBrd.createBitFrame(self, i)
Пример #24
0
    def createWidgets(self):
        'create the script gui'
        #    first header row
        row = Frame(self)
        TEXT1 = "\nIn this section you can run scripts "
        Label(row, text=TEXT1, anchor='w').pack(side='top', padx=2, pady=10)
        row.pack(side='top', fill='x', padx=5)
        bottom_hline_deco(self)
        '''  RUN  section '''
        entr_maxlen = int(8 * 2.5)
        self.r_entry_c = []
        row2fill = Frame(self)
        row2fill_l = Frame(row2fill)
        self.r_entry_c.append(
            self.master.createfileentry(row2fill_l, 'Select the script to run',
                                        './in.gro2lam'))
        _entries_ = ['Machine', 'Cores']
        _defvals_ = [
            [
                'lammps-daily',
                ['lammps', 'lmp_mpi', 'lmp_ubuntu', 'lammps-daily']
            ],
            [1, range(4 * 4 * 4 + 1)[1:]]  # should be enough
        ]
        for e in range(len(_entries_)):
            self.r_entry_c.append(
                create_entry(row2fill_l, _entries_[e], _defvals_[e],
                             entr_maxlen))

        row2fill_l.pack(side="left")
        row2fill_r = Frame(row2fill)

        row2fill_r.pack(side="right")
        row2fill.pack(side="top", padx=1, pady=5)

        bottom_hline_deco(self, bottom_hline_deco(self))

        self.build_finalbuttons()
Пример #25
0
 def __init__(self, master=None, **kw):
     self.frame = Frame(master)
     self.vbar = Scrollbar(self.frame)
     self.vbar.pack(side=RIGHT, fill=Y)
     kw.update({'yscrollcommand': self.vbar.set})
     Text.__init__(self, self.frame, **kw)
     self.pack(side=LEFT, fill=BOTH, expand=True)
     self.vbar['command'] = self.yview
     text_meths = vars(Text).keys()
     methods = vars(Pack).keys() + vars(Grid).keys() + vars(Place).keys()
     methods = set(methods).difference(text_meths)
     for m in methods:
         if m[0] != '_' and m != 'config' and m != 'configure':
             setattr(self, m, getattr(self.frame, m))
Пример #26
0
 def create_conversion_gui(self):
     
     #    first header row
     row = Frame(self)
     TEXT1= "\nSelect the parameters to perform the conversion: "
     Label(row, text=TEXT1, anchor='w').pack(side='top', padx=2, pady=10)
     row.pack( side='top', fill='x', padx=5)
     bottom_hline_deco(self)
     
     # file section
     #=======================       DEFAULTS       =========================
     ex_files=['./Examples/IONP/Original/SPIO_part-water-em.gro',
               './Examples/IONP/Original/SPIO_part.top',
               './Examples/IONP/Original/forcefield.itp',
               './Examples/IONP/Original/ffoplsaaSI_FE_WATnb.itp',
               './Examples/IONP/Original/ffoplsaaSI_FE_WATbon.itp'
              ]
     #ex_files=['conf.gro','topol.top','forcefield.itp','nb.itp','bon.itp']
     _atomstyle_ = 'full'
     _radio_ = 1
     
     data_cont = self.master._convert_['setup']
     if data_cont <> []:
         ex_files = data_cont[:-2]
         _atomstyle_ = data_cont[-2]
         _radio_ = data_cont[-1]
     
     fi_txt=['Enter the gro file',
             'Enter the top file',
             'Enter the forcefield file',
             'Enter the non bonded file',
             'Enter the bonded file'
            ]
     
     for fi in range( len( ex_files)):
         self.objt_c.append( self.master.createfileentry( self, fi_txt[fi],
                                                        ex_files[fi],
                                                       )
                          )
     bottom_hline_deco( self)
     
     bottom_hline_deco( self, self.atomstyle)
     self.objt_c[-1].set( _atomstyle_)
     
     self.sol_buffer = _radio_
     bottom_hline_deco( self, self.build_solvation_section)
     self.objt_c[-1].set( _radio_)
     
     #    Final Buttons
     self.build_finalbuttons()
Пример #27
0
    def __init__(self, *args, **kwargs):
        Text.__init__(self, *args, **kwargs)
        self.config(wrap='none')
        #Scrollbar
        self.yscrollframe = Frame(self.master)
        self.yscroll = ttk.Scrollbar(self.yscrollframe,
                                     orient='vertical',
                                     cursor='arrow',
                                     command=self.yview)
        self.config(yscrollcommand=self.yscroll.set)
        self.yscrollframe.pack(side='right', fill='y')
        self.yscroll.pack(expand=True, fill='y')

        #Line Numbers
        self.lnframe = Frame(self.master)
        self.linenotify = lncnv.LineCanvas(self.lnframe)
        self.linenotify.subscribe(self)
        self.lnframe.pack(side='left', fill='y')
        self.linenotify.pack(expand=True, fill='y')
        self.add_intercept()
        self.bind('<Configure>', self.linenotify.update)
        self.bind('<<Changed>>', self.linenotify.update)
        self.bind('<KeyRelease>', self.linenotify.update)
Пример #28
0
    def initUI(self):

        self.parent.title("Color chooser")
        self.pack(fill=BOTH, expand=1)

        self.btn = Button(self, text="Choose Color", command=self.onChoose)
        self.btn.place(x=30, y=30)

        self.frame = Frame(self,
                           border=1,
                           relief=SUNKEN,
                           width=100,
                           height=100)
        self.frame.place(x=160, y=30)
Пример #29
0
    def explanation_frame(self):
        # creating explanation frame within parent frame
        self.ef = Frame(self.pf)
        self.ef.configure(bg=self.efbg.get())
        self.ef.place(relx=0, rely=0, relwidth=1, relheight=1)

        # creating objects within explanation frame
        self.is_correct_label()
        self.exp_label()
        self.next_ques_button()

        # creating display answer button if answer is wrong
        if not self.is_correct.get():
            self.disp_ans_button()
Пример #30
0
    def populateOkCancelFrame(self, wFrame):

        wFrame.grid_columnconfigure(0, weight=1)
        wFrame.grid_columnconfigure(1, weight=0)
        wFrame.grid_columnconfigure(2, weight=0)

        w = Frame(wFrame)
        w.grid(row=0, column=0, sticky=NSEW)

        w = Button(wFrame, text='Ok', command=self.wOkCB, width=10)
        w.grid(row=0, column=1, sticky=NSEW)

        w = Button(wFrame, text='Cancel', command=self.wCancelCB, width=10)
        w.grid(row=0, column=2, sticky=NSEW)