-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
165 lines (151 loc) · 9.36 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
#coding:latin1
from errors import ValorInvalidoError
from errors import SaldoInsuficienteError
from Tkinter import *
from controller import Controller
controlador = Controller()
class Set_Gui:
def __init__(self):
#=============janela principal=================================================
mainWindow =Tk()
mainWindow.title('/-/ Banco /-/') #=============titulo=========================
#==============================================================================
#=========================descricao das opeacoes===============================
descricao=Label(mainWindow,text="Operações em conta:")
descricao.place(x=60,y=8)
#==============================================================================
#================================botoes========================================
btCadastro = Button(mainWindow,text="Cadastrar",width=20, command=self.cadastro)
btSaldo = Button(mainWindow,text="Consutar Saldo",width=20, command=self.saldo)
btSaque = Button(mainWindow,text="Saque",width=20, command=self.saque)
btDeposito = Button(mainWindow,text="Deposito",width=20, command=self.deposito)
btExtrato = Button(mainWindow,text="Extrato",width=20, command=self.extrato)
#==============================================================================
#==============================posicionamento==================================
btCadastro.place(x=60,y=30)
btSaldo.place(x=60,y=60)
btSaque.place(x=60,y=90)
btDeposito.place(x=60,y=120)
btExtrato.place(x=60,y=150)
#==============================================================================
#=========================loop da janela e size================================
mainWindow.geometry("300x200+300+200")
mainWindow.mainloop()
#==============================================================================
#===================================janela cadastro================================
def cadastro(self):
#=================================janela===================================
Window =Tk()
Window.title('/-/ Banco /-/ - Cadastro') #================titulo======================
#==========================================================================
#============================== widgets ===================================
descricao=Label(Window,text="Digite o número da conta:")
entrada=Entry(Window,width=23)
okButton=Button(Window,text="OK",width=20, command=lambda:controlador.cadastro(entrada.get(),feedbackLabel))
feedbackLabel=Label(Window,text="")
#==========================================================================
#==========================posicionamento==================================
descricao.place(x=60,y=10)
entrada.place(x=60,y=40)
okButton.place(x=60,y=80)
feedbackLabel.place(x=60,y=150)
#==========================================================================
#=========================== loop e size===================================
Window.geometry("300x200+400+200")
Window.mainloop()
#===========================================================================
#===================================janela saque===================================
def saque(self):
#================================janela========================================
Window =Tk()
Window.title('/-/ Banco /-/ - Saque') #======================titulo======================
#=============================== widgets ========================================
descricao=Label(Window,text="Conta:")
entradaNConta=Entry(Window,width=10)
descricao2=Label(Window,text="Valor:")
entradaValor=Entry(Window,width=10)
feedbackLabel=Label(Window,text="")
okButton=Button(Window,text="Ok",width=20, command=lambda:controlador.saque(entradaNConta.get(),entradaValor.get(),feedbackLabel))
#===============================================================================
#=============================== posicao ========================================
descricao.place(x=60,y=10)
entradaNConta.place(x=60,y=30)
descricao2.place(x=160,y=10)
entradaValor.place(x=160,y=30)
feedbackLabel.place(x=60,y=120)
okButton.place(x=60,y=60)
#================================================================================
#==========================size e loop ===========================================
Window.geometry("300x200+400+200")
Window.mainloop()
#==================================================================================
#================================janela consulta saldo==================================
def saldo(self):
#================================janela=======================================
Window =Tk()
Window.title('/-/ Banco /-/ - Saldo') #================titulo==========================
#==============================================================================
#============================= widgets ========================================
descricao=Label(Window,text="Digite o número da conta:")
entradaNConta=Entry(Window,width=23)
feedbackLabel=Label(Window,text="")
okButton=Button(Window,text="Ok",width=20, command=lambda:controlador.saldo(entradaNConta.get(),feedbackLabel))
#==============================================================================
#================================ posicao ======================================
descricao.place(x=60,y=10)
entradaNConta.place(x=60,y=40)
feedbackLabel.place(x=60,y=160)
okButton.place(x=60,y=70)
#================================================================================
#===============================seize e loop=====================================
Window.geometry("300x200+400+200")
Window.mainloop()
#================================================================================
# ======================================== janela deposito =====================================
def deposito(self):
#=======================================janela =============================================
Window =Tk()
Window.title('/-/ Banco /-/ - Depósito')
#===================================== widgets ===========================================
descricao=Label(Window,text="Conta:")
entradaNConta=Entry(Window,width=10)
descricao2=Label(Window,text="Valor:")
entradaValor=Entry(Window,width=10)
feedbackLabel=Label(Window,text="")
okButton=Button(Window,text="Ok",width=20, command=lambda:controlador.deposito(entradaNConta.get(),entradaValor.get(),feedbackLabel))
#==========================================================================================
#======================================== posicao ===========================================
descricao.place(x=60,y=10)
entradaNConta.place(x=60,y=30)
descricao2.place(x=160,y=10)
entradaValor.place(x=160,y=30)
feedbackLabel.place(x=60,y=120)
okButton.place(x=60,y=60)
#===========================================================================================
#===================================== loop e size=========================================
Window.geometry("300x200+400+200")
Window.mainloop()
#==============================================================================================
#================================= janela extrato ==================================================
def extrato(self):
#===========================janela =====================================================
Window =Tk()
Window.title('/-/ Banco /-/ - Extrato')
#=======================================================================================
#================================ widgets ==============================================
descricao=Label(Window,text="Conta:")
entradaNConta=Entry(Window,width=10)
feedbackLabel=Label(Window,text="")
okButton=Button(Window,text="Gerar",width=10, command=lambda:controlador.extrato(entradaNConta.get(),feedbackLabel))
#=========================================================================================
#==================================posicao================================================
descricao.place(x=60,y=10)
entradaNConta.place(x=60,y=30)
feedbackLabel.place(x=60,y=80)
okButton.place(x=160,y=30)
#========================================================================================
#===================================== size e loop =========================================
Window.geometry("300x350+400+200")
Window.mainloop()
#============================================================================================
Set_Gui()