diff --git a/main.py b/main.py index da72251b42c107f3a6068a25195221c752d0d2cc..b6e6e6ebdf152ba10156cf07455d3665fc183193 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,8 @@ 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() diff --git a/order.kv b/order.kv index d23f9746383fbed94ff3e43c6245d396bfd765a5..d10540b6949a2ce83ef6a7c2c853e1ba0ddb58a5 100644 --- a/order.kv +++ b/order.kv @@ -1,4 +1,125 @@ 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()) +