diff --git a/main.py b/main.py index da72251b42c107f3a6068a25195221c752d0d2cc..096e12f93304b0bbe4e2aaad73bb63e34f2df2d9 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,7 @@ from kivy.app import App -from kivy.modules import inspector # For inspection. -from kivy.core.window import Window # For inspection. +from kivy.modules import inspector # For inspection. +from kivy.core.window import Window # For inspection. +from kivy.properties import BooleanProperty, NumericProperty __app_package__ = 'edu.unl.cse.soft161.order' __app__ = 'Order Meal' @@ -9,8 +10,19 @@ __flags__ = ['--bootstrap=sdl2', '--requirements=python2,kivy', '--orientation=l class OrderApp(App): + original_price = NumericProperty(12.99) + bacon = BooleanProperty(False) + extra = NumericProperty(2.99) + total = NumericProperty(12.99) + def build(self): - inspector.create_inspector(Window, self) # For inspection (press control-e to toggle). + inspector.create_inspector(Window, self) # For inspection (press control-e to toggle). + + def update_total_charge(self): + if self.root.id.bacon(False): + self.total = self.original_price + elif self.root.id.bacon(True): + self.total = self.original_price + self.self.extra if __name__ == '__main__': diff --git a/order.kv b/order.kv index d23f9746383fbed94ff3e43c6245d396bfd765a5..6583c9b1fc0a3f9ecf706208c8acaae7317e691b 100644 --- a/order.kv +++ b/order.kv @@ -1,4 +1,75 @@ BoxLayout: orientation: 'vertical' Label: - text: '[Your meal-ordering GUI here]' + text: 'Steak-Stop' + font_size: '40sp' + size_hint: (1,.1) + BoxLayout: + orientation: 'vertical' + BoxLayout: + size_hint: (1,.3) + Label: + text: 'Menu' + BoxLayout: + orientation: 'vertical' + Button: + text: 'Rib-eye' + size_hint: (1,.1) + Button: + text: 'T-Bone' + size_hint: (1,.1) + Button: + text: 'Fillet' + size_hint: (1,.1) + Button: + text: 'Prime rump' + size_hint: (1,.1) + Button: + text: 'flat-iron' + size_hint: (1,.1) + BoxLayout: + orientation: 'horizontal' + Label: + text: 'rare' + font_size: '32sp' + Slider: + id: cook_time + range:(0,100) + value: 50 + Label: + text: 'Well-done' + font_size: '32sp' + BoxLayout: + orientation: 'horizontal' + CheckBox: + font_size: '25sp' + CheckBox: + id: bacon + font_size: '25sp' + CheckBox: + font_size: '25sp' + CheckBox: + font_size: '25sp' + BoxLayout: + orientation: 'horizontal' + Label: + text: 'steak sauce' + font_size: '15sp' + Label: + text: 'Bacon strip around steak' + font_size: '15sp' + Label: + text: 'Barbeque sauce' + font_size: '15sp' + Label: + text: 'peppercorn sauce' + font_size: '15sp' + BoxLayout: + orientation: 'vertical' + CheckBox: + text: 'idk' + font_size: '25sp' + Label: + text: 'Steak price' + str(app.total) + size_hint: (.25,1) + font_size: '20sp'