Esempio n. 1
0
    def GetData():
        income1 = ThemedTk(theme=ttk_theme, themebg=True)
        frm = ttk.Frame(income1)
        frm.pack(side=tk.LEFT, padx=20)

        tv = ttk.Treeview(frm,
                          columns=(1, 2, 3, 4, 5),
                          show="headings",
                          height='30')
        tv.pack()
        tv.heading(1, text="Amount")
        tv.heading(2, text="Date")
        tv.heading(3, text="Description")
        tv.heading(4, text="Category")
        tv.heading(5, text="Account_type")
        # income1.geometry('1000x500')
        income1.title("Income Details")
        db = sqlite3.connect('myspendmate.db')
        cursor = db.cursor()
        cursor.execute(
            "SELECT amount,date,description,category,account_type FROM income "
        )
        list1 = cursor.fetchall()
        total = cursor.rowcount

        for i in list1:
            tv.insert('', 'end', values=i)

        cursor.close()
        db.commit()
        db.close
        print(list1)
        income1.mainloop()
Esempio n. 2
0
        def GetCategories():
            GetC = ThemedTk(theme=ttk_theme, themebg=True)
            frm = ttk.Frame(GetC)
            frm.pack(side=tk.LEFT, padx=20)

            treev = ttk.Treeview(frm,
                                 columns=(1),
                                 show="headings",
                                 height='30')
            treev.pack()
            treev.heading(1, text="Category Name")
            # GetC.geometry('250x600')
            GetC.title("Category List")
            db = sqlite3.connect('myspendmate.db')
            cursor = db.cursor()
            cursor.execute("select * from incomeCat")
            list1 = cursor.fetchall()
            total = cursor.rowcount

            for i in list1:
                treev.insert('', 'end', values=i)

            cursor.close()
            db.commit()
            db.close
            print(list1)
            GetC.mainloop()

            cursor.close()
            db.commit()
            db.close()
Esempio n. 3
0
class Chess():
    def __init__(self, root, HOST, PORT):
        self.master = ThemedTk(theme="radiance")
        self.master.title('SERVER')
        root.destroy()
        self.create_widgets(HOST, PORT)
        self.master.mainloop()

    def create_widgets(self, HOST, PORT):
        self.chess_canvas = Chess_Canvas(self.master, 650, 630, HOST,
                                         PORT)  # noqaE501

        self.chess_canvas.bind('<Button-1>', self.chess_canvas.click1)

        self.chess_canvas.pack()
        btn_reset = ttk.Button(
            self.master,
            text='REGRET',
            command=lambda: self.chess_canvas.regret())  # noqaE501
        btn_reset.place(x=20, y=620)

        btn_quit = ttk.Button(
            self.master, text='QUIT',
            command=lambda: self.chess_canvas.quit())  # noqaE501
        btn_quit.place(x=150, y=620)

        btn_play_back = ttk.Button(
            self.master,
            text='PLAY BACK',
            command=lambda: self.chess_canvas.play_back())  # noqaE501
        btn_play_back.place(x=280, y=620)
Esempio n. 4
0
File: mcpil.py Progetto: dw5/MCPIL
def main():
    if platform.system() != 'Linux':
        showerror('Error', 'Linux Is Required')
        return 1

    global window

    window = ThemedTk(theme='equilux', className='mcpil')
    window.title('MCPIL')
    window.geometry('512x400')
    window.resizable(True, True)

    tabs = ttk.Notebook(window)
    tabs.add(play_tab(tabs), text='Play')
    tabs.add(features_tab(tabs), text='Features')
    tabs.add(multiplayer_tab(tabs), text='Multiplayer')
    tabs.add(settings_tab(tabs), text='Settings')
    tabs.add(about_tab(tabs), text='About')
    tabs.pack(fill=BOTH, expand=True)

    load()
    save()

    window.wm_protocol('WM_DELETE_WINDOW', quit)
    signal.signal(signal.SIGINT, lambda *args: quit())

    try:
        window.mainloop()
    except KeyboardInterrupt:
        quit()

    return 0
Esempio n. 5
0
def start(window):
    try:
        root = ThemedTk(background=True, theme="breeze")
        app = window(root)
        root.mainloop()
    except Exception as e:
        print(e)
Esempio n. 6
0
def main():
    def funcExit():
        message_box = messagebox.askquestion("Exit",
                                             "Do you want to exit?",
                                             icon='warning')
        if message_box == "yes":
            root.destroy()

    def funcAddBook():
        open_add_book = add_book.AddBook()

    def funcAddMember():
        open_add_member = add_member.AddMember()

    root = ThemedTk()
    root.get_themes()
    root.set_theme("arc")
    app = Main(root)

    #MenuBar
    menu_bar = Menu(root)
    root.config(menu=menu_bar)
    file = Menu(menu_bar, tearoff=0)
    menu_bar.add_cascade(label="File", menu=file)
    file.add_command(label="Add a Book", command=funcAddBook)
    file.add_command(label="Add a Member", command=funcAddMember)
    file.add_command(label="Show Member")
    file.add_command(label="Exit", command=funcExit)

    root.title("Library Management System")
    root.geometry("1280x720+450+150")
    root.resizable(False, False)
    root.iconbitmap("image/book_tk.ico")
    root.mainloop()
class Admin:
    '''Main module associated with LOGIN page'''
    def __init__(self):
        window.destroy()
        self.new_login_window = ThemedTk(theme='radiance')
        app = Login(self.new_login_window)
        self.new_login_window.mainloop()
Esempio n. 8
0
def historial():
    tabla = ThemedTk(theme='plastik')
    if platform.system() == "Windows":
        tabla.iconbitmap(os.getcwd() + '\\avance.ico')
    tabla.title('Historial Académico')
    ventana = Frame(tabla)
    ventana.config(width='390', height='80')
    scrollbar = Scrollbar(tabla)
    scrollbar.pack(side=RIGHT, fill=Y)
    resumen = ttk.Treeview(tabla, yscrollcommand=scrollbar.set)
    resumen.pack(fill='both', expand=True)
    scrollbar.config(command=resumen.yview)
    resumen["columns"] = ("uno", "dos", "tres")
    resumen.column("#0", width=10, minwidth=20)
    resumen.column("uno", width=50, minwidth=50)
    resumen.column("dos", width=230, minwidth=80)
    resumen.column("tres", width=120, minwidth=50)
    resumen.heading("uno", text="ID")
    resumen.heading("dos", text="MATERIA")
    resumen.heading("tres", text="CALIFICACIÓN")
    materias = cursor.execute(
        "SELECT id, Nombre, Calificacion FROM historia").fetchall()
    for materia in materias:
        resumen.insert("", END, values=(materia))
    tabla.mainloop()
Esempio n. 9
0
def summary():
    if run:
        window = ThemedTk(theme='arc')
        window.resizable(0,0)
        window.geometry('400x400')
        present_list = []

        title_name2 =ttk.Label(window , text = 'Attendance Summary' , font = ('Tw Cen MT',20) , style = "BW.TLabel").place(x = 75 , y = 0)

        for i in range(2,sheet.max_row):
            if sheet.cell(row = i , column = req_column).value == 'P':
                name = sheet.cell(row = i , column = 1).value
                present_list.append(name)

        info = ttk.Label(window, text = str(len(present_list))+'/'+str(sheet.max_row-1)+' students are present' , font = ('Tw Cen MT',12)).place(x = 0 , y = 50)
        progressbar = ttk.Progressbar(window , orient = VERTICAL,length = 220, value = (len(present_list)/(sheet.max_row-1))*100 ).place(x = 340 , y = 50)
        percent = round(len(present_list)/(sheet.max_row-1)*100, 2)
        percent_label = ttk.Label(window, text ='{}%\npresence'.format(percent) ).place(x = 340, y = 290)

        for x in range(0,len(present_list)):
            lmain_x = ttk.Label(window, text = str(x+1)+'. '+present_list[x], font = ('Tw Cen MT',12)).place(x=0, y=(80 + x*25))

        backBtn = ttk.Button(window, text='Return', command=window.destroy).place(x = 280 , y = 350)


        window.mainloop()
    else:
        messagebox.showinfo('Error','There\'s nothing to show yet!')
Esempio n. 10
0
def vp_start_gui():
    '''Starting point when module is the main routine.'''
    global val, w, root

    # root = tk.Tk()
    root = ThemedTk(theme="arc")
    top = Toplevel1(root)
    root.mainloop()
Esempio n. 11
0
def start():
    global root
    root = ThemedTk(theme='scidblue')
    # root = Tk()
    root.title("Work Order Manager")
    root.iconbitmap(str(os.getcwd()+"\\"+"icon-icons.com_main.ico"))
    MainLog(root)
    root.mainloop()
Esempio n. 12
0
def login_screen():
    """creates the first screen where the user logs in to the game"""
    screen = ThemedTk(theme="arc")  # creating a window themed "arc"
    screen.geometry('880x540')
    screen.title("© Battleship by Shani Daniel ©")
    screen.configure(background='light blue')
    style_log = ttk.Style()

    ttk.Label(text='Welcome to Battleship', font=("Broadway", 50), foreground='black', background='light blue')\
        .pack(pady=40)
    ttk.Label(text='Login:'******'black',
              background='light blue').pack(pady=20)
    # writes the main game title and the "login" label

    username_login = tk.StringVar()
    password_login = tk.StringVar()
    ttk.Label(screen,
              text="Username:"******"Cooper black", 14),
              foreground='black',
              background='light blue').pack()
    tk.Entry(screen, textvariable=username_login).pack()
    ttk.Label(screen,
              text="Password:"******"Cooper black", 14),
              foreground='black',
              background='light blue').pack()
    tk.Entry(screen, textvariable=password_login, show='*').pack()

    # creates the username and password fields

    def login_click():
        login_button_click(screen, username_login, password_login)

    def register_click():
        register(screen)

    style_log.configure('log.TButton',
                        font=('Cooper Black', 16),
                        foreground='black')
    style_log.configure('reg.TButton',
                        font=('Cooper Black', 13),
                        foreground='black')
    ttk.Button(screen,
               text="Sign in",
               style='log.TButton',
               command=login_click).pack(pady=15)
    ttk.Button(screen,
               text="Register",
               style='reg.TButton',
               command=register_click).pack()
    # styles and creates the "sign in" and "register" buttons

    screen.mainloop()
Esempio n. 13
0
def Retroalimentacion():
    #----------------------------------------Invocando al set que tengamos-------------------------------------
    PyMe1 = np.random.random_sample((1, 5))
    tienda_real = pd.read_csv("tienda_real.csv").apply(pd.to_numeric,
                                                       errors='coerce')
    retro = Graf_Retro(tienda_real.values)

    if retro < 0:
        retro *= -1
        retro1 = "La empresa está por debajo del promedio en un {0:.2f}".format(
            retro), "%"
    else:
        retro1 = "La empresa está por arriba del promedio en un {0:.2f}".format(
            retro), "%"

    if retro <= 25:
        retro2 = "Te recomendamos administrar un poco más tus gastos, los numeros obtenidos no son malos, pero a traves del flujo de inversión podrían mejorar bastante"
    if retro <= 50 and retro >= 26:
        retro2 = "Los números obtenidos tienen un porcentaje bajo, recomendamos cambiar estrategia de venta o inversión, para mayor informacón asistir a sucursal."
    if retro <= 100 and retro >= 51:
        retro2 = "Los ingresos y egresos de tu empresa son numeros muertos, en BBVA te ofrecemos un plan de mejora con posibles resultados a corto plazo, te recomendamos asistir a sucursal o llamar vía telefónica de inmediato."

    raiz2 = ThemedTk(theme='equilux')
    raiz2.resizable(0, 0)
    raiz2.title('Retroalimentación')

    miFrame2 = Frame(raiz2)
    miFrame2.pack(expand=1, fill=BOTH)

    #Nombre del recuadro grande
    cuadroRecomendacionLabel = Label(miFrame2,
                                     text='Retroalmentación: ',
                                     font=('Times', 15, 'bold')).grid(row=1,
                                                                      column=0,
                                                                      pady=5,
                                                                      padx=0)
    cuadroRecomendacion = Text(miFrame2, width=42, height=10, bg='grey')
    cuadroRecomendacion.grid(row=2,
                             column=0,
                             padx=20,
                             pady=5,
                             columnspan=2,
                             rowspan=7)
    cuadroRecomendacion.config(state=DISABLED)
    #Scroll del recuadro grande
    scrolly = Scrollbar(miFrame2, command=TextoLargo.yview)
    scrolly.grid(row=2, column=2, sticky='nsew')
    cuadroRecomendacion.config(yscrollcommand=scrolly.set)

    cuadroRecomendacion.config(state='normal')
    cuadroRecomendacion.insert(END, retro1[0])
    cuadroRecomendacion.insert(END, '\n')
    cuadroRecomendacion.insert(END, retro2)
    cuadroRecomendacion.config(state='disabled')

    raiz2.mainloop()
Esempio n. 14
0
def edit():
    tctzn=StringVar()
    nsc = ThemedTk(theme="arc")
    nsc=tk.Toplevel()
    nsc.title("voter_list")
    nsc.geometry("400x300")
    nsc.resizable(False,False)
    nsc.iconbitmap("gov2.ico")
    l1=ttk.Label(nsc,text="Enter Citizenship Number or Voter ID:")
    ectzn = Entry(nsc,textvariable=tctzn)
    l1.place(relx=0.05,rely=0.5)
    ectzn.place(relx=0.559, rely=0.49)

    def sreh(*args):
        global vid
        flag=""
        c = sqlite3.connect("voterlist.db", check_same_thread=False)
        tc = c.execute("SELECT usr,pw,eml,phon,cou,gen,dob,ph,cid,vid,vtsta from voterlist")
        print(str(tctzn.get()))
        print("dfd")
        i=0
        for item in tc:
            if str(item[8]) == str(tctzn.get()) or str(item[9]) == str(tctzn.get()):
                flag="True"
                l1.destroy()
                ectzn.destroy()
                b1.destroy()
                la = ttk.Label(nsc)
                la["text"] = "Information is:\n" + "Name:" + str(item[0]) + "\nPhone Number: " + str(
                    item[3]) + "\nDate of birth: " + str(item[6]) + "\nEmail: " + str(
                    item[2]) + "\nVote Status: " + str(item[10])
                la.place(relx=0.01, rely=0.1)
                vid = (int(item[9]),)

                def dele():
                    global vid
                    print(vid)
                    tc = sqlite3.connect("voterlist.db", check_same_thread=False)
                    tc.execute("""DELETE FROM voterlist  WHERE vid=(?)""", vid)
                    tc.commit()
                    tc.close()
                    la.destroy()
                    messagebox.showinfo(message="Information deleted !")
                    nsc.destroy()

                bu1 = ttk.Button(nsc, text="Delete", command=dele)
                bu1.place(relx=0.6, rely=0.58)
                bu2 = ttk.Button(nsc, text="Back", command=sreh)
                bu2.place(relx=0.32, rely=0.58)
        if flag!="True":
            messagebox.showinfo(message="No match found!")
            nsc.destroy()

    b1 = ttk.Button(nsc, text="Search", command=lambda:sreh(tctzn.get()))
    b1.place(relx=0.6, rely=0.58)
    nsc.mainloop()
Esempio n. 15
0
class select():
    def __init__(self):

        self.meryem = ThemedTk(theme="breeze")
        self.meryem.title("SELECT DEVICE")

        path = os.getcwd()
        image_path = f"{path}/img/b.jpg"
        png_label = images.image_make(path_=image_path, sw_=500, sh_=100)

        title_bar = Label(self.meryem, bg="#fff", image=png_label)
        title_bar.pack(fill=X, expand=True)

        framebody = ttk.Frame(self.meryem)
        framebody.pack(fill=BOTH, expand=True)

        # fileds combox
        labelBox = ttk.LabelFrame(framebody, text="Select Device Model")
        labelBox.pack(fill=X, expand=True, pady=10, padx=10)
        comboxVar = StringVar()
        combox = ttk.Combobox(labelBox, textvariable=comboxVar)
        combox["values"] = ('SM-I8190N')
        combox.pack(fill=X, expand=True, padx=10, pady=10)

        # fileds combox
        labelBox_2 = ttk.LabelFrame(framebody, text="Select Android Version")
        labelBox_2.pack(fill=X, expand=True, pady=10, padx=10)
        comboxVar_2 = StringVar()
        combox_2 = ttk.Combobox(labelBox_2, textvariable=comboxVar_2)
        combox_2["values"] = ('Jelly Bean 4.1', 'Jelly Bean 4.2', 'KitKat 4.4',
                              'Lolipop 5.0', 'Marshmallow 6.0', 'Nougat 7.0',
                              'Oreo 8.0')
        combox_2.pack(fill=X, expand=True, padx=10, pady=10)

        butlabel = ttk.Label(framebody)
        butlabel.pack(fill=X, expand=True, pady=10, padx=10)

        but1 = ttk.Button(butlabel, text="Next", width=10)
        but1.pack(side=LEFT, padx=10, pady=10)

        # function
        def exit_():
            msj = messagebox.askyesno("Exit", "Do you want exit")
            if msj == True:
                self.meryem.quit()
            else:
                print("Cancel Process")

        but2 = ttk.Button(butlabel, text="Exit", width=10, command=exit_)
        but2.pack(side=LEFT, padx=10, pady=10)
        but3 = ttk.Button(butlabel, text="Help", width=10)
        but3.pack(side=LEFT, padx=10, pady=10)

        self.meryem.mainloop()
Esempio n. 16
0
class GUI:
    def __init__(self):
        self.root = None

    def _setup(self):
        self.root.title("Backup Utility")
        img = PhotoImage(data=icon)
        self.root.tk.call('wm', 'iconphoto', self.root._w, img)
        config_model = ConfigUIModel()
        manage_model = ManageUIModel()

        note = Notebook(self.root)
        self._setup_backup_tab(note, config_model)
        self._setup_manage_tab(note, manage_model)
        note.pack(fill=BOTH, expand=True)

    def _setup_manage_tab(self, note: Notebook, model: ManageUIModel):
        frm_manage_tab = Frame(note, padding=10)
        frm_manage_tab.pack(fill=BOTH, expand=True)

        TreeFrame(frm_manage_tab, model)
        ManageActionFrame(frm_manage_tab, model)

        note.add(frm_manage_tab, text="Folder Manager")

    def _setup_backup_tab(self, note: Notebook, model: ConfigUIModel):
        frm_backup_tab = Frame(note, padding=10)
        frm_backup_tab.pack(fill=BOTH, expand=True)

        frm_config = Frame(frm_backup_tab, padding=10)
        frm_config.pack(side=TOP, fill=BOTH, expand=True)

        SourceFrame(frm_config, model)
        ExclusionFrame(frm_config, model)
        DestinationFrame(frm_config, model)
        ActionFrame(frm_backup_tab, model)

        frm_backup_tab.pack(fill=BOTH, expand=True)

        note.add(frm_backup_tab, text="Backup Configurer")

    def start(self):
        self.root = ThemedTk(themebg=True)
        self.root.tk.eval("source {}/pkgIndex.tcl".format(
            get_data_path(custom_theme_folder)))
        self.root.set_theme(custom_theme_name)
        # self.root.set_theme("arc")
        # self.root.set_theme_advanced("arc", brightness=1, saturation=1.0, hue=1,
        #     preserve_transparency=True, output_dir=custom_theme_folder, advanced_name=custom_theme_name
        # )
        self._setup()
        self.root.mainloop()
    def show_signup_window(self):
        root = ThemedTk(theme=self.STYLE)
        root.geometry("400x250")
        root.title('Signup')
        root.resizable(0,0)

        # title
        ttk.Label(root, font=('default', 19, 'bold'), text='******Moriarity Point******').grid(row=0, column=0, sticky='w', padx=15)
        ttk.Separator(root, orient='horizontal').grid(row=1, columnspan=2, sticky='ew')

        # sub title
        ttk.Label(root, font=('default', 14, 'bold'), text='Add a new employee').grid(row=2, column=0, sticky='w', padx=5, pady=10)
        
        # defs
        def show_login():
            root.destroy()
            self.show_login_window()

        def signup_db():
            conn = sqlite3.connect('user.db')
            if not var_pass.get()==var_repass.get():
                messagebox.showwarning('Warning!', 'Passwords do not match.')
                return
            try:
                query = "INSERT INTO user_accounts(name, password) VALUES ( '{var_user.get()}', '{var_pass.get()}' )"
                
                conn.execute(query)
                conn.commit()
                messagebox.showinfo('Success!', 'User account for %s successfuly created!'%var_user.get())
                show_login()
            except:
                messagebox.showerror('Error!', 'There was an unexpected error!')

        PADX, PADY = 5, 5
        # signup form
        ttk.Label(root, text='Username:'******'w', padx=PADX, pady=PADY)
        ttk.Label(root, text='Password:'******'w', padx=PADX, pady=PADY)
        ttk.Label(root, text='Re-Password:'******'w', padx=PADX, pady=PADY)
        

        var_user, var_pass, var_repass = StringVar(), StringVar(), StringVar()
        ttk.Entry(root, textvariable=var_user, width=25).grid(row=3, column=0, sticky='e', padx=PADX, pady=PADY)
        ttk.Entry(root, textvariable=var_pass, width=25).grid(row=4, column=0, sticky='e', padx=PADX, pady=PADY)
        ttk.Entry(root, textvariable=var_repass, width=25).grid(row=5, column=0, sticky='e', padx=PADX, pady=PADY)
        

        ttk.Button(root, text='Signup', command=signup_db).grid(row=8, column=0, sticky='e', padx=PADX, pady=PADY)
        ttk.Button(root, text='Login', command=show_login).grid(row=8, column=0, sticky='w', padx=PADX, pady=PADY)

        root.mainloop()
Esempio n. 18
0
class MyGUI(object):
    def __init__(self):
        # self.root = tk.Tk()
        self.root = ThemedTk(theme="arc")  #<<注释3>>
        self.root.geometry("450x600+800+200")
        self.root.title("GIS")  #设置程序名称
        self.var = tk.StringVar()

        self.img1 = tk.PhotoImage(file="icon/shp2.gif")
        self.img2 = tk.PhotoImage(file="icon/ok2.gif")

        # run function
        self.create_widget()
        self.create_run_button()
        self.root.mainloop()  # 执行循环

    def create_widget(self):
        self.frame1 = ttk.Frame(self.root)
        self.frame1.pack(fill="x")
        self.entry = ttk.Entry(self.frame1)  #<<注释4>>
        self.entry.config(textvariable=self.var)
        self.entry.pack(side="left", expand=True, fill="x", pady=8, padx=10)
        self.but = tk.Button(self.frame1, relief="flat")
        # self.but = ttk.Button(self.frame1)
        self.but.config(command=self.open_dialog)
        self.but.config(image=self.img1)
        self.but.pack(side="right", pady=8, padx=6)

    def open_dialog(self):
        varrr = tkFileDialog.askopenfilename()
        self.var.set(varrr)

    def create_run_button(self):
        # 生成下方的“运行”按钮
        self.bottom_frame = ttk.Frame(self.root)
        self.bottom_frame.pack(side="bottom", fill="x", anchor="s")
        self.ok_button = tk.Button(self.bottom_frame, relief="flat")
        # self.ok_button = ttk.Button(self.bottom_frame)
        self.ok_button.pack(side="right", pady=8, padx=6)
        self.ok_button.config(image=self.img2)
        self.ok_button.config(command=self.run_multiprocessing)

    # def run(self):
    #     giscode.main(self.var.get())

    def run_multiprocessing(self):
        p = Process(target=giscode.main, args=(self.var.get(), ))
        p.start()
        print "PID:", p.pid
Esempio n. 19
0
    def custom_game(self):

        #change the width, height, and total_mine value and soft initialize the game (without reinitialize all stuff)
        def return_custom():
            self.width, self.height, self.total_mine = int(
                width_input.get()), int(height_input.get()), int(
                    bomb_amount_input.get())
            custom_prompt.destroy()
            self.cleanup(difficulty=3)

        #initialize the prompt window (I used a themed window so it looks better)
        custom_prompt = ThemedTk(theme='breeze')
        custom_prompt.geometry('265x166')
        custom_prompt.title('Custom')
        custom_prompt.focus_force()

        #initialize all the widget inside the window
        height_label = ttk.Label(custom_prompt, text='Height:')
        width_label = ttk.Label(custom_prompt, text='Width:')
        bomb_amount_label = ttk.Label(custom_prompt, text='Mines:')

        width_input = ttk.Spinbox(custom_prompt, width=5, from_=9, to=24)
        height_input = ttk.Spinbox(custom_prompt, width=5, from_=9, to=30)
        bomb_amount_input = ttk.Spinbox(custom_prompt, width=5, from_=9, to=99)

        ok_button = ttk.Button(custom_prompt, text='OK', command=return_custom)
        cancel_button = ttk.Button(custom_prompt,
                                   text='Cancel',
                                   command=custom_prompt.destroy)

        #place them one by one inside the window (grid system will perform better here (because I don't need to calculate x and y lol))
        height_label.grid(row=0, column=0, padx=15, pady=(30, 0))
        width_label.grid(row=1, column=0, padx=15, pady=(5, 0))
        bomb_amount_label.grid(row=2, column=0, padx=15, pady=(5, 0))

        height_input.grid(row=0, column=1, padx=15, pady=(30, 0))
        width_input.grid(row=1, column=1, padx=15, pady=(5, 0))
        bomb_amount_input.grid(row=2, column=1, padx=15, pady=(5, 0))

        ok_button.grid(row=0, column=2, pady=(30, 0))
        cancel_button.grid(row=2, column=2, pady=(5, 0))

        #initialize the value in the input box to current value
        width_input.set(self.width)
        height_input.set(self.height)
        bomb_amount_input.set(self.total_mine)

        #show the window up
        custom_prompt.mainloop()
Esempio n. 20
0
def start(func, kol, speed, values=None, color_scheme="dracula"):
    root_main = ThemedTk()
    root_main.iconbitmap('icon.ico')
    root_main.title("Vizulization")
    root_main.set_theme('equilux')
    height = root_main.winfo_screenheight() - 300
    width = root_main.winfo_screenwidth() - 300
    root_main.geometry(
        '{}x{}+{}+{}'.format(width, height, (root_main.winfo_screenwidth() - width) // 2,
                             (root_main.winfo_screenheight() - height) // 2))
    root_main.resizable(False, False)
    if values:
        kol = len(values)
    func(width, height, kol, name=root_main, color_scheme=color_scheme, speed=speed, values=values).sort()
    root_main.mainloop()
Esempio n. 21
0
class GUI:
    """This handles the GUI for ESMB"""
    def __init__(self):
        logging.debug("\tBuilding GUI...")

        # Build the application window
        self.gui = ThemedTk(theme="plastik")
        self.gui.title("ESMissionBuilder")
        self.gui.configure(bg="orange")

        # enable window resizing
        self.gui.columnconfigure(2, weight=1)
        self.gui.rowconfigure(0, weight=1)

        # set disabled styles
        self.disabledEntryStyle = ttk.Style()
        self.disabledEntryStyle.configure('D.TEntry', background='#D3D3D3')
        self.disabledComboboxStyle = ttk.Style()
        self.disabledComboboxStyle.configure('D.TCombobox',
                                             background='#D3D3D3')

        # Declare the frames
        self.option_pane = editor.OptionPane(self.gui)
        self.option_pane.grid(row=0, column=0, sticky="ns")

        self.center_pane = editor.MissionEditorPane(self.gui)
        self.center_pane.grid(row=0, column=1, sticky="ns")

        self.item_text_pane = editor.ItemTextPane(self.gui)
        self.item_text_pane.grid(row=0, column=2, sticky="nsew")

        config.gui = self
        self.gui.mainloop()

    #end init

    def update_option_pane(self):
        self.option_pane.update_pane()

    #end update_option_pane

    def update_center_pane(self):
        self.center_pane.update_pane()

    #end update_center_pane

    def update_item_text_pane(self):
        self.item_text_pane.update_pane()
Esempio n. 22
0
def CORE(S,M,f,port="z11",RS=0,RL=oo):

    Bode(fraction(f)[0], fraction(f)[1],port,fraction(f)[0],fraction(f)[1])

    if S==0:
        caer1(f,port=port,RS=RS,RL=RL)
    elif S==M: 
        caer2(f,port=port,RS=RS,RL=RL) 
    else: 
        bias={"type":"w","label":"unkw","dirrection":"right","parallel":False}
        print("solution one for",f)
        Append("solution one for "+str(f))    
        s1=caer1(f,repeat=abs(S-M))
        s2=caer2(s1[2],gener=s1[1],repeat=S)
        s1[0].append(bias)
        for i in s2[0]:
            s1[0].append(i)
        #draw(s1[0],port,RS,RL)
        Append(40*"- ")
        ans1=s1[0]
        print("\n","solution two for",f)
        Append("solution two for "+str(f))  
        s2=caer2(f,repeat=S)
        s1=caer1(s2[2],gener=s2[1],repeat=abs(S-M))
        s2[0].append(bias)
        for i in s1[0]:
            s2[0].append(i)
        Append("",finish=True)
        #draw(s2[0],port=port,rs=RS,rl=RL)
        window =ThemedTk(theme="adapta")
        window.title('Please choose to plot')
        window.rowconfigure([0,1], weight=1)
        window.columnconfigure([0], weight=1)
        label = ttk.Label(window,text='For any solution you can draw a schematic',anchor=tk.CENTER)
        label.grid(row=0,column=0,sticky=tk.N+tk.S+tk.E+tk.W)
        card_frame = ttk.Frame(window)
        card_frame.grid(row=1, column=0, sticky=tk.N+tk.S+tk.E+tk.W)
        card_frame.rowconfigure([0], weight=1)
        card_frame.columnconfigure([0,1], weight=1)
        solution1 = ttk.Button(card_frame,text="plot solution one",width=15,
                            command=lambda: draw(ans1,port,RS,RL))
        solution1.grid(row=0, column=0, sticky=tk.N+tk.S+tk.E+tk.W)
        solution2 = ttk.Button(card_frame,text="plot solution two",width=15,
                            command=lambda: draw(s2[0],port,RS,RL))
        solution2.grid(row=0, column=1, sticky=tk.N+tk.S+tk.E+tk.W)
        window.resizable(width=False, height=False)
        window.deiconify()
        window.mainloop()
Esempio n. 23
0
    def classic_button_function(self):
        self.exit_button_function()

        root = ThemedTk(theme=self.THEME)
        root.title(APPNAME)
        ws = root.winfo_screenwidth() / 2
        hs = root.winfo_screenheight() / 2
        root.geometry('%dx%d+%d+%d' % (580, 614, ws - 290, hs - 307))
        root.resizable(0, 0)


        game = PvAI_Game(Board(), Strategies.Minimax(2, Player.BLACK, Player.WHITE), root, width=592, height=618)
        game.pack(side="top", fill="both", expand="true")
        game.draw_pieces()

        root.mainloop()
Esempio n. 24
0
def main():

    # root = Tk()
    root = ThemedTk(theme="clearlooks")

    # root = Tk()
    # root.style = Style()
    # #('clam', 'alt', 'default', 'classic')
    # root.style.theme_use("clam")

    root.geometry("250x150+2900+300")
    button = ttk.Button(root, text="Click Me", underline=6)
    button.pack()
    # root.configure(bg='red')
    app = Example()
    root.mainloop()
Esempio n. 25
0
def vvtl():
    nsc=ThemedTk(theme="arc")
    nsc.title("voter_list")
    w, h = nsc.winfo_screenwidth(), nsc.winfo_screenheight()
    nsc.geometry("%dx%d+0+0" % (w, h))
    nsc.iconbitmap("gov2.ico")
    c = sqlite3.connect("voterlist.db", check_same_thread=False)
    tc = c.execute("SELECT usr,pw,eml,phon,cou,gen,dob,ph,cid,vid,vtsta from voterlist")
    l=ttk.Label(nsc,text="Name:\t\t\tPassword:\t\tEmail:\t\t\t\tPhone Number:\t\tAddress:\t\t\tGender:\t\tDate of Birth:\t\tCitizenship ID Number:\tVoter ID Number:\t\tVote Status:")
    l.place(relx=0.01,rely=0.01)
    i=0.04
    for item in tc:
        l=ttk.Label(nsc,text=str(item[0])+"\t\t"+str(item[1])+"\t\t"+str(item[2])+"\t"+str(item[3])+"\t\t"+str(item[4])+"\t"+str(item[5])+"\t\t"+str(item[6])+"\t\t"+str(item[8])+"\t\t"+str(item[9])+"\t\t"+str(item[10]))
        l.place(relx=0.01,rely=i)
        i+=0.02
        print(item[0])
    nsc.mainloop()
    def login_user(self, root):
        '''Check username and password entered are correct'''
        if self.username.get() == self.user and self.password.get(
        ) == self.passw:
            # Destroy current window
            root.destroy()

            # Open new window
            new_window = ThemedTk(theme='radiance')
            application = School_Portal(new_window)
            new_window.mainloop()

        else:
            '''Prompt user that either id or password is wrong'''
            self.message = Label(
                text='Username or Password incorrect. Try again!', fg='Red')
            self.message.grid(row=6, column=2)
Esempio n. 27
0
class FrontEnd:
    APP_WIDTH = 400
    APP_HEIGHT = 450
    PROJECT_PATH = os.getcwd()

    def __init__(self, inputs, main_script):
        self.root = ThemedTk(theme="equilux")
        self.root.geometry(f"{self.APP_WIDTH}x{self.APP_HEIGHT}")
        self.root.resizable(False, False)
        self.root.title('Gui Scripter')
        icon = ImageTk.PhotoImage(
            Image.open(os.path.join(self.PROJECT_PATH, 'static/rob_icon.png')))
        self.root.iconphoto(False, icon)

        self.app_frame = ttk.Frame(self.root,
                                   width=self.APP_WIDTH,
                                   height=self.APP_HEIGHT)
        self.app_frame.pack(expand=True, fill='both')

        main_image = ImageTk.PhotoImage(
            Image.open(os.path.join(self.PROJECT_PATH, 'static/rob.png')))
        panel = tk.Label(self.app_frame, image=main_image, bg='#464646')
        panel.pack()

        self.inputs_dict = {}
        self.label_dict = {}
        for input_name in inputs:
            self.inputs_dict[input_name] = ttk.Entry(self.app_frame)
            self.label_dict[input_name] = ttk.Label(self.app_frame,
                                                    text=input_name)
            self.label_dict[input_name].pack(anchor='center')
            self.inputs_dict[input_name].pack(anchor='center', pady=2)

        self.run_script_button = ttk.Button(self.app_frame,
                                            text="Run !",
                                            command=main_script,
                                            takefocus=0)
        self.run_script_button.pack(anchor='center', pady=15)

        self.progress_bar = ttk.Progressbar(self.app_frame,
                                            orient="horizontal",
                                            length=self.APP_WIDTH - 100,
                                            mode='determinate')
        self.progress_bar.pack(side='top', padx=0, pady=35, anchor='n')

        self.root.mainloop()
Esempio n. 28
0
    def developer_create(self, e):
        dev_code_verify_win = ThemedTk(theme='breeze')

        registration_code_label = ttk.Label(dev_code_verify_win,
                                            text='Enter registration code:')
        registration_code_input = ttk.Entry(dev_code_verify_win, width=64)
        registration_proceed_btn = ttk.Button(dev_code_verify_win,
                                              text='Register')

        registration_code_label.grid(row=0,
                                     column=0,
                                     padx=10,
                                     pady=10,
                                     sticky=W)
        registration_code_input.grid(row=1, column=0, padx=10, pady=(0, 10))

        dev_code_verify_win.mainloop()
    def show_login_window(self):
        root = ThemedTk(theme=self.STYLE)
        root.geometry("400x250")
        root.title('Login')
        root.resizable(0,0)

        # title
        ttk.Label(root, font=('default', 19, 'bold'), text='*******Moriarity Point******').grid(row=0, column=0, sticky='w', padx=15)
        ttk.Separator(root, orient='horizontal').grid(row=1, columnspan=2, sticky='ew')

        # sub title
        ttk.Label(root, font=('default', 14, 'bold'), text='Admin Login').grid(row=2, column=0, sticky='w', padx=5, pady=10)

        def show_signup():
            root.destroy()
            self.show_signup_window()
        
        def login_db():
            conn = sqlite3.connect('user.db')
            p=var_user.get()
            query =conn.execute("SELECT password FROM user_accounts WHERE name='"+p+"'")
            for row in query:
                   id= row[0]
            if id==int(var_pass.get()):
                m=messagebox.askyesno('Success!', 'User logged in! Continue to make your orders')
                if m>0:
                    root.destroy()
                    import restaurantmangement
                    
            else:
                messagebox.showerror('Error!', 'Username or password does not match!')
                

        PADX,PADY=5,5
        # login form
        ttk.Label(root, text='Username:'******'w', padx=PADX, pady=PADY)
        ttk.Label(root, text='Password:'******'w', padx=PADX, pady=PADY)

        var_user, var_pass = StringVar(), StringVar()
        ttk.Entry(root, textvariable=var_user, width=25).grid(row=3, column=0, sticky='e', padx=PADX, pady=PADY)
        ttk.Entry(root, textvariable=var_pass, width=25).grid(row=4, column=0, sticky='e', padx=PADX, pady=PADY)

        ttk.Button(root, text='Signup', command=show_signup).grid(row=5, column=0, sticky='w', padx=PADX, pady=PADY)
        ttk.Button(root, text='Login', command=login_db).grid(row=5, column=0, sticky='e', padx=PADX, pady=PADY)
        root.mainloop()
class ExportDialog:
    """ExportDialog provides a window to save a dataframe to csv file with custom settings"""
    def __init__(self, df: DataFrame):
        self.__root = ThemedTk(theme=theme)
        self.__root.title("Export")
        self.__df = df

        frame = Frame(self.__root)
        Label(frame, text="Seperator").grid(column=1, row=1)
        self.__separator = StringVar(self.__root, value=",")
        Entry(frame, textvariable=self.__separator).grid(column=2, row=1)

        Label(frame, text="Encoding").grid(column=1, row=2)
        self.__encoding = StringVar(self.__root, value="UTF-8")
        Combobox(frame,
                 textvariable=self.__encoding,
                 values=encodings,
                 state="readonly").grid(column=2, row=2)
        frame.pack(fill="both", expand=True)

        frame = Frame(self.__root)
        Button(frame, text="Save", command=self.export_csv).pack()
        frame.pack(fill="both", expand=True)

    def run(self):
        self.__root.mainloop()

    def exit(self):
        self.__root.destroy()

    def export_csv(self):
        e = self.__encoding.get()
        s = self.__separator.get()
        destination = asksaveasfilename(defaultextension=".csv",
                                        filetypes=(("Csv File", "*.csv"), ),
                                        initialfile="export.csv")
        if destination:
            try:
                self.__df.to_csv(destination, sep=s, encoding=e)
            except ValueError:
                showerror(text="Oops. Something went wrong. Please try again.")
            finally:
                self.exit()
Esempio n. 31
0
        """Set the displayed month to the given value"""
        self._date = datetime(year=year, month=month, day=1)
        self.redraw_calendar()


class SetVar(object):
    """Set a predefined value in a variable upon call"""

    def __init__(self, variable: tk.Variable, value: Any):
        """
        :param variable: Variable to set the value for
        :param value: Value to apply to the Variable
        """
        self.variable = variable
        self.value = value

    def __call__(self):
        """Apply the value to the variable"""
        self.variable.set(self.value)


if __name__ == '__main__':
    from ttkthemes import ThemedTk
    w = ThemedTk(theme="arc")
    c = Calendar(w)
    now = datetime.now()
    year, month = now.year, now.month
    c.update_heatmap({datetime(year=year, month=month, day=i): i % 4 for i in range(1, 28)})
    c.grid()
    w.mainloop()