Last active
July 11, 2019 02:44
-
-
Save ocvs/03bc6067638cf49938982897c69ab3aa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class StColors(object): | |
orange = '#f5be2e' | |
bright_green = '#b7f731' | |
dark_grey = '#191919' | |
mid_grey = '#323232' | |
light_grey = '#c8c8c8' | |
def create_widgets(self, master): | |
style = Style() | |
style.theme_create("st_app", parent="alt", settings={ | |
".": {"configure": {"background": StColors.light_grey, | |
"foreground": 'black', | |
"relief": "flat", | |
"highlightcolor": StColors.bright_green}}, | |
"TLabel": {"configure": {"foreground": StColors.bright_green, | |
"padding": 10, | |
"font": ("Calibri", 12)}}, | |
"TNotebook": {"configure": {"padding": 5}}, | |
"TNotebook.Tab": {"configure": {"padding": [25, 5], | |
"foreground": "white"}, | |
"map": {"background": [("selected", StColors.mid_grey)], | |
"expand": [("selected", [1, 1, 1, 0])]}}, | |
"TCombobox": {"configure": {"selectbackground": StColors.dark_grey, | |
"fieldbackground": "white", | |
"background": StColors.light_grey, | |
"foreground": "black"}}, | |
"TButton": {"configure": {"font": ("Calibri", 13, 'bold'), | |
"padding" : [10, 8], "width" : 30, "height" : 2, | |
"background": StColors.mid_grey, | |
"foreground": StColors.bright_green}, | |
"map": {"background": [("active", StColors.bright_green)], | |
"foreground": [("active", 'black')]}}, | |
"TEntry": {"configure": {"foreground": "black"}}, | |
"Horizontal.TProgressbar": {"configure": {"background": StColors.mid_grey}} | |
}) | |
style.theme_use("st_app") | |
.............. | |
... | |
self.menu = Menu(master) | |
self.menuCadastro = Menus(self.menu, 'CADASTRAR', [ | |
("Categorias", self.cad_Cat), | |
("Lançamentos", self.cadastraContas), | |
("Faturas Cartôes", self.cad_Faturas), | |
("Tipos Pagamentos", self.cad_Tipos_Pgto), | |
("Sair", master.destroy), | |
]) | |
self.menuConsulta = Menus(self.menu, 'CONSULTAR', [ | |
("Todas as Contas", self.pesquisa_Contas), | |
("Faturas Cartões", self.cad_Faturas), | |
("Todas as Categorias", self.pesquisa_Cat), | |
("Contas/Filtro", self.lista_Personalizada), | |
("Categorias/Fitro", self.lista_PersonaCat), | |
("Tipos/Pagamentos", self.lista_tipos_pgto), | |
]) | |
self.menuSaida = Menus(self.menu, 'RELATORIOS', [ | |
("Excel Mês Atual", self.gera_planilha), | |
]) | |
self.menuEdita = Menus(self.menu, 'AJUDA', [ | |
("VERSAO 1.1", ''), | |
("HELPDESK", self.help_Desk), | |
("MANUAL", ''), | |
]) | |
... | |
class Menus(Sistema): | |
def __init__(self, menu, label_cascade, tuplas_cascade): | |
self.tuplas_cascade = tuplas_cascade | |
self.menu = menu | |
self.menuCascade = Menu(self.menu) | |
for nome, metodo in self.tuplas_cascade: | |
self.menuCascade.add_command(label=nome, command=metodo) | |
self.menu.add_cascade(label=label_cascade, menu=self.menuCascade) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment