Commit 5bfc4404 authored by Carsten James Scholle's avatar Carsten James Scholle
Browse files

Order App

parent 1f0ddda5
from kivy.app import App
from kivy.modules import inspector # For inspection.
from kivy.core.window import Window # For inspection.
from kivy.properties import NumericProperty
__app_package__ = 'edu.unl.cse.soft161.order'
__app__ = 'Order Meal'
......@@ -8,10 +10,24 @@ __version__ = '0.1'
__flags__ = ['--bootstrap=sdl2', '--requirements=python2,kivy', '--orientation=landscape']
class OrderApp(App):
price = NumericProperty(0)
def build(self):
inspector.create_inspector(Window, self) # For inspection (press control-e to toggle).
def pizza_size(self):
if self.roots.ids.small.state == 'down':
self.price = 9
if self.roots.ids.medium.state == 'down':
self.price = 11
if self.roots.ids.large.state == 'down':
self.price = 13
if self.roots.ids.extra_large.state == 'down':
self.price = 15
if __name__ == '__main__':
app = OrderApp()
......
BoxLayout:
orientation: 'vertical'
Label:
text: '[Your meal-ordering GUI here]'
text: 'Papa Johns'
BoxLayout:
orientation: 'horizontal'
Label:
text: 'Choose your size'
font_size: '18sp'
ToggleButton:
id: 'small'
text: 'small'
size_hint: (.25,.5)
group: 'size'
font_size: '18sp'
ToggleButton:
id: 'medium'
text: 'medium'
size_hint: (.25,.5)
group: 'size'
font_size: '18sp'
ToggleButton:
id: 'large'
text: 'large'
size_hint: (.25,.5)
group: 'size'
font_size: '18sp'
ToggleButton:
id: 'extra_large'
text: 'extra large'
size_hint: (.25,.5)
group: 'size'
font_size: '18sp'
BoxLayout:
orientation: 'horizontal'
Label:
text: 'Choose your crust'
font_size: '20sp'
ToggleButton:
text: 'thin'
size_hint: (.33,.5)
group: 'crust'
font_size: '20sp'
ToggleButton:
text: 'regular'
size_hint: (.33,.5)
group: 'crust'
font_size: '20sp'
ToggleButton:
text: 'thick'
size_hint: (.33,.5)
group: 'crust'
font_size: '20sp'
BoxLayout:
orientation: 'horizontal'
Label:
text: 'How much sauce?'
font_size: '20sp'
ToggleButton:
text: 'normal'
size_hint: (.25,.5)
group: 'sauce'
font_size: '20sp'
ToggleButton:
text: 'light'
size_hint: (.25,.5)
group: 'sauce'
font_size: '20sp'
ToggleButton:
text: 'extra'
size_hint: (.25,.5)
group: 'sauce'
font_size: '20sp'
ToggleButton:
text: 'no sauce'
size_hint: (.25,.5)
group: 'sauce'
font_size: '20sp'
BoxLayout:
orientation: 'horizontal'
Label:
text: 'How much cheese?'
font_size: '20sp'
ToggleButton:
text: 'normal'
size_hint: (.33,.5)
group: 'cheese'
font_size: '20sp'
ToggleButton:
text: 'light'
size_hint: (.33,.5)
group: 'cheese'
font_size: '20sp'
ToggleButton:
text: 'no cheese'
size_hint: (.33,.5)
group: 'cheese'
font_size: '20sp'
BoxLayout:
orientation: 'horizontal'
Label:
text: 'Choose your toppings'
font_size: '20sp'
ToggleButton:
text: 'sausage'
size_hint: (.33,.5)
font_size: '20sp'
group: 'toppings'
ToggleButton:
text: 'pepperoni'
size_hint: (.33,.5)
font_size: '20sp'
group: 'toppings'
ToggleButton:
text: 'veggies'
size_hint: (.33,.5)
font_size: '20sp'
group: 'toppings'
Label:
text: 'Total:'
font_size: '20sp'
Label:
id: 'total'
text: '$' + str(app.price())
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment