visualizarOrcamento.py 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. from tkinter import *
  2. import tkinter as tk
  3. from tkinter import ttk
  4. from tkinter import messagebox
  5. from tkinter.font import BOLD
  6. class ver_Orcamentos():
  7. def __init__(self):
  8. self.janela = Tk()
  9. self.janela.title('Orçamento')
  10. self.janela.geometry('1600x900')
  11. self.janela.minsize(1600, 900)
  12. self.janela.maxsize(1600, 900)
  13. self.janela.config(bg="#484848")
  14. self.janela.state("zoomed")
  15. self.janela.iconbitmap('automotivo.ico')
  16. # ============= SEÇÕES ================ #
  17. self.containerInicial = Label(self.janela, bg="#484848", fg="white", text='Orçamentos', font=(
  18. "Roboto", 25, BOLD))
  19. self.container = LabelFrame(self.janela, bg="#484848", fg="#e1e3db")
  20. self.rodape = Frame(self.janela, bg="#484848")
  21. self.containerInicial.pack(fill='x', expand='no', pady=40)
  22. self.container.pack(fill='x', expand='yes', ipadx=30, padx=30)
  23. self.rodape.pack(fill='both', expand='no', padx=20)
  24. # ------------------- TREEVIEW ------------------ #
  25. self.style = ttk.Style(master=self.janela)
  26. self.style.theme_use("clam")
  27. self.style.configure("mystyle.Treeview", font=("Roboto", 14))
  28. self.style.configure("mystyle.Treeview.Heading", font=("Roboto", 16))
  29. self.style.configure("Treeview", background="silver",
  30. rowheight=25, fieldbackground="#E0FFFF",)
  31. self.style.configure("Heading", background="#4682B4", foreground="white")
  32. self.cabecalho = ('#', 'cliente', 'cpfCliente', 'mecanico', 'cpfMecanico',
  33. 'servico', 'valor')
  34. self.trv = ttk.Treeview(
  35. self.container, selectmode='browse', columns=self.cabecalho, show='headings')
  36. self.trv.column('#', width=30)
  37. self.trv.column('cliente', anchor='center', width=300)
  38. self.trv.column('cpfCliente', anchor='center', width=200)
  39. self.trv.column('mecanico', anchor='center', width=300)
  40. self.trv.column('cpfMecanico', anchor='center', width=200)
  41. self.trv.column('servico', anchor='center', width=200)
  42. self.trv.column('valor', anchor='center', width=200)
  43. self.trv.heading('#', text='#')
  44. self.trv.heading('cliente', text='Nome do Cliente')
  45. self.trv.heading('cpfCliente', text='CPF do Cliente')
  46. self.trv.heading('mecanico', text='Nome do Mecânico')
  47. self.trv.heading('cpfMecanico', text='CPF do Mecânico')
  48. self.trv.heading('servico', text='Serviço')
  49. self.trv.heading('valor', text='Valor')
  50. self.trv.bind('<Double 1>', self.pegar_linha)
  51. self.trv.pack(pady=20)
  52. self.popular()
  53. # ========= SEÇÃO RODAPÉ ======= #
  54. # ---------- BOTÃO ----------- #
  55. self.aprovarBtn = Button(self.container, text='Aprovar', font=("Roboto", 14, BOLD), width='20', height=2,
  56. command=self.ver_concluidas, bg="#566981", fg="#e1e3db", relief=RAISED)
  57. self.aprovarBtn.pack(side='left', pady=20, padx=275)
  58. self.aprovarBtn.bind("<Enter>", self.hoverIn1)
  59. self.aprovarBtn.bind("<Leave>", self.hoverOut)
  60. self.deletarBtn = Button(self.container, text='Deletar', font=("Roboto", 14, BOLD), width='20', height=2,
  61. command=self.mostrar_todos, bg="#566981", fg="#e1e3db", relief=RAISED)
  62. self.deletarBtn.pack(side='right', pady=20, padx=275)
  63. self.deletarBtn.bind("<Enter>", self.hoverIn3)
  64. self.deletarBtn.bind("<Leave>", self.hoverOut)
  65. self.voltarBtn = Button(self.rodape, text='Voltar', font=("Roboto", 14, BOLD), width='20', height=2,
  66. command=self.voltar_tela, bg="#cc0000", fg="#e1e3db", relief=RAISED)
  67. self.voltarBtn.pack(side='right', pady=40)
  68. self.voltarBtn.bind("<Enter>", self.hoverIn3)
  69. self.voltarBtn.bind("<Leave>", self.hoverOut2)
  70. mainloop()
  71. # ============= FUNÇÕES ============== #
  72. def pegar_linha(self, identificador):
  73. return
  74. def popular(self):
  75. # self.trv.delete(*self.trv.get_children())
  76. # staff = TabFunc()
  77. # for i in staff.populate():
  78. # self.trv.insert('', 'end', values=i)
  79. return
  80. def ver_concluidas(self):
  81. return
  82. def mostrar_todos(self):
  83. return
  84. def ver_ativas(self):
  85. return
  86. def voltar_tela(self):
  87. self.janela.destroy()
  88. return
  89. def hoverIn1(self, event): # verde
  90. event.widget.config(bg="#3CB371", fg="white", relief=GROOVE)
  91. def hoverIn3(self, event): # vermelho
  92. event.widget.config(bg="#8B0000", fg="white", relief=GROOVE)
  93. def hoverOut(self, event):
  94. event.widget.config(bg="#566981", fg="#e1e3db", relief=RAISED)
  95. def hoverOut2(self, event):
  96. event.widget.config(bg="#cc0000", fg="#e1e3db", relief=RAISED)
  97. minhaTela = ver_Orcamentos()