-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnumber8bid_calculator.py
149 lines (115 loc) · 4.87 KB
/
number8bid_calculator.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
from tkinter import *
from tkinter import colorchooser
window = Tk()
window.geometry("320x280")
window.title("Number 8 bid final payment calculator v1.2 by Joe") # My link: https://github.com/codingmanj
check = StringVar()
check1 = StringVar()
def submit_tellme(event=None):
result = round((float(amountEntry.get())*1.15*1.15),2)
finalpaymenttext.config(text=result)
window.bind("<Return>",submit_tellme)
def clearme(event=None):
amountEntry.delete(0,END)
window.bind("<Up>",clearme)
def clearme_result(event=None):
finalpaymenttext.config(text="")
window.bind("<Down>",clearme_result)
def backspace():
amountEntry.delete(len(amountEntry.get())-1,END)
def whatistheamount():
result = check.get()
label_amounttopayplatform_text.config(text=result)
def whatistheamountgst():
result = check1.get()
label_amounttopaygst_text.config(text=result)
def bgcolor():
window.config(bg=colorchooser.askcolor()[1])
def label_amounttopayplatform_color():
label_amounttopayplatform.config(bg=colorchooser.askcolor()[1])
def label_amounttopaygst_color():
label_amounttopaygst.config(bg=colorchooser.askcolor()[1])
def createwindow():
newwindows = Tk()
newwindows.geometry("320x280")
newwindows.title("Some auction rules")
rules = Label(newwindows,text="Inspection is highly recommended\nas buyers are responsible for determining for\nthemselves of any item's condition or functionality.").pack()
amountlabel = Label(window,
text="Auction\nAmount:",
compound='right')
amountEntry = Entry(window,
font=('verdana',16),
width=5,
)
sumbitbutton = Button(window,
text='To be paid?',
command=submit_tellme)
clearbutton = Button(window,
text='Clear amount',
command=clearme)
backspacebutton = Button(window,
text='Backspace',
command=backspace)
clearresultbutton = Button(window,
text='Clear result',
command=clearme_result)
bgcolorbutton = Button(window,
text="Change bg color",
command=bgcolor)
newwindowbutton = Button(window,
text="Some auction rules",
command=createwindow).pack(anchor=E,side=BOTTOM)
label_amounttopayplatform_color_button = Button(window,
text="Change number8\ncheckbox bg color",
command=label_amounttopayplatform_color)
label_amounttopaygst_color_button= Button(window,
text="Change GST\ncheckbox bg color",
command=label_amounttopaygst_color)
checkbox_amounttopayplatform = Checkbutton(window,
onvalue="15%",
offvalue="",
variable=check,
command=whatistheamount)
label_amounttopayplatform = Label(window,
text="+ Number8 charge %",
bg='red')
checkbox_amounttopaygst = Checkbutton(window,
onvalue="15%",
offvalue="",
variable=check1,
command=whatistheamountgst,)
label_amounttopaygst= Label(window,
text="+ GST %",
bg='yellow')
label_amounttopayplatform_text = Label(window,
font=('verdana',8),
text="")
label_amounttopaygst_text = Label(window,
font=('verdana',8),
text="")
finalpaymentlabel = Label(window,
text="is actual amount\nto be paid.")
finalpaymenttext = Label(window,
font=('verdana',16),
text="",
)
amountlabel.place(x=2,y=1)
amountEntry.place(x=60,y=5)
sumbitbutton.place(x=140,y=5)
bgcolorbutton.pack(anchor=W,side=BOTTOM)
label_amounttopayplatform_color_button.pack(anchor=W,side=BOTTOM)
label_amounttopaygst_color_button.pack(anchor=W,side=BOTTOM)
clearbutton.place(x=2,y=40)
backspacebutton.place(x=90,y=40)
clearresultbutton.place(x=160,y=40)
#----------------
label_amounttopayplatform_text.place(x=2,y=70)
label_amounttopaygst_text.place(x=2,y=100)
checkbox_amounttopayplatform.place(x=35,y=70)
label_amounttopayplatform.place(x=60,y=70)
checkbox_amounttopaygst.place(x=35,y=100)
label_amounttopaygst.place(x=60,y=100)
#-----------------
finalpaymentlabel.pack(anchor=SE,side=BOTTOM)
finalpaymenttext.pack(anchor=SE,side=RIGHT)
mainloop()