diff --git a/main.py b/main.py index da72251b42c107f3a6068a25195221c752d0d2cc..854e03c841eaf3c059d8ecd1d7b7982c04b8a2b3 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,9 @@ 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 +from kivy.uix import button + __app_package__ = 'edu.unl.cse.soft161.order' __app__ = 'Order Meal' @@ -9,9 +12,28 @@ __flags__ = ['--bootstrap=sdl2', '--requirements=python2,kivy', '--orientation=l class OrderApp(App): + + charge_total = NumericProperty(0.00) + + def build(self): inspector.create_inspector(Window, self) # For inspection (press control-e to toggle). + def update_bite_charge(self): + app.charge_total+=1.5 + def update_mega_charge(self): + app.charge_total+=3 + def update_giga_charge(self): + app.charge_total+=8.75 + def update_tera_charge(self): + app.charge_total+=25 + + + + + + + if __name__ == '__main__': app = OrderApp() diff --git a/order.kv b/order.kv index d23f9746383fbed94ff3e43c6245d396bfd765a5..516263b9c44fe55792d0bbf7744f479e0a16a31b 100644 --- a/order.kv +++ b/order.kv @@ -1,4 +1,33 @@ BoxLayout: orientation: 'vertical' Label: - text: '[Your meal-ordering GUI here]' + text: 'Bits and Bites' + font_size: 45 + bold: True + Label: + text: 'By: Josh Martin' + font_size: 20 + Label: + text: 'Subtotal: $'+ str(app.charge_total) + Button: + text: 'Restart Order' + on_press: app.charge_total=0.0 + Button: + id: bite + text: 'Add to order: One Bite - $1.50' + on_press: app.update_bite_charge() + Button: + id: mega + text: 'Add to order: One Megabite - $3.00' + on_press: app.update_mega_charge() + Button: + id: giga + text: 'Add to order: One Gigabite - $8.75' + on_press: app.update_giga_charge() + Button: + id: tera + text: 'Add to order: One Terabite - $25.00' + on_press: app.update_tera_charge() + + +