Skip to content

Commit

Permalink
Merge pull request #9 from Vinay-Singh-Chauhan/master
Browse files Browse the repository at this point in the history
Modularize:
  • Loading branch information
kom-senapati authored Oct 15, 2023
2 parents f0abdbc + b3d6090 commit 2d69357
Show file tree
Hide file tree
Showing 5 changed files with 243 additions and 231 deletions.
26 changes: 26 additions & 0 deletions about.py
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()
87 changes: 87 additions & 0 deletions confirm_window.py
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()
28 changes: 28 additions & 0 deletions constants.py
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\\"
Loading

0 comments on commit 2d69357

Please sign in to comment.