Tela_Mecanico.py 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. from tkinter import *
  2. from tkinter import messagebox
  3. class Mecanico:
  4. def __init__(self):
  5. self.janela = Tk()
  6. self.janela.title('Mecânico')
  7. self.titleStyles = ('Arial', 14)
  8. self.textStyles = ('Roboto', 14)
  9. self.janela.maxsize(1200, 600)
  10. self.janela.minsize(1200, 600)
  11. self.janela.configure(bg='#363636')
  12. self.janela.minsize(width=1200, height=600)
  13. self.janela.iconbitmap('automotivo.ico')
  14. self.LoginCanvas = Canvas(master=self.janela, width=600, height=370)
  15. self.LoginCanvas.pack(expand=1, fill=BOTH)
  16. self.Back = PhotoImage(master=self.janela, file="mecanico.png")
  17. self.LoginCanvas.create_image(0, 0, image=self.Back, anchor=NW)
  18. self.hoverColor1 = '#00BFFF'
  19. self.hoverColor2 = '#FF0000'
  20. self.botaoCadastrar = Button(self.janela, text="Cadastrar\nOrçamento", font=self.textStyles, width=15,
  21. height=3, pady=5, bg="#4682B4", fg="white", relief=RAISED, command=self.cadastrarOrcamento)
  22. self.LoginCanvas.create_window(900, 130, window=self.botaoCadastrar)
  23. self.botaoCadastrar.bind("<Enter>", self.hoverIn1)
  24. self.botaoCadastrar.bind("<Leave>", self.hoverOut)
  25. self.botaoOrdem = Button(self.janela, text="Ordem\n de \nServiço", font=self.textStyles,
  26. width=15, height=3, pady=1, bg="#4682B4", fg="white", relief=RAISED, command=self.verOrdem)
  27. self.LoginCanvas.create_window(900, 265, window=self.botaoOrdem)
  28. self.botaoOrdem.bind("<Enter>", self.hoverIn1)
  29. self.botaoOrdem.bind("<Leave>", self.hoverOut)
  30. self.botaoSair = Button(self.janela, text="SAIR", font=self.textStyles, width=5,
  31. bg="#4682B4", fg="white", pady=5, relief=RAISED, command=self.saiu)
  32. self.LoginCanvas.create_window(900, 400, window=self.botaoSair)
  33. self.botaoSair.bind("<Enter>", self.hoverIn2)
  34. self.botaoSair.bind("<Leave>", self.hoverOut)
  35. self.titulo = Label(self.janela, bg='#363636',
  36. fg='white', font=self.titleStyles, text='MECÂNICO')
  37. self.titulo.pack(padx=0, pady=10)
  38. mainloop()
  39. def cadastrarOrcamento(self):
  40. from cadastrarOrcamento import cadastrar_orcamento
  41. return
  42. def hoverIn1(self, event):
  43. event.widget.configure(bg=self.hoverColor1, fg="white", relief=GROOVE)
  44. def hoverIn2(self, event):
  45. event.widget.configure(bg=self.hoverColor2, fg="white", relief=GROOVE)
  46. def hoverOut(self, event):
  47. event.widget.configure(bg='#4682B4', relief=RAISED)
  48. def saiu(self):
  49. self.janela.destroy()
  50. from Tela_Login import Tela_de_Login
  51. return
  52. def verOrdem(self):
  53. from visualizarOrdemMecanico import verOrdensMecanico
  54. return
  55. minhaTela = Mecanico()