DeukausGames

DevTools V1.2

Dec 5th, 2018
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 7.28 KB | None | 0 0
  1. """
  2.   MENU
  3.   TOOLS
  4.   TKINTER
  5. """
  6. from tkinter import *
  7. from tkinter import ttk
  8. import sys
  9. from time import sleep
  10.  
  11. versao = '1.2'
  12. emais = []
  13. email = ''
  14. pw = ''
  15. class Menu_App:
  16.     #initial function
  17.     def __init__(self, window_m):
  18.         #window
  19.         window_m.title('TOOLS BY DEUKAUS')
  20.         window_m['bg'] = 'red'
  21.  
  22.         #labels
  23.         self.title1 = Label(window_m, bg = 'red', font='bold 20 bold', fg = 'black', text = 'MENU\nTOOLS')
  24.         self.lb_versao = Label(window_m, bg = 'red', font='bold 9 bold', fg = 'black', text = 'Versão {}'.format(versao))
  25.  
  26.         #buttons
  27.         self.btn_credits = Button(window_m, bg = '#E0E0E0', text = 'Creditos', font = 'bold 20 bold', command=self.go_to_creditos, width = 10, height = 1)
  28.         self.btn_bot_email = Button(window_m, bg = '#E0E0E0', text = 'Bot Emails', font = 'bold 20 bold', command=self.go_to_bot_email, width = 10, height = 1)
  29.         self.btn_rdsc = Button(window_m, bg = '#E0E0E0', text = 'Redes\nSociais', font = 'bold 20 bold', command = self.go_to_redessociais, width = 10, height = 1)
  30.         self.btn_exit = Button(window_m, bg = '#E0E0E0', text = 'Sair', font = 'bold 20 bold', command=self.go_to_exit, width = 10, height = 1)
  31.        
  32.         #grid
  33.         self.title1.grid(column='0', row='0')
  34.         self.btn_credits.grid(column='0', row='1')
  35.         self.btn_bot_email.grid(column='0', row='2', pady = 3)
  36.         self.btn_rdsc.grid(column='0', row='3')
  37.         self.btn_exit.grid(column='0', row='4', pady = 3)
  38.         self.lb_versao.grid(column='0', row='5')
  39.  
  40.     #commands
  41.     def go_to_creditos(self):
  42.         global menu_creditos_root
  43.         menu_creditos_root = Tk()
  44.         Menu_Creditos(menu_creditos_root)
  45.         menu_creditos_root.mainloop()
  46.  
  47.     def go_to_bot_email(self):
  48.         global loguin_email_root
  49.         loguin_email_root = Tk()
  50.         logar_bot_email(loguin_email_root)
  51.         loguin_email_root.mainloop()
  52.  
  53.     def go_to_exit(self):
  54.         try:
  55.             exit()
  56.         except:
  57.             menu_root.destroy()
  58.  
  59.     def go_to_redessociais(self):
  60.         pass
  61.  
  62. class Menu_bot_email:
  63.     def __init__(self, window_mb):
  64.         #window
  65.         window_mb.title('BOT EMAIL')
  66.         window_mb['bg'] = 'white'
  67.  
  68.         #menu
  69.         self.itens_menu = Menu(window_mb)
  70.         self.menu_item_file = Menu(window_mb, tearoff=0)
  71.         self.menu_item_personalizar = Menu(window_mb)
  72.         self.menu_item_help = Menu(window_mb, tearoff=0)
  73.         self.submenu_redessociais = Menu(window_mb, tearoff=0)
  74.  
  75.         #menu itens
  76.         self.menu_item_file.add_command(label = 'Save', command = self.save)
  77.         self.menu_item_help.add_command(label = 'tutorial', command = self.tutorial)
  78.         self.menu_item_help.add_command(label = 'creditos', command = self.creditos)
  79.         self.menu_item_help.add_cascade(label = 'redes sociais', menu=self.submenu_redessociais)
  80.         self.submenu_redessociais.add_command(label = 'WebSite', command = self.website)
  81.         self.submenu_redessociais.add_command(label = 'Facebook', command = self.facebook)
  82.         self.submenu_redessociais.add_command(label = 'YouTube', command = self.youtube)
  83.         self.itens_menu.add_cascade(label = 'File', menu = self.menu_item_file)
  84.         self.itens_menu.add_cascade(label = 'Personalizar', command = self.personalizar)
  85.         self.itens_menu.add_cascade(label = 'options', command = self.abrir_opcoes)
  86.         self.itens_menu.add_cascade(label = 'Help', menu = self.menu_item_help)
  87.  
  88.         #buttons
  89.         self.open_add_email = Button(window_mb, text = 'Adicionar Email', font = 'bold 20 bold', bg = '#E0E0E0', command = self.abrir_add_email)
  90.  
  91.         #Adiciona menu ao window_mb
  92.         window_mb.config(menu = self.itens_menu)
  93.  
  94.         #grid
  95.         self.open_add_email.grid(column='0', row='1')
  96.  
  97.     def abrir_opcoes(self):
  98.         pass
  99.  
  100.     def tutorial(self):
  101.         print('teste')
  102.  
  103.     def save(self):
  104.         pass
  105.  
  106.     def creditos(self):
  107.         pass
  108.  
  109.     def website(self):
  110.         pass
  111.  
  112.     def facebook(self):
  113.         pass
  114.  
  115.     def youtube(self):
  116.         pass
  117.  
  118.     def personalizar(self):
  119.         pass
  120.        
  121.     def abrir_add_email(self):
  122.         pass
  123.          
  124. class Menu_Creditos:
  125.     def __init__(self, window_mc):
  126.         #window
  127.         window_mc.title('CREDITOS')
  128.         window_mc['bg'] = 'blue'
  129.  
  130.         #Labels
  131.          
  132.         #grid
  133.  
  134. class logar_bot_email:
  135.     def __init__(self, window_lbe):
  136.         window_lbe.title('Loguin')
  137.         window_lbe['bg'] = 'blue'
  138.  
  139.         #variables
  140.         self.statuslog = ''
  141.  
  142.         self.itens_menu_logar = Menu(window_lbe)
  143.         self.itens_menu_logar.add_cascade(label = 'Tutorial', command = self.tutorial)
  144.         window_lbe.config(menu = self.itens_menu_logar)
  145.         #labels
  146.         self.label1 = Label(window_lbe,text = 'Email : ', bg = 'blue', fg = 'red', font = 'bold')
  147.         self.label2 = Label(window_lbe, text = 'Senha : ', bg = 'blue', fg = 'red', font = 'bold')
  148.         self.label3 = Label(window_lbe, text =  self.statuslog, bg = 'blue', fg = 'red', font = 'bold')
  149.  
  150.         #buttons
  151.         self.btn_logar = Button(window_lbe, text = 'Logar', bg = '#E0E0E0', font = 'bold 10 bold', width = 15, command = self.loguinn)
  152.  
  153.         #entry
  154.         self.ent_email = Entry(window_lbe, justify = 'left')
  155.         self.ent_passw = Entry(window_lbe, justify = 'left', show ='*')
  156.  
  157.         #grid
  158.         self.label1.grid(column='0', row='1', pady='5')
  159.         self.ent_email.grid(column='1', row='1', padx='5', pady='5')
  160.         self.label2.grid(column='0', row='2', pady='5')
  161.         self.ent_passw.grid(column='1', row='2', padx='5', pady='5')
  162.         self.btn_logar.grid(column='0',columnspan='2', row='3', pady='5')
  163.        
  164.        
  165.     def tutorial(self):
  166.         pass
  167.  
  168.     def loguinn(self):
  169.         global email_user
  170.         email_user = self.ent_email.get()
  171.         global passw_user
  172.         passw_user = self.ent_passw.get()
  173.         if '@' in email_user:
  174.             if passw_user == '':
  175.                 self.statuslog = 'A senha não pode estar vazia!'
  176.                 self.label3['text'] = self.statuslog
  177.                 self.label3.grid(column='0', columnspan='2', row='5', pady='5')
  178.             else:
  179.                 sleep(3)
  180.                 loguin_email_root.destroy()
  181.                 global menu_bot_email_root
  182.                 menu_bot_email_root = Tk()
  183.                 Menu_bot_email(menu_bot_email_root)
  184.                 loguin_email_root.mainloop()
  185.                 menu_bot_email_root.mainloop()
  186.         elif email_user != '':
  187.             self.statuslog = 'Por favor, insira um email valido!'
  188.             self.label3['text'] = self.statuslog
  189.             self.label3.grid(column='0', columnspan='2', row='5', pady='5')
  190.  
  191.         elif email_user == '' and passw_user == '':
  192.             self.statuslog = 'Os campos não podem estar vazios!'
  193.             self.label3['text'] = self.statuslog
  194.             self.label3.grid(column='0',columnspan='2',row='5', pady='5')
  195.  
  196.         elif email_user == '':
  197.             self.statuslog = 'O email não pode estar vazio!'
  198.             self.label3['text'] = self.statuslog
  199.             self.label3.grid(column='0', columnspan='2', row='5', pady='5')            
  200.  
  201.  
  202.        
  203.  
  204.  
  205. menu_root = Tk()
  206. Menu_App(menu_root)
  207. menu_root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment