-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from Vinay-Singh-Chauhan/master
Modularize:
- Loading branch information
Showing
5 changed files
with
243 additions
and
231 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from tkinter import * | ||
from constants import Colors | ||
from constants import Paths | ||
|
||
def about(): | ||
about_window = Toplevel() | ||
about_window.title("About") | ||
about_window.geometry("1152x700") | ||
about_window.configure(bg=Colors.CONCOL) | ||
canvas = Canvas( | ||
about_window, | ||
bg=Colors.CONCOL, | ||
height=700, | ||
width=1152, | ||
bd=0, | ||
highlightthickness=0, | ||
relief="ridge") | ||
canvas.place(x=0, y=0) | ||
|
||
background_img = PhotoImage(file=Paths.IMAGE_DIRECTORY+"about_bg.png") | ||
background = canvas.create_image( | ||
586.5, 334.0, | ||
image=background_img) | ||
|
||
about_window.resizable(False, False) | ||
about_window.mainloop() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
from tkinter import * | ||
from sqlite import add_order | ||
# Confirm window | ||
from constants import Colors | ||
from constants import Dimensions | ||
from constants import Paths | ||
|
||
|
||
def confirm(window,ordered,order_window): | ||
|
||
def yes(): | ||
phone = entry0.get() | ||
name = entry1.get() | ||
|
||
ordered["Total"] = int(ordered["Total"][2:]) | ||
Ordered = dict(sorted(ordered.items())) | ||
ordered_nums = list(Ordered.values()) | ||
|
||
add_order(name, phone, ordered_nums) | ||
|
||
confirm_window.destroy() | ||
order_window.destroy() | ||
window.destroy() | ||
|
||
def no(): | ||
confirm_window.destroy() | ||
|
||
confirm_window = Toplevel() | ||
confirm_window.title("Confirm") | ||
confirm_window.geometry("821x525") | ||
confirm_window.configure(bg=Colors.WHITE) | ||
canvas = Canvas( | ||
confirm_window, | ||
bg=Colors.WHITE, | ||
height=525, | ||
width=821, | ||
bd=0, | ||
highlightthickness=0, | ||
relief="ridge") | ||
canvas.place(x=0, y=0) | ||
|
||
entry0 = Entry(confirm_window, | ||
bd=0, | ||
bg=Colors.CNFRMCOL, | ||
font=("Fira Code", 20)) | ||
entry0.place( | ||
x=416.5, y=173, | ||
width=200.0, | ||
height=47) | ||
|
||
entry1 = Entry(confirm_window, | ||
bd=0, | ||
bg=Colors.CNFRMCOL, | ||
font=("Fira Code", 20)) | ||
|
||
entry1.place( | ||
x=416.5, y=108, | ||
width=200.0, | ||
height=47) | ||
|
||
img0 = PhotoImage(file=Paths.IMAGE_DIRECTORY+"no.png") | ||
b0 = Button(confirm_window, | ||
image=img0, | ||
command=no, | ||
relief="flat") | ||
|
||
b0.place( | ||
x=488, y=385, | ||
width=Dimensions.BUTTON_WIDTH, | ||
height=Dimensions.BUTTON_HEIGHT) | ||
|
||
img1 = PhotoImage(file=Paths.IMAGE_DIRECTORY+"yes.png") | ||
b1 = Button(confirm_window, | ||
image=img1, | ||
command=yes, | ||
relief="flat") | ||
|
||
b1.place( | ||
x=207, y=385, | ||
width=Dimensions.BUTTON_WIDTH, | ||
height=Dimensions.BUTTON_HEIGHT) | ||
|
||
background_img = PhotoImage(file=Paths.IMAGE_DIRECTORY+"background.png") | ||
background = canvas.create_image(320.0, 179.5, image=background_img) | ||
|
||
confirm_window.resizable(False, False) | ||
confirm_window.mainloop() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Constants for Colors | ||
class Colors: | ||
WHITE = "#FFFFFF" | ||
BLACK = "#000000" | ||
RED = "#FF0000" | ||
GREEN = "#00FF00" | ||
BLUE = "#0000FF" | ||
CNFRMCOL = "#F6D6B1" | ||
ORDCOL="#B47950" | ||
ORDENTRY="#C4C4C4" | ||
CONCOL="#f4fbfd" | ||
class Dimensions: | ||
#constants for Home page buttons | ||
#About us button | ||
ABT_WIDTH = 219 | ||
ABT_HEIGHT = 62 | ||
|
||
#ORDER NOW button | ||
ORD_HEIGHT = 62 | ||
ORD_WIDTH = 267 | ||
|
||
# Constants for Other Button Sizes | ||
BUTTON_WIDTH = 153 | ||
BUTTON_HEIGHT = 53 | ||
|
||
# Constants for Image Paths | ||
class Paths: | ||
IMAGE_DIRECTORY = r"Images\\" |
Oops, something went wrong.