diff --git a/main.py b/main.py index da72251b42c107f3a6068a25195221c752d0d2cc..adef673456d477d709ec6461c0350bf672efe8de 100644 --- a/main.py +++ b/main.py @@ -1,7 +1,7 @@ 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' __version__ = '0.1' @@ -12,6 +12,27 @@ class OrderApp(App): def build(self): inspector.create_inspector(Window, self) # For inspection (press control-e to toggle). + money = NumericProperty(10) + total_price = NumericProperty(0) + chicken_price = 4 + ham_price= 4 + + def chicken_buy(self): + self.total_price+=4 + + def beef_buy(self): + self.total_price+=4 + + def ham_buy(self): + self.total_price+=4 + + def checkout(self): + self.money=self.money-self.total_price + self.total_price=0 + + + + if __name__ == '__main__': app = OrderApp() diff --git a/order.kv b/order.kv index d23f9746383fbed94ff3e43c6245d396bfd765a5..4e05063026c385be0a9063f7f2550617660d0ef7 100644 --- a/order.kv +++ b/order.kv @@ -1,4 +1,57 @@ BoxLayout: orientation: 'vertical' Label: - text: '[Your meal-ordering GUI here]' + text: 'UNL Sandwich Shop' + BoxLayout: + Label: + + size_hint: (1, 0.25) + text: 'Chicken' + Button: + id: chicken_purchase_button + size_hint: (1, 0.25) + text: 'Purchase' + on_press: app.chicken_buy() + + BoxLayout: + Label: + + size_hint: (1, 0.25) + text: 'Beef' + Button: + id: beef_purchase_button + size_hint: (1, 0.25) + text: 'Purchase' + on_press: app.beef_buy() + + BoxLayout: + Label: + + size_hint: (1, 0.25) + text: 'Ham' + Button: + id: ham_purchase_button + size_hint: (1, 0.25) + text: 'Purchase' + on_press: app.ham_buy() + + BoxLayout: + Label: + font_size:'24sp' + text: 'Money' + + Label: + text: '$'+str(app.money) + + BoxLayout: + Label: + font_size:'24sp' + text: 'Total Price' + + Label: + text: '$'+str(app.total_price) + + BoxLayout: + Button: + text: 'Checkout' + on_press: app.checkout()