Skip to content
Snippets Groups Projects
Commit 115a745d authored by astumpff2's avatar astumpff2
Browse files

Editted the software to display a menu of drinks, main dishes, side dishes...

Editted the software to display a menu of drinks, main dishes, side dishes while a progress bar dynamically changes to show how far you are into the order. Then there is a box to check which once checked, will tell you your order
parent 7cd4824c
No related branches found
No related tags found
No related merge requests found
......@@ -4,9 +4,35 @@ from kivy.core.window import Window # For inspection.
class OrderApp(App):
drink_choice = 'empty'
main_choice = 'empty'
side_choice = 'empty'
drink_progress = 0
main_progress = 0
side_progress = 0
total_progress = 0
def build(self):
inspector.create_inspector(Window, self) # For inspection (press control-e to toggle).
def drink_choices(self, choice):
self.drink_choice = choice
self.drink_progress = 333
self.total_progress = self.drink_progress+self.main_progress+self.side_progress
self.root.ids.progress.value = self.total_progress
def main_choices(self, choice):
self.main_choice = choice
self.main_progress = 333
self.total_progress = self.drink_progress+self.main_progress+self.side_progress
self.root.ids.progress.value = self.total_progress
def side_choices(self, choice):
self.side_choice = choice
self.side_progress = 333
self.total_progress = self.drink_progress+self.main_progress+self.side_progress
self.root.ids.progress.value = self.total_progress
if __name__ == '__main__':
app = OrderApp()
......
......@@ -2,22 +2,87 @@ BoxLayout:
orientation: 'vertical'
canvas.before:
Color:
rgba: (0.0, 0.1, 0.3, 1.0)
rgba: (0.3, 0.6, 0.4, 1.0)
Rectangle:
pos: self.pos
size: self.size
Label:
text: 'A Restaurant'
text: 'Diner'
font_size: sp(48)
GridLayout:
rows: 3
cols: 3
Label:
text: 'Drink'
font_size: sp(20)
Label:
text: 'Main'
font_size: sp(20)
Label:
text: 'Side'
font_size: sp(20)
GridLayout:
rows: 3
Button:
text: 'Lemonade'
on_press: app.drink_choices('Lemonade')
font_size: sp(10)
Button:
text: 'Coca-Cola'
font_size: sp(10)
on_press: app.drink_choices('Coca-Cola')
Button:
text: 'Water'
font_size: sp(10)
on_press: app.drink_choices('Water')
GridLayout:
rows: 3
Button:
text: 'Burger'
on_press: app.main_choices('Hamburger')
font_size: sp(10)
Button:
text: 'Pizza'
font_size: sp(10)
on_press: app.main_choices('Pizza')
Button:
text: 'Ribs'
font_size: sp(10)
on_press: app.main_choices('Ribs')
GridLayout:
rows: 3
Button:
text: 'Fries'
on_press: app.side_choices('Fries')
font_size: sp(10)
Button:
text: 'Salad'
font_size: sp(10)
on_press: app.side_choices('Salad')
Button:
text: 'Onion Rings'
font_size: sp(10)
on_press: app.side_choices('Onion Rings')
BoxLayout:
Label:
text: 'Order Progress'
font_size: sp(10)
ProgressBar:
id:progress
value: 0
min: 0
max: 1000
BoxLayout:
orientation: 'horizontal'
Label:
text: 'How much food?'
text: 'Are you finished with your order? Check the box to confirm'
size_hint: (None, 1.0)
size: self.texture_size
padding: (sp(12), 0)
Slider:
range: (0, 100)
CheckBox:
id: switch
Label:
text: f'Your total is $0.00'
font_size: sp(24)
text: f'Your drink is {app.drink_choice} and your main dish is {app.main_choice} and your side is {app.side_choice}' if switch.active else''
font_size: sp(15)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment