Created as a simple rough estimate submission. The sloppy code is too long and will be fixed in the future. We are planning to try PDF conversion in the future.
import tkinter as tk
def callBackFunc():
global a
global a1
a=str('Product 1')
a1=10000000
def callBackFunc1():
global a,a1
a=str('Product 2')
a1=20000000
def callBackFunc2():
global a,a1
a=str('Product 3')
a1=8000000
def callBackFunc3():
global b,b1
b=str('2 wavelengths')
b1=5000000
def callBackFunc4():
global b,b1
b=str('3 wavelengths')
b1=6500000
def callBackFunc5():
global b,b1
b=str('4 wavelengths')
b1=7500000
app = tk.Tk()
app.geometry('300x200')
#-------------CSU screen------------
#Create 2 checkboxes
chkValue = tk.BooleanVar()
chkValue.set(False)
chkValue1 = tk.BooleanVar()
chkValue1.set(False)
chkValue2 = tk.BooleanVar()
chkValue2.set(False)
#3 checkboxes text
chkExample = tk.Checkbutton(app, text='CSUW1',
var=chkValue, command=callBackFunc)
chkExample1 = tk.Checkbutton(app, text='CSUW1SoRa',
var=chkValue1, command=callBackFunc1)
chkExample2 = tk.Checkbutton(app, text='CSUX1',
var=chkValue2, command=callBackFunc2)
#2 check boxes
chkExample.place(x=30, y=30)
chkExample1.place(x=30, y=50)
chkExample2.place(x=30, y=70)
frame1=tk.Frame()
frame1.place(x=30,y=100)
#Button to return from frame 1 to main frame
back_button = tk.Button(frame1, text="laser", command=changePage)
back_button.pack()
#----------Laser screen----------------------
def changePage():
frame2=tk.Frame()
frame2.place(x=30,y=100)
back_button = tk.Button(frame2, text="Estimates", command=changePage1)
back_button.pack()
#Create 2 checkboxes
chkValue3 = tk.BooleanVar()
chkValue3.set(False)
chkValue4 = tk.BooleanVar()
chkValue4.set(False)
chkValue5 = tk.BooleanVar()
chkValue5.set(False)
#3 checkboxes text
chkExample3 = tk.Checkbutton(app, text='2 wavelengths',
var=chkValue3, command=callBackFunc3)
chkExample4 = tk.Checkbutton(app, text='3 wavelengths',
var=chkValue4, command=callBackFunc4)
chkExample5 = tk.Checkbutton(app, text='4 wavelengths',
var=chkValue5, command=callBackFunc5)
#2 check boxes
chkExample3.place(x=30, y=30)
chkExample4.place(x=30, y=50)
chkExample5.place(x=30, y=70)
#-----------Quote screen---------------------
def changePage1():
app1 = tk.Tk()
app1.geometry('500x300')
app1.title('Approximate estimate')
lbl=tk.Label(app1,text='Approximate estimate')
lbl.place(x=30,y=50)
txt=tk.Entry(app1,width=20)
txt.place(x=30,y=80)
lbl1=tk.Label(app1,text='Mr')
lbl1.place(x=180,y=80)
lbl2=tk.Label(app1,text='product name')
lbl2.place(x=30,y=120)
lbl5=tk.Label(app1,text=str(a))
lbl5.place(x=30,y=180)
lbl8=tk.Label(app1,text=str(b))
lbl8.place(x=30,y=210)
lbl3=tk.Label(app1,text='List price')
lbl3.place(x=250,y=120)
lbl6=tk.Label(app1,text=str(a1))
lbl6.place(x=250,y=180)
lbl9=tk.Label(app1,text=str(b1))
lbl9.place(x=250,y=210)
lbl4=tk.Label(app1,text='Partition')
lbl4.place(x=400,y=120)
lbl7=tk.Label(app1,text=str(int(a1)*0.8))
lbl7.place(x=400,y=180)
lbl10=tk.Label(app1,text=str(int(b1)*0.8))
lbl10.place(x=400,y=210)
lbl11=tk.Label(app1,text='total')
lbl11.place(x=200,y=240)
lbl12=tk.Label(app1,text=str(int(a1)+int(b1)))
lbl12.place(x=250,y=240)
lbl13=tk.Label(app1,text=str(int(a1)*0.8+int(b1)*0.8))
lbl13.place(x=400,y=240)
back_button = tk.Button(app1, text="PDF")
back_button.pack()
app.mainloop()
Recommended Posts